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