blob: b89f044f484590cf95277b4ff31b9c0f91f152ae [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001# Copyright 2017-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.
Richard Jankowskie5858082018-01-15 18:25:38 -050014apiVersion: v1
15kind: Service
16metadata:
17 name: zoo1
Richard Jankowskid4454382018-02-08 16:21:43 -050018 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050019spec:
20 clusterIP: None
21 selector:
22 app: zookeeper-1
23 ports:
24 - name: client
25 port: 2181
26 targetPort: 2181
27 - name: follower
28 port: 2888
29 targetPort: 2888
30 - name: leader
31 port: 3888
32 targetPort: 3888
33---
34apiVersion: v1
35kind: Service
36metadata:
37 name: zoo2
Richard Jankowskid4454382018-02-08 16:21:43 -050038 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050039spec:
40 clusterIP: None
41 selector:
42 app: zookeeper-2
43 ports:
44 - name: client
45 port: 2181
46 targetPort: 2181
47 - name: follower
48 port: 2888
49 targetPort: 2888
50 - name: leader
51 port: 3888
52 targetPort: 3888
53---
54apiVersion: v1
55kind: Service
56metadata:
57 name: zoo3
Richard Jankowskid4454382018-02-08 16:21:43 -050058 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050059spec:
60 clusterIP: None
61 selector:
62 app: zookeeper-3
63 ports:
64 - name: client
65 port: 2181
66 targetPort: 2181
67 - name: follower
68 port: 2888
69 targetPort: 2888
70 - name: leader
71 port: 3888
72 targetPort: 3888
73---
74apiVersion: apps/v1beta1
75kind: StatefulSet
76metadata:
77 name: zookeeper1
Richard Jankowskid4454382018-02-08 16:21:43 -050078 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050079spec:
80 serviceName: zoo1
81 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -050082 updateStrategy:
83 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -050084 selector:
85 matchLabels:
86 app: zookeeper-1
87 template:
88 metadata:
89 labels:
90 app: zookeeper-1
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050091 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -040092 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -050093 spec:
Richard Jankowski4ea26632018-05-14 17:45:38 -040094 terminationGracePeriodSeconds: 0
Richard Jankowskie5858082018-01-15 18:25:38 -050095 containers:
96 - name: zoo1
97 image: zookeeper:3.4.11
98 ports:
99 - containerPort: 2181
100 - containerPort: 2888
101 - containerPort: 3888
102 env:
103 - name: NAMESPACE
104 valueFrom:
105 fieldRef:
106 fieldPath: metadata.namespace
107 - name: ZOO_MY_ID
108 value: "1"
109 - name: ZOO_SERVERS
110 value: >
111 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
112 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
113 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
114---
115apiVersion: apps/v1beta1
116kind: StatefulSet
117metadata:
118 name: zookeeper2
Richard Jankowskid4454382018-02-08 16:21:43 -0500119 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500120spec:
121 serviceName: zoo2
122 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -0500123 updateStrategy:
124 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -0500125 selector:
126 matchLabels:
127 app: zookeeper-2
128 template:
129 metadata:
130 labels:
131 app: zookeeper-2
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500132 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -0400133 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -0500134 spec:
Richard Jankowski4ea26632018-05-14 17:45:38 -0400135 terminationGracePeriodSeconds: 0
Richard Jankowskie5858082018-01-15 18:25:38 -0500136 containers:
137 - name: zoo2
138 image: zookeeper:3.4.11
139 ports:
140 - containerPort: 2181
141 - containerPort: 2888
142 - containerPort: 3888
143 env:
144 - name: NAMESPACE
145 valueFrom:
146 fieldRef:
147 fieldPath: metadata.namespace
148 - name: ZOO_MY_ID
149 value: "2"
150 - name: ZOO_SERVERS
151 value: >
152 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
153 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
154 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
155---
156apiVersion: apps/v1beta1
157kind: StatefulSet
158metadata:
159 name: zookeeper3
Richard Jankowskid4454382018-02-08 16:21:43 -0500160 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500161spec:
162 serviceName: zoo3
163 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -0500164 updateStrategy:
165 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -0500166 selector:
167 matchLabels:
168 app: zookeeper-3
169 template:
170 metadata:
171 labels:
172 app: zookeeper-3
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500173 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -0400174 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -0500175 spec:
Richard Jankowski4ea26632018-05-14 17:45:38 -0400176 terminationGracePeriodSeconds: 0
Richard Jankowskie5858082018-01-15 18:25:38 -0500177 containers:
178 - name: zoo3
179 image: zookeeper:3.4.11
180 ports:
181 - containerPort: 2181
182 - containerPort: 2888
183 - containerPort: 3888
184 env:
185 - name: NAMESPACE
186 valueFrom:
187 fieldRef:
188 fieldPath: metadata.namespace
189 - name: ZOO_MY_ID
190 value: "3"
191 - name: ZOO_SERVERS
192 value: >
193 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
194 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
195 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888