Kubernetes
FROM ZERO TO HERO Seasoned Beginner
Agenda
1. Background
2. Why k8s?
3. K8s Basics
4. Helm charts
Personal Background
18 years of Java development
(Banks, Telcos, Government sector, E-
commerce lately)
Working on Linux since 1997
Advocating since 2015
3
Kubernetes
(aka k8s)
◂ Container-orchestration system for
← automating deployment
← scaling
← operations
of application containers across clusters of hosts
◂ Designed by Google, started in 2014
(previously Borg)
now maintained by Cloud Native Computing Foundation
◂ v1.0 available since 2015, currently at v1.18
4
I ❤️ Docker - why k8s?
◂ I run
◂ Ok, I don’t, but all the cool kids run k8s !!
◂ My containers no longer fit to a single node
(true story bro)
Kubernetes enables to seamlessly run Docker
containers over multiple computing nodes
(as Docker Swarm does as well btw)
5
Real World Example
™️
of complex system deployment
◂ 6 microservices (Spring Boot apps)
◂ 2 MySQLs (used by microservices)
◂ Kafka cluster (used by microservices)
◂ ElasticSearch cluster (used by microservices)
◂ Kibana (used by microservices)
◂ Zeebe workflow broker cluster
◂ Zeebe Operate + MySQL
◂ ElasticSearch cluster (used by Zeebe)
◂ Kibana (used by Zeebe)
~20 docker containers minimum, but
we need a highly available deployment..
6
How do I get a k8s cluster?
◂ Minikube / Microk8s / K3s
Kubernetes on a single machine
◂ KOPS / kubeadm
Kubernetes on multiple machines
◂ AWS / Azure / Google Cloud
Managed Kubernetes in the cloud
7
I have k8s.. Now
what?
#1 Set up the primary tools
◂ kubectl
Command line tool to manage k8s
◂ k9s (https://k9scli.io/)
The perfect GUI for k9s
#2 Start writing k8s YAML configs
#3 PROFIT
8
K8S Basic Objects
● Pod
wraps a Docker container
9
● ReplicaSet
replicates a Pod
● Deployment
defines a ReplicaSet with other features (rolling update, etc)
● Service
Load balancer for a set of Pods
● Ingress
Enables inbound connections from outside k8s
● ConfigMap & Secret
Non-confidential and confidential configuration data
● PersistentVolume
Mountable volumes for persistent data
10
K8S Basic Objects
visualized
11
Kubernetes YAML config
➢ All K8S object types have YAML structures
➢ Configs describe the desired state
➢ Example:
○ Deploy nginx in 2 replicas
○ from Docker image
nginx:1.14.2
○ expose port 80
12
DeployingaPod
Helm Charts
➢ Package manager for Kubernetes
nice concept, horrible name, horrible Go template format
➢ Wraps many k8s resources into a single package
➢ Manages dependencies between packages
(dependency tree structures)
➢ Tracks installed packages on k8s
➢ Values injection mechanism for custom
configuration 13
14
Basic Helm commands
1. refresh dependent charts from Helm repos
$ helm dep up
2. Install package from chart
$ helm install <name> .
1. List installed packages
$ helm list
1. Upgrade deployed package
$ helm upgrade <name> .
1. Remove package (not complete removal!)
$ helm uninstall <name>
Helm package structure
■ templates/
K8s resources in the Chart
■ Chart.yaml
Chart definition file
■ requirements.yaml
Chart dependencies
■ values.yaml
Configuration values
15
ExampleHelmchart
16
“
17
Summary
■ Kubernetes runs Docker containers over
multiple hosts
■ Everything on k8s is an Object
■ K8s objects are defined in YAML files
■ Helm charts deploy/upgrade multiple
k8s objects as single packages
18
Thanks!
Any questions?
You can find me at:
◂ @kjozsa
◂ kristof.jozsa@gmail.com

K8s from Zero to ~Hero~ Seasoned Beginner

  • 1.
    Kubernetes FROM ZERO TOHERO Seasoned Beginner
  • 2.
    Agenda 1. Background 2. Whyk8s? 3. K8s Basics 4. Helm charts
  • 3.
    Personal Background 18 yearsof Java development (Banks, Telcos, Government sector, E- commerce lately) Working on Linux since 1997 Advocating since 2015 3
  • 4.
    Kubernetes (aka k8s) ◂ Container-orchestrationsystem for ← automating deployment ← scaling ← operations of application containers across clusters of hosts ◂ Designed by Google, started in 2014 (previously Borg) now maintained by Cloud Native Computing Foundation ◂ v1.0 available since 2015, currently at v1.18 4
  • 5.
    I ❤️ Docker- why k8s? ◂ I run ◂ Ok, I don’t, but all the cool kids run k8s !! ◂ My containers no longer fit to a single node (true story bro) Kubernetes enables to seamlessly run Docker containers over multiple computing nodes (as Docker Swarm does as well btw) 5
  • 6.
    Real World Example ™️ ofcomplex system deployment ◂ 6 microservices (Spring Boot apps) ◂ 2 MySQLs (used by microservices) ◂ Kafka cluster (used by microservices) ◂ ElasticSearch cluster (used by microservices) ◂ Kibana (used by microservices) ◂ Zeebe workflow broker cluster ◂ Zeebe Operate + MySQL ◂ ElasticSearch cluster (used by Zeebe) ◂ Kibana (used by Zeebe) ~20 docker containers minimum, but we need a highly available deployment.. 6
  • 7.
    How do Iget a k8s cluster? ◂ Minikube / Microk8s / K3s Kubernetes on a single machine ◂ KOPS / kubeadm Kubernetes on multiple machines ◂ AWS / Azure / Google Cloud Managed Kubernetes in the cloud 7
  • 8.
    I have k8s..Now what? #1 Set up the primary tools ◂ kubectl Command line tool to manage k8s ◂ k9s (https://k9scli.io/) The perfect GUI for k9s #2 Start writing k8s YAML configs #3 PROFIT 8
  • 9.
    K8S Basic Objects ●Pod wraps a Docker container 9 ● ReplicaSet replicates a Pod ● Deployment defines a ReplicaSet with other features (rolling update, etc) ● Service Load balancer for a set of Pods ● Ingress Enables inbound connections from outside k8s ● ConfigMap & Secret Non-confidential and confidential configuration data ● PersistentVolume Mountable volumes for persistent data
  • 10.
  • 11.
    11 Kubernetes YAML config ➢All K8S object types have YAML structures ➢ Configs describe the desired state ➢ Example: ○ Deploy nginx in 2 replicas ○ from Docker image nginx:1.14.2 ○ expose port 80
  • 12.
  • 13.
    Helm Charts ➢ Packagemanager for Kubernetes nice concept, horrible name, horrible Go template format ➢ Wraps many k8s resources into a single package ➢ Manages dependencies between packages (dependency tree structures) ➢ Tracks installed packages on k8s ➢ Values injection mechanism for custom configuration 13
  • 14.
    14 Basic Helm commands 1.refresh dependent charts from Helm repos $ helm dep up 2. Install package from chart $ helm install <name> . 1. List installed packages $ helm list 1. Upgrade deployed package $ helm upgrade <name> . 1. Remove package (not complete removal!) $ helm uninstall <name>
  • 15.
    Helm package structure ■templates/ K8s resources in the Chart ■ Chart.yaml Chart definition file ■ requirements.yaml Chart dependencies ■ values.yaml Configuration values 15
  • 16.
  • 17.
    “ 17 Summary ■ Kubernetes runsDocker containers over multiple hosts ■ Everything on k8s is an Object ■ K8s objects are defined in YAML files ■ Helm charts deploy/upgrade multiple k8s objects as single packages
  • 18.
    18 Thanks! Any questions? You canfind me at: ◂ @kjozsa ◂ kristof.jozsa@gmail.com

Editor's Notes

  • #4 Infra erdeklodes, betalal devopshoz DPC oktatas + fejlesztes, kulfoldi projectek