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

Kubernetes for Developers

Kubernetes for Developers

An average developer thinks Kubernetes is just a buzz word that makes a DevOps engineer on his/her team sound smart. That's not totally true. The purpose of this talk is to break down into details the fundamentals of Kubernetes and make developers comfortable enough to deploy simple applications on Kubernetes and to hold conversations about it.

Idowu Emehinola

May 14, 2020
Tweet

More Decks by Idowu Emehinola

Other Decks in Technology

Transcript

  1. Hello! I am Idowu Emehinola DevOps Engineer at Deimos Co-organiser

    at DevOps Nigeria Certified Kubernetes Application Developer @_hydeenoble www.deimos.io
  2. What is Kubernetes? Kubernetes (K8s) is an open-source container orchestration

    system for automating deployment, scaling, and management of containerized applications. @_hydeenoble
  3. Why do you need a container? Infrastructure (hardware) Operating System

    Libraries Depencies OS Compatibility + Hardware Compatibility
  4. Why do you need a container? Infrastructure (hardware) Operating System

    Libraries Depencies Libs and Deps Compatibility + OS Compatibility + Hardware Compatibility
  5. Why do you need a container? Infrastructure (hardware) Operating System

    Docker Libs Deps Libs Deps Libs Deps Libs Deps Containers
  6. Containers A Container can be said to be a Virtual

    Machine (VM) but instead of running in a predefined operating system, they run using your defined operating System. © Deimos Cloud (Pty) Ltd
  7. Containers VS Virtual Machines Infrastructure (hardware) Operating System Hypervisor OS

    Libs Deps Application OS Libs Deps Application Virtual Machine Virtual Machine Infrastructure (hardware) Operating System Docker Libs Deps Application Libs Deps Application Container Container CPU Utilization Disk Space Boot up time CPU Utilization Disk Space Boot up time
  8. What Next? How do we run it in production? What

    if our container depends on other containers? How do we manage that? When number of user increase, how do we scale up (or down)? When a container crashes, how do we spin up a new one IMMEDIATELY?
  9. Kubernetes Kubernetes (K8s) is an open-source container orchestration system for

    automating deployment, scaling, and management of containerized applications.
  10. Basic Concept - Node A Node is a machine (physical

    or virtual) which several kubernetes components are installed. It is a worker machine where containers launched by kubernetes would be running in. © Deimos Cloud (Pty) Ltd Node
  11. © Deimos Cloud (Pty) Ltd Node Node What if your

    node fails? Some weird reasons
  12. POD A POD is a single instance of an application.

    A POD is the smallest object, that can created in kubernetes. © Deimos Cloud (Pty) Ltd Node POD
  13. © Deimos Cloud (Pty) Ltd API version a "Pod" can

    be found. Object type to deploy Labels are used to "Identify" pods in the kubernetes cluster Name of the Pod Name of the Container running in the Pod Docker Image to run in the container
  14. © Deimos Cloud (Pty) Ltd POD POD What if your

    pod fails? Some weird reasons
  15. 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. © Deimos Cloud (Pty) Ltd Node POD POD replicaSet
  16. © Deimos Cloud (Pty) Ltd API version for ReplicaSet Labels

    the ReplicaSet uses to filter and find it's Pods Labels are used to "Identify" this replicaSet in the kubernetes cluster Name of ReplicaSet Everything here is similar to the configuration of a pod except the "name" attribute. How many pods to run - how many instance of this application should be running at any given time
  17. POD POD POD POD POD POD POD POD REPLICA SET

    v1 v2 UPGRADE ROLLING UPDATES ROLLBACK
  18. www.deimos.io POD POD POD POD POD POD POD POD REPLICA

    SET v1 v2 UPGRADE ROLLING UPDATES ROLLBACK DEPLOYMENT
  19. Deployment Deployment which is a kubernetes object that comes higher

    in the hierarchy (relative to pod and replicaset). A deployment provides us with capabilities to upgrade the underlying application instances seamlessly.
  20. © Deimos Cloud (Pty) Ltd Name of deployment Label to

    identify Deployment resource in the cluster Defines the strategy used to replace old Pods by new ones Labels used to filter and identify pods. Labels used to target this pod Name of the container running in the pod. Docker Image Environment variable to use in the application e.g: PORT => 8000 PORT application is runs on. How many pods to run - how many instance of this application should be running at any given time
  21. Service A Service is a kubernetes object that enables communication

    between various deployment within the cluster and It can also enable users to communicate with applications running on kubernetes.
  22. Ingress An Ingress is an API object that manages external

    access to the services in a cluster, typically HTTP. It may provide load balancing, SSL termination and name-based virtual hosting. It acts like a "smart router" that routes to different service depending on the domain configure. It can be considered as a smart Loadbalancer.
  23. Loadbalancer A Loadbalancer helps to efficiently distribute incoming network traffic

    across a multiple instances of an application (or servers).
  24. Secrets Secrets are used to store sensitive information, like passwords

    or keys. They are similar to configMaps, except that they are stored in an encoded or hashed format.
  25. Summary - Compatibility Hell - Containers - Containers vs VMs

    - Container Orchestration - Node / Master Node - Cluster - Kubernetes - Pod - ReplicaSet - Deployment - Service - Ingress - ConfigMaps - Secrets