| # Copyright 2019-present Open Networking Foundation |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: zoo1 |
| namespace: voltha |
| spec: |
| clusterIP: None |
| selector: |
| app: zookeeper-1 |
| ports: |
| - name: client |
| port: 2181 |
| targetPort: 2181 |
| - name: follower |
| port: 2888 |
| targetPort: 2888 |
| - name: leader |
| port: 3888 |
| targetPort: 3888 |
| --- |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: zoo2 |
| namespace: voltha |
| spec: |
| clusterIP: None |
| selector: |
| app: zookeeper-2 |
| ports: |
| - name: client |
| port: 2181 |
| targetPort: 2181 |
| - name: follower |
| port: 2888 |
| targetPort: 2888 |
| - name: leader |
| port: 3888 |
| targetPort: 3888 |
| --- |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| name: zoo3 |
| namespace: voltha |
| spec: |
| clusterIP: None |
| selector: |
| app: zookeeper-3 |
| ports: |
| - name: client |
| port: 2181 |
| targetPort: 2181 |
| - name: follower |
| port: 2888 |
| targetPort: 2888 |
| - name: leader |
| port: 3888 |
| targetPort: 3888 |
| --- |
| apiVersion: apps/v1beta1 |
| kind: StatefulSet |
| metadata: |
| name: zookeeper1 |
| namespace: voltha |
| spec: |
| serviceName: zoo1 |
| replicas: 1 |
| updateStrategy: |
| type: RollingUpdate |
| selector: |
| matchLabels: |
| app: zookeeper-1 |
| template: |
| metadata: |
| labels: |
| app: zookeeper-1 |
| annotations: |
| cni: "calico" |
| spec: |
| terminationGracePeriodSeconds: 0 |
| containers: |
| - name: zoo1 |
| image: zookeeper:3.4.11 |
| ports: |
| - containerPort: 2181 |
| - containerPort: 2888 |
| - containerPort: 3888 |
| env: |
| - name: NAMESPACE |
| valueFrom: |
| fieldRef: |
| fieldPath: metadata.namespace |
| - name: ZOO_MY_ID |
| value: "1" |
| - name: ZOO_SERVERS |
| value: > |
| server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |
| --- |
| apiVersion: apps/v1beta1 |
| kind: StatefulSet |
| metadata: |
| name: zookeeper2 |
| namespace: voltha |
| spec: |
| serviceName: zoo2 |
| replicas: 1 |
| updateStrategy: |
| type: RollingUpdate |
| selector: |
| matchLabels: |
| app: zookeeper-2 |
| template: |
| metadata: |
| labels: |
| app: zookeeper-2 |
| annotations: |
| cni: "calico" |
| spec: |
| terminationGracePeriodSeconds: 0 |
| containers: |
| - name: zoo2 |
| image: zookeeper:3.4.11 |
| ports: |
| - containerPort: 2181 |
| - containerPort: 2888 |
| - containerPort: 3888 |
| env: |
| - name: NAMESPACE |
| valueFrom: |
| fieldRef: |
| fieldPath: metadata.namespace |
| - name: ZOO_MY_ID |
| value: "2" |
| - name: ZOO_SERVERS |
| value: > |
| server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |
| --- |
| apiVersion: apps/v1beta1 |
| kind: StatefulSet |
| metadata: |
| name: zookeeper3 |
| namespace: voltha |
| spec: |
| serviceName: zoo3 |
| replicas: 1 |
| updateStrategy: |
| type: RollingUpdate |
| selector: |
| matchLabels: |
| app: zookeeper-3 |
| template: |
| metadata: |
| labels: |
| app: zookeeper-3 |
| annotations: |
| cni: "calico" |
| spec: |
| terminationGracePeriodSeconds: 0 |
| containers: |
| - name: zoo3 |
| image: zookeeper:3.4.11 |
| ports: |
| - containerPort: 2181 |
| - containerPort: 2888 |
| - containerPort: 3888 |
| env: |
| - name: NAMESPACE |
| valueFrom: |
| fieldRef: |
| fieldPath: metadata.namespace |
| - name: ZOO_MY_ID |
| value: "3" |
| - name: ZOO_SERVERS |
| value: > |
| server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888 |
| server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888 |
| server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888 |