blob: 2f3ceba82b9e638f497be90d38994c0c73db6daf [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
69 selector:
70 matchLabels:
71 app: zookeeper-1
72 template:
73 metadata:
74 labels:
75 app: zookeeper-1
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -050076 annotations:
77 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -050078 spec:
79 containers:
80 - name: zoo1
81 image: zookeeper:3.4.11
82 ports:
83 - containerPort: 2181
84 - containerPort: 2888
85 - containerPort: 3888
86 env:
87 - name: NAMESPACE
88 valueFrom:
89 fieldRef:
90 fieldPath: metadata.namespace
91 - name: ZOO_MY_ID
92 value: "1"
93 - name: ZOO_SERVERS
94 value: >
95 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
96 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
97 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
98---
99apiVersion: apps/v1beta1
100kind: StatefulSet
101metadata:
102 name: zookeeper2
Richard Jankowskid4454382018-02-08 16:21:43 -0500103 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500104spec:
105 serviceName: zoo2
106 replicas: 1
107 selector:
108 matchLabels:
109 app: zookeeper-2
110 template:
111 metadata:
112 labels:
113 app: zookeeper-2
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500114 annotations:
115 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -0500116 spec:
117 containers:
118 - name: zoo2
119 image: zookeeper:3.4.11
120 ports:
121 - containerPort: 2181
122 - containerPort: 2888
123 - containerPort: 3888
124 env:
125 - name: NAMESPACE
126 valueFrom:
127 fieldRef:
128 fieldPath: metadata.namespace
129 - name: ZOO_MY_ID
130 value: "2"
131 - name: ZOO_SERVERS
132 value: >
133 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
134 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
135 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
136---
137apiVersion: apps/v1beta1
138kind: StatefulSet
139metadata:
140 name: zookeeper3
Richard Jankowskid4454382018-02-08 16:21:43 -0500141 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500142spec:
143 serviceName: zoo3
144 replicas: 1
145 selector:
146 matchLabels:
147 app: zookeeper-3
148 template:
149 metadata:
150 labels:
151 app: zookeeper-3
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500152 annotations:
153 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -0500154 spec:
155 containers:
156 - name: zoo3
157 image: zookeeper:3.4.11
158 ports:
159 - containerPort: 2181
160 - containerPort: 2888
161 - containerPort: 3888
162 env:
163 - name: NAMESPACE
164 valueFrom:
165 fieldRef:
166 fieldPath: metadata.namespace
167 - name: ZOO_MY_ID
168 value: "3"
169 - name: ZOO_SERVERS
170 value: >
171 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
172 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
173 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888