blob: 112a460d4e33ad767313fae9d083033eb3c0287a [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:
79 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -050080 spec:
81 containers:
82 - name: zoo1
83 image: zookeeper:3.4.11
84 ports:
85 - containerPort: 2181
86 - containerPort: 2888
87 - containerPort: 3888
88 env:
89 - name: NAMESPACE
90 valueFrom:
91 fieldRef:
92 fieldPath: metadata.namespace
93 - name: ZOO_MY_ID
94 value: "1"
95 - name: ZOO_SERVERS
96 value: >
97 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
98 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
99 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
100---
101apiVersion: apps/v1beta1
102kind: StatefulSet
103metadata:
104 name: zookeeper2
Richard Jankowskid4454382018-02-08 16:21:43 -0500105 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500106spec:
107 serviceName: zoo2
108 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -0500109 updateStrategy:
110 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -0500111 selector:
112 matchLabels:
113 app: zookeeper-2
114 template:
115 metadata:
116 labels:
117 app: zookeeper-2
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500118 annotations:
119 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -0500120 spec:
121 containers:
122 - name: zoo2
123 image: zookeeper:3.4.11
124 ports:
125 - containerPort: 2181
126 - containerPort: 2888
127 - containerPort: 3888
128 env:
129 - name: NAMESPACE
130 valueFrom:
131 fieldRef:
132 fieldPath: metadata.namespace
133 - name: ZOO_MY_ID
134 value: "2"
135 - name: ZOO_SERVERS
136 value: >
137 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
138 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
139 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888
140---
141apiVersion: apps/v1beta1
142kind: StatefulSet
143metadata:
144 name: zookeeper3
Richard Jankowskid4454382018-02-08 16:21:43 -0500145 namespace: voltha
Richard Jankowskie5858082018-01-15 18:25:38 -0500146spec:
147 serviceName: zoo3
148 replicas: 1
Stephane Barbariebcea2f42018-03-02 18:46:32 -0500149 updateStrategy:
150 type: RollingUpdate
Richard Jankowskie5858082018-01-15 18:25:38 -0500151 selector:
152 matchLabels:
153 app: zookeeper-3
154 template:
155 metadata:
156 labels:
157 app: zookeeper-3
Stephane Barbarie5e8d9e42018-02-07 16:15:05 -0500158 annotations:
159 cni: "weave"
Richard Jankowskie5858082018-01-15 18:25:38 -0500160 spec:
161 containers:
162 - name: zoo3
163 image: zookeeper:3.4.11
164 ports:
165 - containerPort: 2181
166 - containerPort: 2888
167 - containerPort: 3888
168 env:
169 - name: NAMESPACE
170 valueFrom:
171 fieldRef:
172 fieldPath: metadata.namespace
173 - name: ZOO_MY_ID
174 value: "3"
175 - name: ZOO_SERVERS
176 value: >
177 server.1=zookeeper1-0.zoo1.$(NAMESPACE).svc.cluster.local:2888:3888
178 server.2=zookeeper2-0.zoo2.$(NAMESPACE).svc.cluster.local:2888:3888
179 server.3=zookeeper3-0.zoo3.$(NAMESPACE).svc.cluster.local:2888:3888