Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I....
Transcript of Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I....
![Page 1: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/1.jpg)
Kubernetes in productionTomáš KukrálLinuxDays 2017
2017-10-07
1 / 26
![Page 2: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/2.jpg)
Tomáš Kukrá[email protected]
@tomkukral
Cloud Architect at Mirantis MCP Kubernetes
Python developer
Prev: Infra engineer at FIT CTU
About me
2 / 26
![Page 3: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/3.jpg)
From Docker to KubernetesContainers to podsCluster networkModular architectureDesired state
3 / 26
![Page 4: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/4.jpg)
Kubernetes resourcesnode - machinepod - group of containersrc - replication-controllersvc - servicepv - persistent volumepvc - pv claim
4 / 26
![Page 5: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/5.jpg)
5 / 26
![Page 6: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/6.jpg)
apiVersion: extensions/v1beta1kind: Deploymentmetadata: name: flaskspec: replicas: 3 template: metadata: labels: app: flask spec: containers: - name: nginx image: tomkukral/flask-app-demo imagePullPolicy: Always ports: - containerPort: 5000 env: - name: REDIS_MASTER_SERVICE_HOST value: redis
6 / 26
![Page 7: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/7.jpg)
Let's install KubernetesMinikubePicokube
Kubeadm
Kubespray
Salt formula Kubernetes
Hosted solutions
7 / 26
![Page 8: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/8.jpg)
Give me a HA!
8 / 26
![Page 9: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/9.jpg)
Know you workloadsDynamic vs staticStateful vs statelessMulti vs single worker application
9 / 26
![Page 10: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/10.jpg)
Kubernetes control planeEtcdApiserverScheduler, controller-managerKubeletProxy
10 / 26
![Page 11: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/11.jpg)
11 / 26
![Page 12: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/12.jpg)
12 / 26
![Page 13: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/13.jpg)
StorageKubernetes is dynamic, storage should be dynamic
Ceph RBD or CephFS
AWS EBS, GCP disksNFS, hostPath
13 / 26
![Page 14: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/14.jpg)
NetworkCustomer traffic
Overlay vs underlay
Don't use ClusterIP for customer traffic
LoadBalancer or Ingress controller
Advanced tools for microservice: istio, linkerd
14 / 26
![Page 15: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/15.jpg)
15 / 26
![Page 16: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/16.jpg)
Know your images.Diversity vs unificationKernel featuresDifferent libraries and versions
Image building pipeline
Registries: registry:2, Atomic registry
Audit images running in cluster
What is gcr.io/google_containers/pause-amd64:3.0?
16 / 26
![Page 17: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/17.jpg)
Tune your KubernetesEtcd - snapshot-countApiserver - target-ram-mb, max-*requests-inflightController-manager - concurrent-*
Kubelet - max-pods, *-reserved
All daemons - kube-api-burst, kube-api-qps
Applatix: Making Kubernetes Production Ready – Part 2
17 / 26
![Page 18: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/18.jpg)
LCM planupdate packages?minor/major updatesetcd updatesnetworking updates
18 / 26
![Page 19: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/19.jpg)
Component dependenciesEverything is using apiserverapiserver is using etcd
calico?
Registry
DNS service
19 / 26
![Page 20: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/20.jpg)
Inteligent monitoringPods starts and dieWorkload changesAdding (and removing) new minions
20 / 26
![Page 21: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/21.jpg)
BackupScope of the backupsRecovery scenario
Recover or reborn?
Configuration
21 / 26
![Page 22: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/22.jpg)
You don't need istio and linkerd for you webapp with 3 containers.
22 / 26
![Page 23: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/23.jpg)
Let's run everything in Kubernetes!
23 / 26
![Page 24: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/24.jpg)
Great, let's parse kubectl output!
24 / 26
![Page 25: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/25.jpg)
Demo time!
25 / 26
![Page 26: Kubernetes in production - LinuxDays in production Tomáš Kukrál LinuxDays 2017 2017-10-07 I. Tomáš Kukrál tom@6shore.net @tomkukral Cloud Architect at Mirantis MCP Kubernetes](https://reader030.fdocuments.net/reader030/viewer/2022040410/5ec98856cd21621731505b08/html5/thumbnails/26.jpg)
Thanks for you attention.See you at Containers Meetup!
26 / 26