blob: 8480aae6f03eb7cfd79c7e2858aeb8fb7ee6207f [file] [log] [blame]
marcoacdae7e2015-12-02 15:35:37 +01001
2==================
3Kubernetes Formula
4==================
5
Jakub Pavlik495d06f2016-06-17 11:33:05 +02006Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
7
8This formula deploys production ready Kubernetes and generate Kubernetes manifests as well.
marcoacdae7e2015-12-02 15:35:37 +01009
10Based on official Kubernetes salt
11https://github.com/kubernetes/kubernetes/tree/master/cluster/saltbase
12
13Extended on Contrail contribution https://github.com/Juniper/kubernetes/blob/opencontrail-integration/docs/getting-started-guides/opencontrail.md
14
15
16Sample pillars
17==============
18
19.. code-block:: yaml
20
21 kubernetes:
Jakub Pavlik495d06f2016-06-17 11:33:05 +020022 master:
23 addons:
24 dns:
25 domain: cluster.local
26 enabled: true
27 replicas: 1
28 server: 10.254.0.10
29 heapster_influxdb:
30 enabled: true
31 public_ip: 185.22.97.132
32 ui:
33 enabled: true
34 public_ip: 185.22.97.131
35 admin:
36 password: password
37 username: admin
38 apiserver:
39 address: 10.0.175.100
40 port: 8080
41 ca: kubernetes
42 enabled: true
43 etcd:
44 host: 127.0.0.1
45 members:
46 - host: 10.0.175.100
47 name: node040
48 name: node040
49 token: ca939ec9c2a17b0786f6d411fe019e9b
50 kubelet:
51 allow_privileged: true
52 network:
53 engine: calico
54 hash: fb5e30ebe6154911a66ec3fb5f1195b2
55 private_ip_range: 10.150.0.0/16
56 version: v0.19.0
57 service_addresses: 10.254.0.0/16
58 storage:
59 engine: glusterfs
60 members:
61 - host: 10.0.175.101
62 port: 24007
63 - host: 10.0.175.102
64 port: 24007
65 - host: 10.0.175.103
66 port: 24007
67 port: 24007
68 token:
69 admin: DFvQ8GJ9JD4fKNfuyEddw3rjnFTkUKsv
70 controller_manager: EreGh6AnWf8DxH8cYavB2zS029PUi7vx
71 dns: RAFeVSE4UvsCz4gk3KYReuOI5jsZ1Xt3
72 kube_proxy: DFvQ8GelB7afH3wClC9romaMPhquyyEe
73 kubelet: 7bN5hJ9JD4fKjnFTkUKsvVNfuyEddw3r
74 logging: MJkXKdbgqRmTHSa2ykTaOaMykgO6KcEf
75 monitoring: hnsj0XqABgrSww7Nqo7UVTSZLJUt2XRd
76 scheduler: HY1UUxEPpmjW4a1dDLGIANYQp1nZkLDk
77 version: v1.2.4
78
marcoacdae7e2015-12-02 15:35:37 +010079
80 kubernetes:
Jakub Pavlik495d06f2016-06-17 11:33:05 +020081 pool:
82 address: 0.0.0.0
83 allow_privileged: true
84 ca: kubernetes
85 cluster_dns: 10.254.0.10
86 cluster_domain: cluster.local
87 enabled: true
88 kubelet:
89 allow_privileged: true
90 config: /etc/kubernetes/manifests
91 frequency: 5s
92 master:
93 apiserver:
94 members:
95 - host: 10.0.175.100
96 etcd:
97 members:
98 - host: 10.0.175.100
99 host: 10.0.175.100
100 network:
101 engine: calico
102 hash: fb5e30ebe6154911a66ec3fb5f1195b2
103 version: v0.19.0
104 token:
105 kube_proxy: DFvQ8GelB7afH3wClC9romaMPhquyyEe
106 kubelet: 7bN5hJ9JD4fKjnFTkUKsvVNfuyEddw3r
107 version: v1.2.4
marcoacdae7e2015-12-02 15:35:37 +0100108
109
Jakub Pavlik495d06f2016-06-17 11:33:05 +0200110
111Kubernetes with OpenContrail network plugin
112------------------------------------------------
marcoacdae7e2015-12-02 15:35:37 +0100113
114On Master:
115
116.. code-block:: yaml
117
118 kubernetes:
119 master:
120 network:
121 engine: opencontrail
122 host: 10.0.170.70
123 port: 8082
124 default_domain: default-domain
125 default_project: default-domain:default-project
126 public_network: default-domain:default-project:Public
127 public_ip_range: 185.22.97.128/26
128 private_ip_range: 10.150.0.0/16
129 service_cluster_ip_range: 10.254.0.0/16
130 network_label: name
131 service_label: uses
132 cluster_service: kube-system/default
133 network_manager:
134 image: pupapaik/opencontrail-kube-network-manager
135 tag: release-1.1-jpa-final-1
136
137On pools:
138
139.. code-block:: yaml
140
141 kubernetes:
142 pool:
143 network:
144 engine: opencontrail
145
146Kubernetes with Flannel
147-----------------------
148
149On Master:
150
151.. code-block:: yaml
152
153 kubernetes:
154 master:
155 network:
156 engine: flannel
157 common:
158 network:
159 engine: flannel
160
161On pools:
162
163.. code-block:: yaml
164
165 kubernetes:
166 pool:
167 network:
168 engine: flannel
169 common:
170 network:
171 engine: flannel
172
173Kubernetes with Calico
174-----------------------
175
176On Master:
177
178.. code-block:: yaml
179
180 kubernetes:
181 master:
182 network:
183 engine: calico
184
185On pools:
186
187.. code-block:: yaml
188
189 kubernetes:
190 pool:
191 network:
192 engine: calico
193
Jakub Pavlik495d06f2016-06-17 11:33:05 +0200194Kubernetes with GlusterFS for storage
195---------------------------------------------
196
197.. code-block:: yaml
198
199 kubernetes:
200 master
201 ...
202 storage:
203 engine: glusterfs
204 port: 24007
205 members:
206 - host: 10.0.175.101
207 port: 24007
208 - host: 10.0.175.102
209 port: 24007
210 - host: 10.0.175.103
211 port: 24007
212 ...
213
214Kubernetes Service Definitions in pillars
215==========================================
216
217Following samples show how to generate kubernetes manifest as well and provide single tool for complete infrastructure management.
218
219Deployment manifest
220---------------------
marcoacdae7e2015-12-02 15:35:37 +0100221
222.. code-block:: yaml
223
224 salt:
225 control:
226 enabled: True
227 hostNetwork: True
228 service:
229 memcached:
230 privileged: True
231 service: memcached
232 role: server
233 type: LoadBalancer
234 replicas: 3
235 kind: Deployment
236 apiVersion: extensions/v1beta1
237 ports:
238 - port: 8774
239 name: nova-api
240 - port: 8775
241 name: nova-metadata
242 volume:
243 volume_name:
244 type: hostPath
245 mount: /certs
246 path: /etc/certs
247 container:
248 memcached:
249 image: memcached
250 tag:2
251 ports:
252 - port: 8774
253 name: nova-api
254 - port: 8775
255 name: nova-metadata
256 variables:
257 - name: HTTP_TLS_CERTIFICATE:
258 value: /certs/domain.crt
259 - name: HTTP_TLS_KEY
260 value: /certs/domain.key
261 volumes:
262 - name: /etc/certs
263 type: hostPath
264 mount: /certs
265 path: /etc/certs
266
267Volumes
268-------
269
270hostPath
Jakub Pavlik495d06f2016-06-17 11:33:05 +0200271==========
marcoacdae7e2015-12-02 15:35:37 +0100272
273.. code-block:: yaml
274
275 container:
276 memcached:
277 ...
278 volumes:
279 - name: /etc/certs
280 mount: /certs
281 type: hostPath
282 path: /etc/certs
283
284emptyDir
285===========
286
287.. code-block:: yaml
288
289 container:
290 memcached:
291 ...
292 volumes:
293 - name: /etc/certs
294 mount: /certs
295 type: emptyDir