Murtaza Haji

.

Home

Kubernetes Day 0

Published Feb 20, 2021

Tracking my progress in series of blog posts

Setup:

  1. Install kubernetes

    choco install kubernetes-cli

  2. Installl minikube

    choco install minikube

Concepts:

  • Kubernetes : Orchestration software to deploy docker images/containerised applications

  • Node : Virtual Machine/Server consisting of pods. We create replica nodes to avoid downtime.
  • Pods :

K8 Pod

    - Abstraction over container.

    - Provides running environment for images to run.

    - Should run only 1 application container inside each pod

    - Each Pod gets its own ip address and is ephemeral. New Ip address on re creation.

  • Service : Used to provide permanent IP address to pods. Independant of pod lifecycle. Which means if pod is restarted, service will assist in keeping it connected. It also acts as load balancer.

  • Ingress : Provides a secure protocal and port forwarding to url for accessing pods.

  • ConfigMap : Used for configuration management of applications running in pods. Helps eliminating rebuilding image incase environment variables change for an application.

  • Secret : Exactly like ConfigMap, but used to store sensitive data like username , passwords etc. Base64 encoded.

  • Volumes : Because pods are ephemeral , we need to persist data. Hence come volumes. Its defined outside a cluster since k8 is not reponsible for storing data. K8 Concepts

  • Deployment : Its a blueprint for pods. Each time a node needs to be replicated we use deployment. We create deployments to manage pod creation, replication and auto scaling. Abstraction of pods.

  • StatefulSet : Since DB cannot be replicated without tracking state(to avoid data inconsistencies), We use StatefulSets instead of Deployments for Stateful Applications. General practice is to host DB outside K8 to avoid complexity related to usage of StatefulSet.