|
| 1 | +{ |
| 2 | + "apiVersion": "v1", |
| 3 | + "items": [ |
| 4 | + { |
| 5 | + "apiVersion": "v1", |
| 6 | + "kind": "Namespace", |
| 7 | + "metadata": { |
| 8 | + "labels": { |
| 9 | + "ksonnet.io/component": "namespace", |
| 10 | + "name": "davnn-zookeeper" |
| 11 | + }, |
| 12 | + "name": "davnn-zookeeper" |
| 13 | + } |
| 14 | + }, |
| 15 | + { |
| 16 | + "apiVersion": "v1", |
| 17 | + "data": { |
| 18 | + "init.sh": "#!/bin/bash\nset -x\n\n[ -z \"$ID_OFFSET\" ] \u0026\u0026 ID_OFFSET=1\nexport ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-} + $ID_OFFSET))\necho \"${ZOOKEEPER_SERVER_ID:-1}\" | tee /var/lib/zookeeper/data/myid\ncp -Lur /etc/kafka-configmap/* /etc/kafka/\nsed -i \"s/server\\.$ZOOKEEPER_SERVER_ID\\=[a-z0-9.-]*/server.$ZOOKEEPER_SERVER_ID=0.0.0.0/\" /etc/kafka/zookeeper.properties", |
| 19 | + "log4j.properties": "log4j.rootLogger=INFO, stdout\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\n# Suppress connection log messages, three lines per livenessProbe execution\nlog4j.logger.org.apache.zookeeper.server.NIOServerCnxnFactory=WARN\nlog4j.logger.org.apache.zookeeper.server.NIOServerCnxn=WARN", |
| 20 | + "zookeeper.properties": "tickTime=2000\ndataDir=/var/lib/zookeeper/data\ndataLogDir=/var/lib/zookeeper/log\nclientPort=2181\ninitLimit=5\nsyncLimit=2\nserver.1=zookeeper-0.zookeeper:2888:3888:participant\nserver.2=zookeeper-1.zookeeper:2888:3888:participant\nserver.3=zookeeper-2.zookeeper:2888:3888:participant " |
| 21 | + }, |
| 22 | + "kind": "ConfigMap", |
| 23 | + "metadata": { |
| 24 | + "labels": { |
| 25 | + "ksonnet.io/component": "zookeeper-configmap" |
| 26 | + }, |
| 27 | + "name": "zookeeper-configmap", |
| 28 | + "namespace": "davnn-zookeeper" |
| 29 | + } |
| 30 | + }, |
| 31 | + { |
| 32 | + "apiVersion": "rbac.authorization.k8s.io/v1beta1", |
| 33 | + "kind": "ClusterRoleBinding", |
| 34 | + "metadata": { |
| 35 | + "labels": { |
| 36 | + "ksonnet.io/component": "rbac" |
| 37 | + }, |
| 38 | + "name": "davnn-rbac", |
| 39 | + "namespace": "davnn-zookeeper" |
| 40 | + }, |
| 41 | + "roleRef": { |
| 42 | + "apiGroup": "rbac.authorization.k8s.io", |
| 43 | + "kind": "ClusterRole", |
| 44 | + "name": "cluster-admin" |
| 45 | + }, |
| 46 | + "subjects": [ |
| 47 | + { |
| 48 | + "kind": "ServiceAccount", |
| 49 | + "name": "default", |
| 50 | + "namespace": "davnn-zookeeper" |
| 51 | + } |
| 52 | + ] |
| 53 | + }, |
| 54 | + { |
| 55 | + "apiVersion": "v1", |
| 56 | + "kind": "Service", |
| 57 | + "metadata": { |
| 58 | + "labels": { |
| 59 | + "app": "zookeeper", |
| 60 | + "ksonnet.io/component": "zookeeper-service" |
| 61 | + }, |
| 62 | + "name": "zookeeper", |
| 63 | + "namespace": "davnn-zookeeper" |
| 64 | + }, |
| 65 | + "spec": { |
| 66 | + "clusterIP": "None", |
| 67 | + "ports": [ |
| 68 | + { |
| 69 | + "name": "server", |
| 70 | + "port": 2888 |
| 71 | + }, |
| 72 | + { |
| 73 | + "name": "leader-election", |
| 74 | + "port": 3888 |
| 75 | + }, |
| 76 | + { |
| 77 | + "name": "client", |
| 78 | + "port": 2181 |
| 79 | + } |
| 80 | + ], |
| 81 | + "selector": { |
| 82 | + "app": "zookeeper" |
| 83 | + } |
| 84 | + } |
| 85 | + }, |
| 86 | + { |
| 87 | + "apiVersion": "apps/v1", |
| 88 | + "kind": "StatefulSet", |
| 89 | + "metadata": { |
| 90 | + "labels": { |
| 91 | + "ksonnet.io/component": "zookeeper-deployment" |
| 92 | + }, |
| 93 | + "name": "zookeeper", |
| 94 | + "namespace": "davnn-zookeeper" |
| 95 | + }, |
| 96 | + "spec": { |
| 97 | + "replicas": 3, |
| 98 | + "selector": { |
| 99 | + "matchLabels": { |
| 100 | + "app": "zookeeper" |
| 101 | + } |
| 102 | + }, |
| 103 | + "serviceName": "zookeeper", |
| 104 | + "template": { |
| 105 | + "metadata": { |
| 106 | + "annotations": null, |
| 107 | + "labels": { |
| 108 | + "app": "zookeeper", |
| 109 | + "storage": "ephemeral" |
| 110 | + } |
| 111 | + }, |
| 112 | + "spec": { |
| 113 | + "containers": [ |
| 114 | + { |
| 115 | + "command": [ |
| 116 | + "./bin/zookeeper-server-start.sh", |
| 117 | + "/etc/kafka/zookeeper.properties" |
| 118 | + ], |
| 119 | + "env": [ |
| 120 | + { |
| 121 | + "name": "KAFKA_LOG4J_OPTS", |
| 122 | + "value": "-Dlog4j.configuration=file:/etc/kafka/log4j.properties" |
| 123 | + } |
| 124 | + ], |
| 125 | + "image": "docker.pkg.github.com/davfoundation/missioncontrol/zookeeper:20200106-1442", |
| 126 | + "name": "zookeeper", |
| 127 | + "ports": [ |
| 128 | + { |
| 129 | + "containerPort": 2181, |
| 130 | + "name": "client" |
| 131 | + }, |
| 132 | + { |
| 133 | + "containerPort": 2888, |
| 134 | + "name": "peer" |
| 135 | + }, |
| 136 | + { |
| 137 | + "containerPort": 3888, |
| 138 | + "name": "leader-election" |
| 139 | + } |
| 140 | + ], |
| 141 | + "readinessProbe": { |
| 142 | + "exec": { |
| 143 | + "command": [ |
| 144 | + "/bin/sh", |
| 145 | + "-c", |
| 146 | + "[ \"imok\" = \"$(echo ruok | nc -w 1 -q 1 127.0.0.1 2181)\" ]" |
| 147 | + ] |
| 148 | + } |
| 149 | + }, |
| 150 | + "resources": { |
| 151 | + "limits": { |
| 152 | + "cpu": "1000m", |
| 153 | + "memory": "2Gi" |
| 154 | + }, |
| 155 | + "requests": { |
| 156 | + "cpu": "100m", |
| 157 | + "memory": "1Gi" |
| 158 | + } |
| 159 | + }, |
| 160 | + "volumeMounts": [ |
| 161 | + { |
| 162 | + "mountPath": "/etc/kafka", |
| 163 | + "name": "zookeeper-configs" |
| 164 | + }, |
| 165 | + { |
| 166 | + "mountPath": "/var/lib/zookeeper/data", |
| 167 | + "name": "zookeeper-data" |
| 168 | + } |
| 169 | + ] |
| 170 | + } |
| 171 | + ], |
| 172 | + "imagePullSecrets": [ |
| 173 | + { |
| 174 | + "name": "registrykey" |
| 175 | + } |
| 176 | + ], |
| 177 | + "initContainers": [ |
| 178 | + { |
| 179 | + "command": [ |
| 180 | + "/bin/bash", |
| 181 | + "/etc/kafka-configmap/init.sh" |
| 182 | + ], |
| 183 | + "image": "docker.pkg.github.com/davfoundation/missioncontrol/zookeeper-init:20200106-1442", |
| 184 | + "name": "init-config", |
| 185 | + "resources": { |
| 186 | + "limits": { |
| 187 | + "cpu": "1000m", |
| 188 | + "memory": "2Gi" |
| 189 | + }, |
| 190 | + "requests": { |
| 191 | + "cpu": "100m", |
| 192 | + "memory": "1Gi" |
| 193 | + } |
| 194 | + }, |
| 195 | + "volumeMounts": [ |
| 196 | + { |
| 197 | + "mountPath": "/etc/kafka-configmap", |
| 198 | + "name": "zookeeper-configmap" |
| 199 | + }, |
| 200 | + { |
| 201 | + "mountPath": "/etc/kafka", |
| 202 | + "name": "zookeeper-configs" |
| 203 | + }, |
| 204 | + { |
| 205 | + "mountPath": "/var/lib/zookeeper/data", |
| 206 | + "name": "zookeeper-data" |
| 207 | + } |
| 208 | + ] |
| 209 | + } |
| 210 | + ], |
| 211 | + "terminationGracePeriodSeconds": 10, |
| 212 | + "volumes": [ |
| 213 | + { |
| 214 | + "configMap": { |
| 215 | + "name": "zookeeper-configmap" |
| 216 | + }, |
| 217 | + "name": "zookeeper-configmap" |
| 218 | + }, |
| 219 | + { |
| 220 | + "emptyDir": {}, |
| 221 | + "name": "zookeeper-configs" |
| 222 | + }, |
| 223 | + { |
| 224 | + "emptyDir": {}, |
| 225 | + "name": "zookeeper-data" |
| 226 | + } |
| 227 | + ] |
| 228 | + } |
| 229 | + } |
| 230 | + } |
| 231 | + } |
| 232 | + ], |
| 233 | + "kind": "List" |
| 234 | +} |
0 commit comments