82 lines
2.0 KiB
YAML
82 lines
2.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: consul
|
|
namespace: consul
|
|
labels:
|
|
app: consul
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: consul
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: consul
|
|
spec:
|
|
containers:
|
|
- name: consul
|
|
image: 'swr.cn-south-1.myhuaweicloud.com/starsl.cn/consul:latest'
|
|
args:
|
|
- agent
|
|
ports:
|
|
- name: http
|
|
containerPort: 8500
|
|
protocol: TCP
|
|
env:
|
|
- name: TZ
|
|
value: Australia/Sydney
|
|
volumeMounts:
|
|
- name: consul-data
|
|
mountPath: /consul/data
|
|
- name: consul-config
|
|
mountPath: /consul/config
|
|
imagePullPolicy: IfNotPresent
|
|
volumes:
|
|
- name: consul-data
|
|
persistentVolumeClaim:
|
|
claimName: consul-data-pvc
|
|
hostPath:
|
|
path: /mnt/nfs/AppData/consul/data
|
|
type: Directory
|
|
- name: consul-config
|
|
persistentVolumeClaim:
|
|
claimName: consul-config-pvc
|
|
hostPath:
|
|
path: /mnt/nfs/AppData/consul/config
|
|
type: Directory
|
|
restartPolicy: Always
|
|
volumeClaimTemplates:
|
|
- kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: consul-data-pvc
|
|
namespace: consul
|
|
labels:
|
|
name: consul-data-pvc
|
|
spec:
|
|
storageClassName: local-path
|
|
volumeMode: Filesystem
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
- kind: PersistentVolumeClaim
|
|
apiVersion: v1
|
|
metadata:
|
|
name: consul-config-pvc
|
|
namespace: consul
|
|
labels:
|
|
name: consul-config-pvc
|
|
spec:
|
|
storageClassName: local-path
|
|
volumeMode: Filesystem
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 10Mi
|
|
serviceName: consul
|