Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes: The Coffee Essentials

Kubernetes: The Coffee Essentials

An introduction to Kubernetes, container orchestration and cloud-native architecture, originally presented in 2022.

Avatar for Amaury Borges Souza

Amaury Borges Souza

September 23, 2026

More Decks by Amaury Borges Souza

Other Decks in Technology

Transcript

  1. What’s my purpose bringing this talk? • • • •

    • • You will learn the Kubernetes concepts; You will learn the Kubernetes architecture Try to run the Kubernetes DEMO on the end; Sharing knowledge about Kubernetes; Foment the @Talks initiative; Bring some Kubernetes references; 2
  2. Kubernetes adoption • The most used orchestration tool for Cloud

    Native apps. • Deploy quickly, DevOps Cycle (CI/CD), SRE • Many accounts/projects are migrating to the Cloud (AWS, Azure, IBM). • Kubernetes study groups (Teams). • Kubernetes certifications (CKA, CKAD, CKS). 3
  3. About me • Systems Analysis @fatecam • Azure/AWS certified •

    Passionate for technology • +9 years of IT experience • Infrastructure Analyst @techfor • Linux SysAdmin @ibm • DevOps Engineer @kyndryl • Digital Creator @medium • Open-source contributor @github • Descomplicando o Kubernetes • Descomplicando o Helm • Descomplicando o Ansible • DevOps Exercises • I love music, coffee and travel • Web @amaurybsouza 4
  4. Topics • How was in the past? • What’s Kubernetes

    • Why to learn Kubernetes? • Kubernetes running locally • SRE x DevOps x Kubernetes • Kubernetes Terminologies • Discuss the Kubernetes Architecture • Components for Master & Work Nodes • Kubernetes, OpenShift, Nomad, Swarm • Cloud Native & Kubernetes • DEMO (Hands-on k8s) • Kubernetes Certifications • References • Keep it up 5
  5. In the past… • Manual process (Shell Script). • Extra

    knowledge required… • Many human errors. • DevOps culture didn’t was ready. • There was deploy on Friday. • Infrastructure is not versioned. • Infrastructure as Code not exist. • Communication (Dev and Ops). • Kubernetes not exist. • Cloud Native Apps no idea. • GitOps was far away. 7
  6. In the past… • Manual process (Shell Script). • Extra

    knowledge required… • Many human errors. • DevOps culture didn’t was ready. • There was deploy on Friday. • Infrastructure is not versioned. • Infrastructure as Code not exist. • Communication (Dev and Ops). • Kubernetes not exist. • Cloud Native Apps no idea. • GitOps was far away. Today… IBM Automation / © 2020 IBM Corporation 8
  7. Where does Docker fit into this story? Docker is very

    good for developers, because with it you have the freedom to choose your programming language, your database and your favorite distribution. For sysadmins, it's even better, because, in addition to the freedom to choose the distribution, we don't need to prepare the server with all the application's dependencies. We also don't need to worry about whether the machine is physical or virtual, the Docker supports both. - Isolation of the layers Rational usage of resources Speed deployment Less dependence of environment 9
  8. We can install several… • Databases servers • Web apps

    • General services • Monitoring solutions • DevOps Tools • Simulate test environment 11
  9. Difficulties - How to scale the containers? - How to

    ensure the workflow between the several containers of the application? - How to detect containers with failures and how to fix it immediately? - How to cover cloud native applications? 12
  10. Companies using Kubernetes Since 2014, Kubernetes has grown immensely in

    popularity. Many companies use Kubernetes, some of the famous companies using Kubernetes. 16
  11. Why learn Kubernetes? - Many applications around the world runs

    on Kubernetes. - Built for the current architectural standard of applications. - Container orchestration de facto standard. - Professional differential. - If that's still not enough! Look for this… 17
  12. What’s Kubernetes? - A.K.A K8s, Kates - Develop by Google

    - Maintained by CNCF apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 - Written in Go - Open-Source Orchestrator - The most used today apiVersion: apps/v1 kind: ReplicaSet metadata: name: frontend labels: app: guestbook tier: frontend spec: # modify replicas according to your case replicas: 3 selector: matchLabels: tier: frontend template: metadata: labels: tier: frontend spec: containers: - name: php-redis image: gcr.io/google_samples/gbfrontend:v3 apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 18
  13. Kubernetes Terminologies - POD’s - Deployments - Services - ConfigMaps

    - Secrets - Jobs - HPA - Kubelet - ETCD - Namespaces - Replicaset - Cluster - Work Nodes - Kubectl 19
  14. kubectl x kubeadm x kubelet kubectl - Main K8s CLI

    - Interact with API. - Applies, destructions and modify services/resources. kubeadm - Used to create and configure the cluster - We can perform join, resets, init commands on cluster - A simple way to you try out kubernetes by first time. kubelet - Node agent on each worker node - Needs run on all worker nodes - Ensure that containers being run on POD 21
  15. Kubernetes running locally If you want to use Kubernetes on

    your local machine, on your desktop, there are several solutions that will create a Kubernetes cluster, using virtual machines or Docker, for example. 22
  16. Kubernetes Architecture Control Plane: The main machine of the cluster

    (managing the work nodes). Responsible to assigning tasks to the nodes. Work Nodes: machines responsible to do the tasks sent by Control Plane. 23
  17. POD’s Pods are the smallest deployable units of computing that

    you can create and manage in Kubernetes. The following is an example of a Pod which consists of a container running the image nginx:1.14.2. apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 To create the Pod shown above, run the following command: kubectl apply -f https://k8s.io/examples/pods/simple-pod.yaml 24
  18. Replicaset A ReplicaSet's purpose is to maintain a stable set

    of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods apiVersion: apps/v1 kind: ReplicaSet metadata: name: frontend labels: app: guestbook tier: frontend spec: # modify replicas according to your case replicas: 3 selector: matchLabels: tier: frontend template: metadata: labels: tier: frontend spec: containers: - name: php-redis image: gcr.io/google_samples/gbfrontend:v3 25
  19. Deployment A Deployment provides declarative updates for Pods and ReplicaSets.

    apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 26
  20. Services A Service in Kubernetes is a REST object, similar

    to a Pod. Like all of the REST objects, you can POST a Service definition to the API server to create a new instance. The name of a Service object must be a valid RFC 1035 label name. apiVersion: v1 kind: Service metadata: name: my-service spec: selector: app.kubernetes.io/name: MyApp ports: - protocol: TCP port: 80 targetPort: 9376 27
  21. Deploying NGINX app using Kubernetes # minikube start minikube v1.26.0

    on Debian bookworm/sid Using the qemu2 (experimental) driver based on user configuration Starting control plane node minikube in cluster minikube Creating qemu2 VM (CPUs=2, Memory=6000MB, Disk=20000MB) ... Preparing Kubernetes v1.24.1 on Docker 20.10.16 ... Generating certificates and keys ... Booting up control plane ... Configuring RBAC rules ... Verifying Kubernetes components... Using image gcr.io/k8s-minikube/storage-provisioner:v5 Enabled addons: default-storageclass, storage-provisioner Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default 29
  22. What’s the purpose of this DEMO? • Show how the

    kubectl command works • Check some points of Kubernetes like (resiliency, scalability, less downtime, deploy quickly). • Show main manifests from Kubernetes (POD’s, Replicaset, Deployment, Services). • Create a Deployment using the CLI. • Replicaset will be deployed. • POD will be deployed. • Create a Service using the CLI. • Export the NGINX service . • From ClusterIP to NodePort. • Access the NGINX app on web browser. 30
  23. Kubernetes Training The Certified Kubernetes Administrator (CKA) program was created

    by the Cloud Native Computing Foundation (CNCF), in collaboration with The Linux Foundation, to help develop the Kubernetes ecosystemasas Get more details around the Kubernetes certifications at cncf.io/certification Why become a Kubernetes certified? - Kubernetes certification can help you land a new role. - Kubernetes certification will help you get into DevOps. - You’ll learn some things. - Values Kubernetes certification. 31
  24. No skip the steps on your Kubernetes journey - Docker

    (Dockerfile, Compose, Swarm). - API’s (What’s it?, How it’s work?). - LINUX (process, capacity planning, filesystems). - Keep envolved on Meetups, DevOps Days. - Learn more YAML files, coding, automation. 32
  25. References • • • • • • • • •

    • • • • • • • • https://labs.play-with-k8s.com/ https://getup.io/kubicast/ https://kubernetes.io/ https://www.cncf.io/ https://kubernetes.io/training/ Youtube (kubedev) Youtube (LINUXtips) Youtube (Full Cycle) https://github.com/badtuxx/DescomplicandoKubernetes https://github.com/badtuxx/DescomplicandoDocker https://kind.sigs.k8s.io/ https://kubernetes.io/docs/concepts/security/security-checklist/ https://www.hipsters.tech/microsservicos-kubernetes-e-sre-no-gympasshipsters-on-the-road-29/ https://microservices.io/ https://github.com/gomex/docker-para-desenvolvedores https://github.com/derailed/popeye https://udemy.com/course/azurepipelines/ 33