marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 1 | |
| 2 | ================== |
| 3 | Kubernetes Formula |
| 4 | ================== |
| 5 | |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 6 | Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. |
| 7 | |
| 8 | This formula deploys production ready Kubernetes and generate Kubernetes manifests as well. |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 9 | |
| 10 | Based on official Kubernetes salt |
| 11 | https://github.com/kubernetes/kubernetes/tree/master/cluster/saltbase |
| 12 | |
| 13 | Extended on Contrail contribution https://github.com/Juniper/kubernetes/blob/opencontrail-integration/docs/getting-started-guides/opencontrail.md |
| 14 | |
| 15 | |
| 16 | Sample pillars |
| 17 | ============== |
| 18 | |
Tomáš Kukrál | 189da4b | 2017-01-18 14:30:09 +0100 | [diff] [blame] | 19 | **REQUIRED:** Define image to use for hyperkube, CNIs and calicoctl image |
| 20 | |
| 21 | .. code-block:: yaml |
| 22 | |
| 23 | parameters: |
| 24 | kubernetes: |
| 25 | common: |
| 26 | hyperkube: |
Tomáš Kukrál | a636f0e | 2017-03-21 11:09:55 +0100 | [diff] [blame] | 27 | image: gcr.io/google_containers/hyperkube:v1.5.2 |
Tomáš Kukrál | 189da4b | 2017-01-18 14:30:09 +0100 | [diff] [blame] | 28 | pool: |
| 29 | network: |
| 30 | calicoctl: |
| 31 | image: calico/ctl |
| 32 | cni: |
| 33 | image: calico/cni |
| 34 | |
Tomáš Kukrál | 25a64d7 | 2017-03-23 14:14:07 +0100 | [diff] [blame] | 35 | Enable helm-tiller addon |
Tomáš Kukrál | 1b50f77 | 2017-03-23 12:51:32 +0100 | [diff] [blame] | 36 | |
| 37 | .. code-block:: yaml |
| 38 | |
| 39 | parameters: |
| 40 | kubernetes: |
| 41 | master: |
| 42 | addons: |
| 43 | helm: |
| 44 | enabled: true |
| 45 | |
Tomáš Kukrál | 25a64d7 | 2017-03-23 14:14:07 +0100 | [diff] [blame] | 46 | Enable netchecker addon |
| 47 | |
| 48 | .. code-block:: yaml |
| 49 | |
| 50 | parameters: |
| 51 | kubernetes: |
| 52 | master: |
| 53 | namespace: |
| 54 | netchecker: |
| 55 | enabled: true |
| 56 | addons: |
| 57 | netchecker: |
| 58 | enabled: true |
Tomáš Kukrál | 1b50f77 | 2017-03-23 12:51:32 +0100 | [diff] [blame] | 59 | |
Tomáš Kukrál | 6ef3f89 | 2017-02-15 12:02:22 +0100 | [diff] [blame] | 60 | Pass aditional parameters to daemons: |
| 61 | |
| 62 | .. code-block:: yaml |
| 63 | |
| 64 | parameters: |
| 65 | kubernetes: |
| 66 | master: |
| 67 | apiserver: |
| 68 | daemon_opts: |
| 69 | storage-backend: pigeon |
| 70 | controller_manager: |
| 71 | daemon_opts: |
| 72 | log-dir: /dev/nulL |
| 73 | pool: |
| 74 | kubelet: |
| 75 | daemon_opts: |
| 76 | max-pods: "6" |
| 77 | |
Tomáš Kukrál | 189da4b | 2017-01-18 14:30:09 +0100 | [diff] [blame] | 78 | |
Ales Komarek | 688a04c | 2016-07-15 15:12:30 +0200 | [diff] [blame] | 79 | Containers on pool definitions in pool.service.local |
| 80 | |
Jakub Pavlik | 7e98532 | 2016-07-17 13:16:15 +0200 | [diff] [blame] | 81 | .. code-block:: yaml |
| 82 | |
| 83 | parameters: |
| 84 | kubernetes: |
| 85 | pool: |
| 86 | service: |
| 87 | local: |
| 88 | enabled: False |
| 89 | service: libvirt |
| 90 | cluster: openstack-compute |
| 91 | namespace: default |
| 92 | role: ${linux:system:name} |
| 93 | type: LoadBalancer |
| 94 | kind: Deployment |
| 95 | apiVersion: extensions/v1beta1 |
| 96 | replicas: 1 |
| 97 | host_pid: True |
| 98 | nodeSelector: |
| 99 | - key: openstack |
| 100 | value: ${linux:system:name} |
| 101 | hostNetwork: True |
| 102 | container: |
| 103 | libvirt-compute: |
| 104 | privileged: True |
| 105 | image: ${_param:docker_repository}/libvirt-compute |
| 106 | tag: ${_param:openstack_container_tag} |
Ales Komarek | 688a04c | 2016-07-15 15:12:30 +0200 | [diff] [blame] | 107 | |
| 108 | Master definition |
| 109 | |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 110 | .. code-block:: yaml |
| 111 | |
| 112 | kubernetes: |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 113 | master: |
| 114 | addons: |
| 115 | dns: |
| 116 | domain: cluster.local |
| 117 | enabled: true |
| 118 | replicas: 1 |
| 119 | server: 10.254.0.10 |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 120 | admin: |
| 121 | password: password |
| 122 | username: admin |
| 123 | apiserver: |
| 124 | address: 10.0.175.100 |
Swann Croiset | ff97efc | 2017-02-23 13:32:33 +0100 | [diff] [blame] | 125 | secure_port: 443 |
| 126 | insecure_address: 127.0.0.1 |
| 127 | insecure_port: 8080 |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 128 | ca: kubernetes |
| 129 | enabled: true |
| 130 | etcd: |
| 131 | host: 127.0.0.1 |
| 132 | members: |
| 133 | - host: 10.0.175.100 |
| 134 | name: node040 |
| 135 | name: node040 |
| 136 | token: ca939ec9c2a17b0786f6d411fe019e9b |
| 137 | kubelet: |
| 138 | allow_privileged: true |
| 139 | network: |
| 140 | engine: calico |
| 141 | hash: fb5e30ebe6154911a66ec3fb5f1195b2 |
| 142 | private_ip_range: 10.150.0.0/16 |
| 143 | version: v0.19.0 |
| 144 | service_addresses: 10.254.0.0/16 |
| 145 | storage: |
| 146 | engine: glusterfs |
| 147 | members: |
| 148 | - host: 10.0.175.101 |
| 149 | port: 24007 |
| 150 | - host: 10.0.175.102 |
| 151 | port: 24007 |
| 152 | - host: 10.0.175.103 |
| 153 | port: 24007 |
| 154 | port: 24007 |
| 155 | token: |
| 156 | admin: DFvQ8GJ9JD4fKNfuyEddw3rjnFTkUKsv |
| 157 | controller_manager: EreGh6AnWf8DxH8cYavB2zS029PUi7vx |
| 158 | dns: RAFeVSE4UvsCz4gk3KYReuOI5jsZ1Xt3 |
| 159 | kube_proxy: DFvQ8GelB7afH3wClC9romaMPhquyyEe |
| 160 | kubelet: 7bN5hJ9JD4fKjnFTkUKsvVNfuyEddw3r |
| 161 | logging: MJkXKdbgqRmTHSa2ykTaOaMykgO6KcEf |
| 162 | monitoring: hnsj0XqABgrSww7Nqo7UVTSZLJUt2XRd |
| 163 | scheduler: HY1UUxEPpmjW4a1dDLGIANYQp1nZkLDk |
| 164 | version: v1.2.4 |
| 165 | |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 166 | |
| 167 | kubernetes: |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 168 | pool: |
| 169 | address: 0.0.0.0 |
| 170 | allow_privileged: true |
| 171 | ca: kubernetes |
| 172 | cluster_dns: 10.254.0.10 |
| 173 | cluster_domain: cluster.local |
| 174 | enabled: true |
| 175 | kubelet: |
| 176 | allow_privileged: true |
| 177 | config: /etc/kubernetes/manifests |
| 178 | frequency: 5s |
| 179 | master: |
| 180 | apiserver: |
| 181 | members: |
| 182 | - host: 10.0.175.100 |
| 183 | etcd: |
| 184 | members: |
| 185 | - host: 10.0.175.100 |
| 186 | host: 10.0.175.100 |
| 187 | network: |
| 188 | engine: calico |
| 189 | hash: fb5e30ebe6154911a66ec3fb5f1195b2 |
| 190 | version: v0.19.0 |
| 191 | token: |
| 192 | kube_proxy: DFvQ8GelB7afH3wClC9romaMPhquyyEe |
| 193 | kubelet: 7bN5hJ9JD4fKjnFTkUKsvVNfuyEddw3r |
| 194 | version: v1.2.4 |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 195 | |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 196 | Kubernetes with OpenContrail network plugin |
| 197 | ------------------------------------------------ |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 198 | |
| 199 | On Master: |
| 200 | |
| 201 | .. code-block:: yaml |
| 202 | |
| 203 | kubernetes: |
| 204 | master: |
| 205 | network: |
| 206 | engine: opencontrail |
| 207 | host: 10.0.170.70 |
| 208 | port: 8082 |
| 209 | default_domain: default-domain |
| 210 | default_project: default-domain:default-project |
| 211 | public_network: default-domain:default-project:Public |
| 212 | public_ip_range: 185.22.97.128/26 |
| 213 | private_ip_range: 10.150.0.0/16 |
| 214 | service_cluster_ip_range: 10.254.0.0/16 |
| 215 | network_label: name |
| 216 | service_label: uses |
| 217 | cluster_service: kube-system/default |
| 218 | network_manager: |
| 219 | image: pupapaik/opencontrail-kube-network-manager |
| 220 | tag: release-1.1-jpa-final-1 |
| 221 | |
| 222 | On pools: |
| 223 | |
| 224 | .. code-block:: yaml |
| 225 | |
| 226 | kubernetes: |
| 227 | pool: |
| 228 | network: |
| 229 | engine: opencontrail |
| 230 | |
Jakub Pavlik | 1cfc1fe | 2016-07-25 11:01:52 +0200 | [diff] [blame] | 231 | Kubernetes control plane running in systemd |
| 232 | ------------------------------------------- |
| 233 | |
| 234 | By default kube-apiserver, kube-scheduler, kube-controllermanager, kube-proxy, etcd running in docker containers through manifests. For stable production environment this should be run in systemd. |
| 235 | |
| 236 | .. code-block:: yaml |
| 237 | |
| 238 | kubernetes: |
| 239 | master: |
| 240 | container: false |
| 241 | |
| 242 | kubernetes: |
| 243 | pool: |
| 244 | container: false |
| 245 | |
marco | 055ff85 | 2016-07-27 15:22:33 +0200 | [diff] [blame] | 246 | Because k8s services run under kube user without root privileges, there is need to change secure port for apiserver. |
| 247 | |
| 248 | .. code-block:: yaml |
| 249 | |
| 250 | kubernetes: |
| 251 | master: |
| 252 | apiserver: |
| 253 | secure_port: 8081 |
| 254 | |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 255 | Kubernetes with Flannel |
| 256 | ----------------------- |
| 257 | |
| 258 | On Master: |
| 259 | |
| 260 | .. code-block:: yaml |
| 261 | |
| 262 | kubernetes: |
| 263 | master: |
| 264 | network: |
| 265 | engine: flannel |
Jakub Pavlik | 7e98532 | 2016-07-17 13:16:15 +0200 | [diff] [blame] | 266 | # If you don't register master as node: |
marco | a05621f | 2016-07-14 10:35:24 +0200 | [diff] [blame] | 267 | etcd: |
| 268 | members: |
| 269 | - host: 10.0.175.101 |
| 270 | port: 4001 |
| 271 | - host: 10.0.175.102 |
| 272 | port: 4001 |
| 273 | - host: 10.0.175.103 |
| 274 | port: 4001 |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 275 | common: |
| 276 | network: |
| 277 | engine: flannel |
| 278 | |
| 279 | On pools: |
| 280 | |
| 281 | .. code-block:: yaml |
| 282 | |
| 283 | kubernetes: |
| 284 | pool: |
| 285 | network: |
| 286 | engine: flannel |
marco | a05621f | 2016-07-14 10:35:24 +0200 | [diff] [blame] | 287 | etcd: |
| 288 | members: |
| 289 | - host: 10.0.175.101 |
| 290 | port: 4001 |
| 291 | - host: 10.0.175.102 |
| 292 | port: 4001 |
| 293 | - host: 10.0.175.103 |
| 294 | port: 4001 |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 295 | common: |
| 296 | network: |
| 297 | engine: flannel |
| 298 | |
| 299 | Kubernetes with Calico |
| 300 | ----------------------- |
| 301 | |
| 302 | On Master: |
| 303 | |
| 304 | .. code-block:: yaml |
| 305 | |
| 306 | kubernetes: |
| 307 | master: |
| 308 | network: |
| 309 | engine: calico |
Jakub Pavlik | 7e98532 | 2016-07-17 13:16:15 +0200 | [diff] [blame] | 310 | # If you don't register master as node: |
marco | a05621f | 2016-07-14 10:35:24 +0200 | [diff] [blame] | 311 | etcd: |
| 312 | members: |
| 313 | - host: 10.0.175.101 |
| 314 | port: 4001 |
| 315 | - host: 10.0.175.102 |
| 316 | port: 4001 |
| 317 | - host: 10.0.175.103 |
| 318 | port: 4001 |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 319 | |
| 320 | On pools: |
| 321 | |
| 322 | .. code-block:: yaml |
| 323 | |
| 324 | kubernetes: |
| 325 | pool: |
| 326 | network: |
| 327 | engine: calico |
marco | a05621f | 2016-07-14 10:35:24 +0200 | [diff] [blame] | 328 | etcd: |
| 329 | members: |
| 330 | - host: 10.0.175.101 |
| 331 | port: 4001 |
| 332 | - host: 10.0.175.102 |
| 333 | port: 4001 |
| 334 | - host: 10.0.175.103 |
| 335 | port: 4001 |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 336 | |
Tomáš Kukrál | 34c5936 | 2017-03-01 14:00:37 +0100 | [diff] [blame] | 337 | Running with secured etcd: |
| 338 | |
| 339 | .. code-block:: yaml |
| 340 | |
| 341 | kubernetes: |
| 342 | pool: |
| 343 | network: |
| 344 | engine: calico |
| 345 | etcd: |
| 346 | ssl: |
| 347 | enabled: true |
| 348 | master: |
| 349 | network: |
| 350 | engine: calico |
| 351 | etcd: |
| 352 | ssl: |
| 353 | enabled: true |
| 354 | |
Tomáš Kukrál | 7e91a94 | 2017-03-23 16:02:52 +0100 | [diff] [blame] | 355 | Enable Prometheus metrics in Felix |
| 356 | |
| 357 | .. code-block:: yaml |
| 358 | |
| 359 | kubernetes: |
| 360 | pool: |
| 361 | network: |
| 362 | prometheus: |
| 363 | enabled: true |
| 364 | master: |
| 365 | network: |
| 366 | prometheus: |
| 367 | enabled: true |
| 368 | |
Jakub Pavlik | 7e98532 | 2016-07-17 13:16:15 +0200 | [diff] [blame] | 369 | Post deployment configuration |
| 370 | |
| 371 | .. code-block:: bash |
Jakub Pavlik | 232833c | 2016-07-17 13:21:00 +0200 | [diff] [blame] | 372 | |
Jakub Pavlik | 7e98532 | 2016-07-17 13:16:15 +0200 | [diff] [blame] | 373 | # set ETCD |
| 374 | export ETCD_AUTHORITY=10.0.111.201:4001 |
| 375 | |
| 376 | # Set NAT for pods subnet |
| 377 | calicoctl pool add 192.168.0.0/16 --nat-outgoing |
| 378 | |
| 379 | # Status commands |
| 380 | calicoctl status |
| 381 | calicoctl node show |
| 382 | |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 383 | Kubernetes with GlusterFS for storage |
| 384 | --------------------------------------------- |
| 385 | |
| 386 | .. code-block:: yaml |
| 387 | |
| 388 | kubernetes: |
Tomáš Kukrál | 4f0dae3 | 2017-03-21 19:04:19 +0100 | [diff] [blame] | 389 | master: |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 390 | ... |
| 391 | storage: |
| 392 | engine: glusterfs |
| 393 | port: 24007 |
| 394 | members: |
| 395 | - host: 10.0.175.101 |
| 396 | port: 24007 |
| 397 | - host: 10.0.175.102 |
| 398 | port: 24007 |
| 399 | - host: 10.0.175.103 |
| 400 | port: 24007 |
| 401 | ... |
| 402 | |
marco | 45fc1b7 | 2016-07-02 16:11:18 +0200 | [diff] [blame] | 403 | Kubernetes namespaces |
| 404 | --------------------- |
| 405 | |
| 406 | Create namespace: |
| 407 | |
| 408 | .. code-block:: yaml |
| 409 | |
| 410 | kubernetes: |
Tomáš Kukrál | 4f0dae3 | 2017-03-21 19:04:19 +0100 | [diff] [blame] | 411 | master: |
marco | 45fc1b7 | 2016-07-02 16:11:18 +0200 | [diff] [blame] | 412 | ... |
| 413 | namespace: |
| 414 | kube-system: |
| 415 | enabled: True |
| 416 | namespace2: |
| 417 | enabled: True |
| 418 | namespace3: |
| 419 | enabled: False |
| 420 | ... |
| 421 | |
| 422 | Kubernetes labels |
| 423 | ----------------- |
| 424 | |
Marek Celoud | 901020b | 2017-01-27 14:51:41 +0100 | [diff] [blame] | 425 | Label node: |
marco | 45fc1b7 | 2016-07-02 16:11:18 +0200 | [diff] [blame] | 426 | |
| 427 | .. code-block:: yaml |
| 428 | |
Marek Celoud | 901020b | 2017-01-27 14:51:41 +0100 | [diff] [blame] | 429 | kubernetes: |
| 430 | master: |
| 431 | label: |
| 432 | label01: |
| 433 | value: value01 |
| 434 | node: node01 |
| 435 | enabled: true |
| 436 | key: key01 |
marco | 45fc1b7 | 2016-07-02 16:11:18 +0200 | [diff] [blame] | 437 | ... |
marco | 45fc1b7 | 2016-07-02 16:11:18 +0200 | [diff] [blame] | 438 | |
marco | f7efecb | 2016-07-16 16:13:37 +0200 | [diff] [blame] | 439 | Pull images from private registries |
| 440 | ----------------------------------- |
| 441 | |
| 442 | .. code-block:: yaml |
| 443 | |
| 444 | kubernetes: |
Tomáš Kukrál | 4f0dae3 | 2017-03-21 19:04:19 +0100 | [diff] [blame] | 445 | master: |
marco | f7efecb | 2016-07-16 16:13:37 +0200 | [diff] [blame] | 446 | ... |
| 447 | registry: |
| 448 | secret: |
| 449 | registry01: |
| 450 | enabled: True |
| 451 | key: (get from `cat /root/.docker/config.json | base64`) |
| 452 | namespace: default |
| 453 | ... |
| 454 | control: |
| 455 | ... |
| 456 | service: |
| 457 | service01: |
| 458 | ... |
| 459 | image_pull_secretes: registry01 |
| 460 | ... |
| 461 | |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 462 | Kubernetes Service Definitions in pillars |
| 463 | ========================================== |
| 464 | |
| 465 | Following samples show how to generate kubernetes manifest as well and provide single tool for complete infrastructure management. |
| 466 | |
| 467 | Deployment manifest |
| 468 | --------------------- |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 469 | |
| 470 | .. code-block:: yaml |
| 471 | |
| 472 | salt: |
| 473 | control: |
| 474 | enabled: True |
| 475 | hostNetwork: True |
| 476 | service: |
| 477 | memcached: |
| 478 | privileged: True |
| 479 | service: memcached |
| 480 | role: server |
| 481 | type: LoadBalancer |
| 482 | replicas: 3 |
| 483 | kind: Deployment |
| 484 | apiVersion: extensions/v1beta1 |
| 485 | ports: |
| 486 | - port: 8774 |
| 487 | name: nova-api |
| 488 | - port: 8775 |
| 489 | name: nova-metadata |
| 490 | volume: |
| 491 | volume_name: |
| 492 | type: hostPath |
| 493 | mount: /certs |
| 494 | path: /etc/certs |
| 495 | container: |
| 496 | memcached: |
| 497 | image: memcached |
| 498 | tag:2 |
| 499 | ports: |
| 500 | - port: 8774 |
| 501 | name: nova-api |
| 502 | - port: 8775 |
| 503 | name: nova-metadata |
| 504 | variables: |
| 505 | - name: HTTP_TLS_CERTIFICATE: |
| 506 | value: /certs/domain.crt |
| 507 | - name: HTTP_TLS_KEY |
| 508 | value: /certs/domain.key |
| 509 | volumes: |
| 510 | - name: /etc/certs |
| 511 | type: hostPath |
| 512 | mount: /certs |
| 513 | path: /etc/certs |
| 514 | |
marco | be30c8d | 2016-10-11 19:16:35 +0200 | [diff] [blame] | 515 | PetSet manifest |
| 516 | --------------------- |
| 517 | |
| 518 | .. code-block:: yaml |
| 519 | |
| 520 | service: |
| 521 | memcached: |
| 522 | apiVersion: apps/v1alpha1 |
| 523 | kind: PetSet |
| 524 | service_name: 'memcached' |
| 525 | container: |
| 526 | memcached: |
| 527 | ... |
| 528 | |
| 529 | |
Filip Pytloun | 9a4a40f | 2016-09-22 16:28:19 +0200 | [diff] [blame] | 530 | Configmap |
| 531 | --------- |
| 532 | |
| 533 | You are able to create configmaps using support layer between formulas. |
| 534 | It works simple, eg. in nova formula there's file ``meta/config.yml`` which |
| 535 | defines config files used by that service and roles. |
| 536 | |
| 537 | Kubernetes formula is able to generate these files using custom pillar and |
| 538 | grains structure. This way you are able to run docker images built by any way |
| 539 | while still re-using your configuration management. |
| 540 | |
| 541 | Example pillar: |
| 542 | |
| 543 | .. code-block:: bash |
| 544 | |
| 545 | kubernetes: |
| 546 | control: |
Jakub Pavlik | a277972 | 2016-11-25 15:35:26 +0100 | [diff] [blame] | 547 | config_type: default|kubernetes # Output is yaml k8s or default single files |
Filip Pytloun | 9a4a40f | 2016-09-22 16:28:19 +0200 | [diff] [blame] | 548 | configmap: |
| 549 | nova-control: |
| 550 | grains: |
| 551 | # Alternate grains as OS running in container may differ from |
| 552 | # salt minion OS. Needed only if grains matters for config |
| 553 | # generation. |
| 554 | os_family: Debian |
| 555 | pillar: |
| 556 | # Generic pillar for nova controller |
| 557 | nova: |
| 558 | controller: |
| 559 | enabled: true |
| 560 | versionn: liberty |
| 561 | ... |
| 562 | |
| 563 | To tell which services supports config generation, you need to ensure pillar |
| 564 | structure like this to determine support: |
| 565 | |
| 566 | .. code-block:: yaml |
| 567 | |
| 568 | nova: |
| 569 | _support: |
| 570 | config: |
| 571 | enabled: true |
| 572 | |
marco | d4d3dbd | 2016-09-27 11:36:40 +0200 | [diff] [blame] | 573 | initContainers |
| 574 | -------------- |
| 575 | |
| 576 | Example pillar: |
| 577 | |
| 578 | .. code-block:: bash |
| 579 | |
| 580 | kubernetes: |
| 581 | control: |
| 582 | service: |
| 583 | memcached: |
| 584 | init_containers: |
| 585 | - name: test-mysql |
| 586 | image: busybox |
| 587 | command: |
| 588 | - sleep |
| 589 | - 3600 |
| 590 | volumes: |
| 591 | - name: config |
| 592 | mount: /test |
| 593 | - name: test-memcached |
| 594 | image: busybox |
| 595 | command: |
| 596 | - sleep |
| 597 | - 3600 |
| 598 | volumes: |
| 599 | - name: config |
| 600 | mount: /test |
| 601 | |
marco | ee859d3 | 2016-11-07 11:04:57 +0100 | [diff] [blame] | 602 | Affinity |
| 603 | -------- |
| 604 | |
| 605 | podAffinity |
| 606 | =========== |
| 607 | |
| 608 | Example pillar: |
| 609 | |
| 610 | .. code-block:: bash |
| 611 | |
| 612 | kubernetes: |
| 613 | control: |
| 614 | service: |
| 615 | memcached: |
| 616 | affinity: |
| 617 | pod_affinity: |
| 618 | name: podAffinity |
| 619 | expression: |
| 620 | label_selector: |
| 621 | name: labelSelector |
| 622 | selectors: |
| 623 | - key: app |
| 624 | value: memcached |
| 625 | topology_key: kubernetes.io/hostname |
| 626 | |
| 627 | podAntiAffinity |
| 628 | =============== |
| 629 | |
| 630 | Example pillar: |
| 631 | |
| 632 | .. code-block:: bash |
| 633 | |
| 634 | kubernetes: |
| 635 | control: |
| 636 | service: |
| 637 | memcached: |
| 638 | affinity: |
| 639 | anti_affinity: |
| 640 | name: podAntiAffinity |
| 641 | expression: |
| 642 | label_selector: |
| 643 | name: labelSelector |
| 644 | selectors: |
| 645 | - key: app |
| 646 | value: opencontrail-control |
| 647 | topology_key: kubernetes.io/hostname |
| 648 | |
| 649 | nodeAffinity |
| 650 | =============== |
| 651 | |
| 652 | Example pillar: |
| 653 | |
| 654 | .. code-block:: bash |
| 655 | |
| 656 | kubernetes: |
| 657 | control: |
| 658 | service: |
| 659 | memcached: |
| 660 | affinity: |
| 661 | node_affinity: |
| 662 | name: nodeAffinity |
| 663 | expression: |
| 664 | match_expressions: |
| 665 | name: matchExpressions |
| 666 | selectors: |
| 667 | - key: key |
| 668 | operator: In |
| 669 | values: |
| 670 | - value1 |
| 671 | - value2 |
| 672 | |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 673 | Volumes |
| 674 | ------- |
| 675 | |
| 676 | hostPath |
Jakub Pavlik | 495d06f | 2016-06-17 11:33:05 +0200 | [diff] [blame] | 677 | ========== |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 678 | |
| 679 | .. code-block:: yaml |
| 680 | |
marco | b469f88 | 2016-09-27 09:56:13 +0200 | [diff] [blame] | 681 | service: |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 682 | memcached: |
marco | b469f88 | 2016-09-27 09:56:13 +0200 | [diff] [blame] | 683 | container: |
| 684 | memcached: |
| 685 | volumes: |
| 686 | - name: volume1 |
| 687 | mountPath: /volume |
| 688 | readOnly: True |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 689 | ... |
marco | b469f88 | 2016-09-27 09:56:13 +0200 | [diff] [blame] | 690 | volume: |
| 691 | volume1: |
| 692 | name: /etc/certs |
| 693 | type: hostPath |
| 694 | path: /etc/certs |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 695 | |
| 696 | emptyDir |
Ales Komarek | 688a04c | 2016-07-15 15:12:30 +0200 | [diff] [blame] | 697 | ======== |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 698 | |
| 699 | .. code-block:: yaml |
| 700 | |
marco | b469f88 | 2016-09-27 09:56:13 +0200 | [diff] [blame] | 701 | service: |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 702 | memcached: |
marco | b469f88 | 2016-09-27 09:56:13 +0200 | [diff] [blame] | 703 | container: |
| 704 | memcached: |
| 705 | volumes: |
| 706 | - name: volume1 |
| 707 | mountPath: /volume |
| 708 | readOnly: True |
marco | acdae7e | 2015-12-02 15:35:37 +0100 | [diff] [blame] | 709 | ... |
marco | b469f88 | 2016-09-27 09:56:13 +0200 | [diff] [blame] | 710 | volume: |
| 711 | volume1: |
| 712 | name: /etc/certs |
| 713 | type: emptyDir |
| 714 | |
| 715 | configMap |
| 716 | ========= |
| 717 | |
| 718 | .. code-block:: yaml |
| 719 | |
| 720 | service: |
| 721 | memcached: |
| 722 | container: |
| 723 | memcached: |
| 724 | volumes: |
| 725 | - name: volume1 |
| 726 | mountPath: /volume |
| 727 | readOnly: True |
| 728 | ... |
| 729 | volume: |
| 730 | volume1: |
| 731 | type: config_map |
| 732 | item: |
| 733 | configMap1: |
| 734 | key: config.conf |
| 735 | path: config.conf |
| 736 | configMap2: |
| 737 | key: policy.json |
| 738 | path: policy.json |
Jakub Pavlik | 27ad3a6 | 2016-08-05 11:39:45 +0200 | [diff] [blame] | 739 | |
marco | 0eda4fb | 2016-10-10 19:08:27 +0200 | [diff] [blame] | 740 | To mount single configuration file instead of whole directory: |
| 741 | |
| 742 | .. code-block:: yaml |
| 743 | |
| 744 | service: |
| 745 | memcached: |
| 746 | container: |
| 747 | memcached: |
| 748 | volumes: |
| 749 | - name: volume1 |
| 750 | mountPath: /volume/config.conf |
| 751 | sub_path: config.conf |
| 752 | |
marco | fcc20d0 | 2016-10-10 09:56:12 +0200 | [diff] [blame] | 753 | Generating Jobs |
| 754 | =============== |
| 755 | |
| 756 | Example pillar: |
| 757 | |
| 758 | .. code-block:: yaml |
| 759 | |
| 760 | kubernetes: |
| 761 | control: |
| 762 | job: |
| 763 | sleep: |
| 764 | job: sleep |
| 765 | restart_policy: Never |
| 766 | container: |
| 767 | sleep: |
| 768 | image: busybox |
| 769 | tag: latest |
| 770 | command: |
| 771 | - sleep |
| 772 | - "3600" |
| 773 | |
| 774 | Volumes and Variables can be used as the same way as during Deployment generation. |
| 775 | |
| 776 | Custom params: |
| 777 | |
| 778 | .. code-block:: yaml |
| 779 | |
| 780 | kubernetes: |
| 781 | control: |
| 782 | job: |
| 783 | host_network: True |
| 784 | host_pid: True |
| 785 | container: |
| 786 | sleep: |
| 787 | privileged: True |
| 788 | node_selector: |
| 789 | key: node |
| 790 | value: one |
| 791 | image_pull_secretes: password |
| 792 | |
Jakub Pavlik | 27ad3a6 | 2016-08-05 11:39:45 +0200 | [diff] [blame] | 793 | Documentation and Bugs |
Filip Pytloun | 06a5540 | 2016-08-12 14:53:30 +0200 | [diff] [blame] | 794 | ====================== |
Jakub Pavlik | 27ad3a6 | 2016-08-05 11:39:45 +0200 | [diff] [blame] | 795 | |
| 796 | To learn how to deploy OpenStack Salt, consult the documentation available |
| 797 | online at: |
| 798 | |
| 799 | https://wiki.openstack.org/wiki/OpenStackSalt |
| 800 | |
| 801 | In the unfortunate event that bugs are discovered, they should be reported to |
| 802 | the appropriate bug tracker. If you obtained the software from a 3rd party |
| 803 | operating system vendor, it is often wise to use their own bug tracker for |
| 804 | reporting problems. In all other cases use the master OpenStack bug tracker, |
| 805 | available at: |
| 806 | |
| 807 | http://bugs.launchpad.net/openstack-salt |
| 808 | |
| 809 | Developers wishing to work on the OpenStack Salt project should always base |
| 810 | their work on the latest formulas code, available from the master GIT |
| 811 | repository at: |
| 812 | |
| 813 | https://git.openstack.org/cgit/openstack/salt-formula-kubernetes |
| 814 | |
| 815 | Developers should also join the discussion on the IRC list, at: |
| 816 | |
| 817 | https://wiki.openstack.org/wiki/Meetings/openstack-salt |
Filip Pytloun | 06a5540 | 2016-08-12 14:53:30 +0200 | [diff] [blame] | 818 | |
| 819 | Copyright and authors |
| 820 | ===================== |
| 821 | |
| 822 | (c) 2016 tcp cloud a.s. |
| 823 | (c) 2016 OpenStack Foundation |
Filip Pytloun | d06f627 | 2017-02-02 13:02:03 +0100 | [diff] [blame] | 824 | |
| 825 | Documentation and Bugs |
| 826 | ====================== |
| 827 | |
| 828 | To learn how to install and update salt-formulas, consult the documentation |
| 829 | available online at: |
| 830 | |
| 831 | http://salt-formulas.readthedocs.io/ |
| 832 | |
| 833 | In the unfortunate event that bugs are discovered, they should be reported to |
| 834 | the appropriate issue tracker. Use Github issue tracker for specific salt |
| 835 | formula: |
| 836 | |
| 837 | https://github.com/salt-formulas/salt-formula-kubernetes/issues |
| 838 | |
| 839 | For feature requests, bug reports or blueprints affecting entire ecosystem, |
| 840 | use Launchpad salt-formulas project: |
| 841 | |
| 842 | https://launchpad.net/salt-formulas |
| 843 | |
| 844 | You can also join salt-formulas-users team and subscribe to mailing list: |
| 845 | |
| 846 | https://launchpad.net/~salt-formulas-users |
| 847 | |
| 848 | Developers wishing to work on the salt-formulas projects should always base |
| 849 | their work on master branch and submit pull request against specific formula. |
| 850 | |
| 851 | https://github.com/salt-formulas/salt-formula-kubernetes |
| 852 | |
| 853 | Any questions or feedback is always welcome so feel free to join our IRC |
| 854 | channel: |
| 855 | |
| 856 | #salt-formulas @ irc.freenode.net |