blob: 93e4385c3d57551b2958461d2fc463f0255c1f00 [file] [log] [blame]
Richard Jankowskie5858082018-01-15 18:25:38 -05001apiVersion: v1
2kind: Service
3metadata:
4 name: zoo1
Richard Jankowskid4454382018-02-08 16:21:43 -05005 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -05006spec:
7 clusterIP: None
8 selector:
9 app: zookeeper-1
10 ports:
11 - name: client
12 port: 2181
13 targetPort: 2181
14 - name: follower
15 port: 2888
16 targetPort: 2888
17 - name: leader
18 port: 3888
19 targetPort: 3888
20---
21apiVersion: v1
22kind: Service
23metadata:
24 name: zoo2
Richard Jankowskid4454382018-02-08 16:21:43 -050025 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050026spec:
27 clusterIP: None
28 selector:
29 app: zookeeper-2
30 ports:
31 - name: client
32 port: 2181
33 targetPort: 2181
34 - name: follower
35 port: 2888
36 targetPort: 2888
37 - name: leader
38 port: 3888
39 targetPort: 3888
40---
41apiVersion: v1
42kind: Service
43metadata:
44 name: zoo3
Richard Jankowskid4454382018-02-08 16:21:43 -050045 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050046spec:
47 clusterIP: None
48 selector:
49 app: zookeeper-3
50 ports:
51 - name: client
52 port: 2181
53 targetPort: 2181
54 - name: follower
55 port: 2888
56 targetPort: 2888
57 - name: leader
58 port: 3888
59 targetPort: 3888
60---
61apiVersion: apps/v1beta1
62kind: StatefulSet
63metadata:
64 name: zookeeper1
Richard Jankowskid4454382018-02-08 16:21:43 -050065 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -050066spec:
67 serviceName: zoo1
68 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -050069 updateStrategy:
70 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -050071 selector:
72 matchLabels:
73 app: zookeeper-1
74 template:
75 metadata:
76 labels:
77 app: zookeeper-1
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050078 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -040079 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -050080 spec:
Richard Jankowski4ea26632018-05-14 17:45:38 -040081 terminationGracePeriodSeconds: 0
Richard Jankowskie5858082018-01-15 18:25:38 -050082 containers:
83 - name: zoo1
84 image: zookeeper:3.4.11
85 ports:
86 - containerPort: 2181
87 - containerPort: 2888
88 - containerPort: 3888
89 env:
90 - name: NAMESPACE
91 valueFrom:
92 fieldRef:
93 fieldPath: metadata.namespace
94 - name: ZOO_MY_ID
95 value: "1"
96 - name: ZOO_SERVERS
97 value: >
98 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
99 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
100 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
101---
102apiVersion: apps/v1beta1
103kind: StatefulSet
104metadata:
105 name: zookeeper2
Richard Jankowskid4454382018-02-08 16:21:43 -0500106 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500107spec:
108 serviceName: zoo2
109 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -0500110 updateStrategy:
111 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -0500112 selector:
113 matchLabels:
114 app: zookeeper-2
115 template:
116 metadata:
117 labels:
118 app: zookeeper-2
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500119 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -0400120 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -0500121 spec:
Richard Jankowski4ea26632018-05-14 17:45:38 -0400122 terminationGracePeriodSeconds: 0
Richard Jankowskie5858082018-01-15 18:25:38 -0500123 containers:
124 - name: zoo2
125 image: zookeeper:3.4.11
126 ports:
127 - containerPort: 2181
128 - containerPort: 2888
129 - containerPort: 3888
130 env:
131 - name: NAMESPACE
132 valueFrom:
133 fieldRef:
134 fieldPath: metadata.namespace
135 - name: ZOO_MY_ID
136 value: "2"
137 - name: ZOO_SERVERS
138 value: >
139 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
140 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
141 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
142---
143apiVersion: apps/v1beta1
144kind: StatefulSet
145metadata:
146 name: zookeeper3
Richard Jankowskid4454382018-02-08 16:21:43 -0500147 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500148spec:
149 serviceName: zoo3
150 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -0500151 updateStrategy:
152 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -0500153 selector:
154 matchLabels:
155 app: zookeeper-3
156 template:
157 metadata:
158 labels:
159 app: zookeeper-3
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500160 annotations:
Stephane Barbarie2d4e07f2018-03-26 16:46:45 -0400161 cni: "calico"
Richard Jankowskie5858082018-01-15 18:25:38 -0500162 spec:
Richard Jankowski4ea26632018-05-14 17:45:38 -0400163 terminationGracePeriodSeconds: 0
Richard Jankowskie5858082018-01-15 18:25:38 -0500164 containers:
165 - name: zoo3
166 image: zookeeper:3.4.11
167 ports:
168 - containerPort: 2181
169 - containerPort: 2888
170 - containerPort: 3888
171 env:
172 - name: NAMESPACE
173 valueFrom:
174 fieldRef:
175 fieldPath: metadata.namespace
176 - name: ZOO_MY_ID
177 value: "3"
178 - name: ZOO_SERVERS
179 value: >
180 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
181 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
182 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888