Debug School

Nivas Chandran
Nivas Chandran

Posted on • Updated on

Assignment 1

What is Kubernetes?

Kubernetes is a framework Google created, now an open source software managed by CNCF.

Why Do we need Kubernetes? Explain in 10 lines

Its a Container Orchestration, which helps to manage 1000s of containers. It provides means to host multiple services which are required to manage Production deployments, like Security, High Availability, Storage, Authentication, DNS Resolutions among others.

How Kubernetes Works?

In Kubernetes, Pod is a logical component, which is an abstraction over the containers. Each node/VM can contain multiple pods, with each pod containing one or more containers. All containers in each pod share the same IP Address with different ports. The Work being done is the Container, and the Worker is the VM/host machine where the actual work is being done.

Kubernetes Architecture. Explain each component with 1 line.

Kubernetes Architecture consists of Master and Worker Nodes.

Master consists of 4 components.

  1. apiserver : This manages 1000s of APIs, which are required to manage the work. Uses REST interface and supports JSON. This is SOURCE of TRUTH.
  2. Controller Manager : This delegates the work to each node, which checks the status of specific task that is allocated and reports back to apiserver.
  3. etcd : This is Storage component, which maintains all status, and updates of each node in the cluster. The apiserver writes all the information that it receives into etcd.
  4. Scheduler : Schedules the work as configured. There is a default scheduler, that can be overridden and customized as needed.

Worker Nodes consists of following components:

  1. kubelet
  2. kube-proxy
  3. Containers

PODS:

  1. Pods are logical entity
  2. Pods contain Containers
  3. Pods are not created
  4. Pods are instantiated
  5. Pods can contain multiple Containers
  6. LifeCycle of pods are : Pending, Running and Successful/Failed
  7. Pods are Ephemerel, once destroyed cannot be brought back, but similar pods can be instantiated.
  8. Atomic Unit of Scheduler
  9. New pods can be instantiated using the kube config with 'kind' as 'pod'

Namespaces

  1. Namespaces are logical segregation to ensure the resources are managed efficiently across the cluster.
  2. Pods are created under a namespace, default is "default' namespace.
  3. Pods created under one namespace is not visible to other namespaces.

ReplicationController

  1. This controls the number of replicas that are required.
  2. if we need 5 instances of container, we can create using --replicas=5

ReplicaSet

  1. ReplicaSet is same as ReplicationController, but with additional features and bug fixes done over ReplicationController.

Deployments

This is most commonly used Kind in production. Primarily has 5 features:

  1. Replication
  2. Controller
  3. Versioning
  4. Rollout
  5. Rollback Type of deployment.
    1. “Recreate” - Deletes all pods and recreates new ones with new version. Some down time is observed.
    2. “RollingUpdate”. Default is RollingUpdate. - Deletes few older versions of pods, and exchanges with newer version of pods. No downtime, since exact number of pods are always available.

DaemonSet

Deploys one pod per Node. Useful for having single instances like logging, printing, etc

CronJobs

Runs the job as per the configured schedule.

ConfigMaps

  1. Its a key value pair created at cluster level
  2. Can be accessed by attaching the configmap to a pod
  3. Containers can access this by using the VolumeMounts

Service

  1. Network Load Balancing
  2. Redirects the requests only to healthy pods
  3. The LABEL of the pods should match the Selector level of Service label

Types of Service

  1. ClusterIP - Exposes the cluster IP to redirect the request at pod level. This Service is inside the Cluster
  2. NodePort - Exposes the ports at each Node level. This Service is inside the Cluster
  3. LoadBalancer - Exposes the DNS name and IP to manage the traffic to the cluster. This Service is Outside the Cluster, created by Cloud Admin.

Stateful Set

  1. Maintains order, name of pods
  2. Remembers the PV that was used and re-attaches to same one

Authentication

  1. Certificate
  2. Token
  3. OpenID
  4. Web Hook

Authorization

Top comments (0)