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: 'consul:1.15.4' 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 hostPath: path: /mnt/nfs/AppData/consul/data type: Directory - name: consul-config hostPath: path: /mnt/nfs/AppData/consul/config type: Directory restartPolicy: Always serviceName: consul