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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
| apiVersion: apps/v1 kind: StatefulSet metadata: name: zookeeper namespace: default labels: app.kubernetes.io/name: zookeeper app.kubernetes.io/component: spring-cloud spec: replicas: 3 podManagementPolicy: Parallel selector: matchLabels: app.kubernetes.io/name: zookeeper app.kubernetes.io/component: spring-cloud serviceName: zk-headless updateStrategy: rollingUpdate: {} type: RollingUpdate template: metadata: annotations: labels: app.kubernetes.io/name: zookeeper app.kubernetes.io/component: spring-cloud spec: serviceAccountName: default affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchLabels: app.kubernetes.io/name: zookeeper app.kubernetes.io/component: zookeeper namespaces: - "default" topologyKey: kubernetes.io/hostname weight: 1 securityContext: fsGroup: 1001 initContainers: containers: - name: zookeeper image: bitnami/zookeeper:3.8.0-debian-10-r0 imagePullPolicy: "IfNotPresent" securityContext: runAsNonRoot: true runAsUser: 1001 command: - /scripts/setup.sh resources: limits: cpu: 0.25 memory: 1Gi requests: cpu: 0.25 memory: 1Gi env: - name: BITNAMI_DEBUG value: "false" - name: ZOO_DATA_LOG_DIR value: "" - name: ZOO_PORT_NUMBER value: "2181" - name: ZOO_TICK_TIME value: "2000" - name: ZOO_INIT_LIMIT value: "10" - name: ZOO_SYNC_LIMIT value: "5" - name: ZOO_PRE_ALLOC_SIZE value: "65536" - name: ZOO_SNAPCOUNT value: "100000" - name: ZOO_MAX_CLIENT_CNXNS value: "60" - name: ZOO_4LW_COMMANDS_WHITELIST value: "srvr, mntr, ruok" - name: ZOO_LISTEN_ALLIPS_ENABLED value: "no" - name: ZOO_AUTOPURGE_INTERVAL value: "0" - name: ZOO_AUTOPURGE_RETAIN_COUNT value: "3" - name: ZOO_MAX_SESSION_TIMEOUT value: "40000" - name: ZOO_SERVERS value: zookeeper-0.zookeeper-headless.default.svc.cluster.local:2888:3888::1 zookeeper-1.zookeeper-headless.default.svc.cluster.local:2888:3888::2 zookeeper-2.zookeeper-headless.default.svc.cluster.local:2888:3888::3 - name: ZOO_ENABLE_AUTH value: "no" - name: ZOO_HEAP_SIZE value: "1024" - name: ZOO_LOG_LEVEL value: "ERROR" - name: ALLOW_ANONYMOUS_LOGIN value: "yes" - name: POD_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name ports: - name: client containerPort: 2181 - name: follower containerPort: 2888 - name: election containerPort: 3888 livenessProbe: failureThreshold: 6 initialDelaySeconds: 30 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 exec: command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok'] readinessProbe: failureThreshold: 6 initialDelaySeconds: 5 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 exec: command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok'] volumeMounts: - name: scripts mountPath: /scripts/setup.sh subPath: setup.sh - name: zookeeper-data mountPath: /bitnami/zookeeper volumes: - name: scripts configMap: name: zk-scripts defaultMode: 0755 volumeClaimTemplates: - metadata: name: zookeeper-data spec: storageClassName: nfs-client accessModes: - ReadWriteOnce resources: requests: storage: 2Gi
|