Richard Jankowski | 00a0466 | 2019-02-05 12:18:53 -0500 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | apiVersion: v1 |
| 16 | kind: Service |
| 17 | metadata: |
| 18 | name: zoo1 |
| 19 | namespace: voltha |
| 20 | spec: |
| 21 | clusterIP: None |
| 22 | selector: |
| 23 | app: zookeeper-1 |
| 24 | ports: |
| 25 | - name: client |
| 26 | port: 2181 |
| 27 | targetPort: 2181 |
| 28 | - name: follower |
| 29 | port: 2888 |
| 30 | targetPort: 2888 |
| 31 | - name: leader |
| 32 | port: 3888 |
| 33 | targetPort: 3888 |
| 34 | --- |
| 35 | apiVersion: v1 |
| 36 | kind: Service |
| 37 | metadata: |
| 38 | name: zoo2 |
| 39 | namespace: voltha |
| 40 | spec: |
| 41 | clusterIP: None |
| 42 | selector: |
| 43 | app: zookeeper-2 |
| 44 | ports: |
| 45 | - name: client |
| 46 | port: 2181 |
| 47 | targetPort: 2181 |
| 48 | - name: follower |
| 49 | port: 2888 |
| 50 | targetPort: 2888 |
| 51 | - name: leader |
| 52 | port: 3888 |
| 53 | targetPort: 3888 |
| 54 | --- |
| 55 | apiVersion: v1 |
| 56 | kind: Service |
| 57 | metadata: |
| 58 | name: zoo3 |
| 59 | namespace: voltha |
| 60 | spec: |
| 61 | clusterIP: None |
| 62 | selector: |
| 63 | app: zookeeper-3 |
| 64 | ports: |
| 65 | - name: client |
| 66 | port: 2181 |
| 67 | targetPort: 2181 |
| 68 | - name: follower |
| 69 | port: 2888 |
| 70 | targetPort: 2888 |
| 71 | - name: leader |
| 72 | port: 3888 |
| 73 | targetPort: 3888 |
| 74 | --- |
| 75 | apiVersion: apps/v1beta1 |
| 76 | kind: StatefulSet |
| 77 | metadata: |
| 78 | name: zookeeper1 |
| 79 | namespace: voltha |
| 80 | spec: |
| 81 | serviceName: zoo1 |
| 82 | replicas: 1 |
| 83 | updateStrategy: |
| 84 | type: RollingUpdate |
| 85 | selector: |
| 86 | matchLabels: |
| 87 | app: zookeeper-1 |
| 88 | template: |
| 89 | metadata: |
| 90 | labels: |
| 91 | app: zookeeper-1 |
| 92 | annotations: |
| 93 | cni: "calico" |
| 94 | spec: |
| 95 | terminationGracePeriodSeconds: 0 |
| 96 | containers: |
| 97 | - name: zoo1 |
| 98 | image: zookeeper:3.4.11 |
| 99 | ports: |
| 100 | - containerPort: 2181 |
| 101 | - containerPort: 2888 |
| 102 | - containerPort: 3888 |
| 103 | env: |
| 104 | - name: NAMESPACE |
| 105 | valueFrom: |
| 106 | fieldRef: |
| 107 | fieldPath: metadata.namespace |
| 108 | - name: ZOO_MY_ID |
| 109 | value: "1" |
| 110 | - name: ZOO_SERVERS |
| 111 | value: > |
| 112 | server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 113 | server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 114 | server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 115 | --- |
| 116 | apiVersion: apps/v1beta1 |
| 117 | kind: StatefulSet |
| 118 | metadata: |
| 119 | name: zookeeper2 |
| 120 | namespace: voltha |
| 121 | spec: |
| 122 | serviceName: zoo2 |
| 123 | replicas: 1 |
| 124 | updateStrategy: |
| 125 | type: RollingUpdate |
| 126 | selector: |
| 127 | matchLabels: |
| 128 | app: zookeeper-2 |
| 129 | template: |
| 130 | metadata: |
| 131 | labels: |
| 132 | app: zookeeper-2 |
| 133 | annotations: |
| 134 | cni: "calico" |
| 135 | spec: |
| 136 | terminationGracePeriodSeconds: 0 |
| 137 | containers: |
| 138 | - name: zoo2 |
| 139 | image: zookeeper:3.4.11 |
| 140 | ports: |
| 141 | - containerPort: 2181 |
| 142 | - containerPort: 2888 |
| 143 | - containerPort: 3888 |
| 144 | env: |
| 145 | - name: NAMESPACE |
| 146 | valueFrom: |
| 147 | fieldRef: |
| 148 | fieldPath: metadata.namespace |
| 149 | - name: ZOO_MY_ID |
| 150 | value: "2" |
| 151 | - name: ZOO_SERVERS |
| 152 | value: > |
| 153 | server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 154 | server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 155 | server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 156 | --- |
| 157 | apiVersion: apps/v1beta1 |
| 158 | kind: StatefulSet |
| 159 | metadata: |
| 160 | name: zookeeper3 |
| 161 | namespace: voltha |
| 162 | spec: |
| 163 | serviceName: zoo3 |
| 164 | replicas: 1 |
| 165 | updateStrategy: |
| 166 | type: RollingUpdate |
| 167 | selector: |
| 168 | matchLabels: |
| 169 | app: zookeeper-3 |
| 170 | template: |
| 171 | metadata: |
| 172 | labels: |
| 173 | app: zookeeper-3 |
| 174 | annotations: |
| 175 | cni: "calico" |
| 176 | spec: |
| 177 | terminationGracePeriodSeconds: 0 |
| 178 | containers: |
| 179 | - name: zoo3 |
| 180 | image: zookeeper:3.4.11 |
| 181 | ports: |
| 182 | - containerPort: 2181 |
| 183 | - containerPort: 2888 |
| 184 | - containerPort: 3888 |
| 185 | env: |
| 186 | - name: NAMESPACE |
| 187 | valueFrom: |
| 188 | fieldRef: |
| 189 | fieldPath: metadata.namespace |
| 190 | - name: ZOO_MY_ID |
| 191 | value: "3" |
| 192 | - name: ZOO_SERVERS |
| 193 | value: > |
| 194 | server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 195 | server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| 196 | server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |