https://akomljen.com/kubernetes-persistent-volumes-with-deployment-and-statefulset/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
cat <<EOF | kubectl create -f - apiVersion: apps/v1beta2 kind: Deployment metadata: name: zookeeper spec: selector: matchLabels: app: zookeeper replicas: 1 template: metadata: labels: app: zookeeper spec: containers: - env: - name: ZOOKEEPER_SERVERS value: "1" image: "komljen/zookeeper:3.4.10" imagePullPolicy: IfNotPresent name: zookeeper ports: - containerPort: 2181 name: client - containerPort: 2888 name: server - containerPort: 3888 name: leader-election readinessProbe: exec: command: - /opt/zookeeper/bin/zkOK.sh initialDelaySeconds: 10 timeoutSeconds: 2 periodSeconds: 5 livenessProbe: exec: command: - /opt/zookeeper/bin/zkOK.sh initialDelaySeconds: 120 timeoutSeconds: 2 periodSeconds: 5 volumeMounts: - mountPath: /data name: zookeeper-data restartPolicy: Always volumes: - name: zookeeper-data persistentVolumeClaim: claimName: zookeeper-vol --- apiVersion: v1 kind: Service metadata: name: zookeeper spec: ports: - name: client port: 2181 targetPort: 2181 selector: app: zookeeper --- apiVersion: v1 kind: Service metadata: name: zookeeper-server spec: clusterIP: None ports: - name: server port: 2888 targetPort: 2888 - name: leader-election port: 3888 targetPort: 3888 selector: app: zookeeper EOF |
https://stackoverflow.com/questions/35627957/kubernetes-volume-mount-with-replication-controllers https://github.com/VChiranjeeviVeerni/nifi-kube-setup https://origin-release.apps.ci.l2s4.p1.openshiftapps.com/