KUBERNETES DEPLOYMENT | REPLICASETS


Kubernetes Deployment
- Today we will learn about Kubernetes Deployment.
- Understand the difference between a container, pod, and deployment.

Kubernetes allows you to define container specifications using a YAML manifest instead of command line options.
- The YAML manifest includes parameters such as container image, port, volumes, and networking.
- A pod in Kubernetes can have a single or multiple containers, allowing for dependencies or sidecar containers.

Create pods using a deployment resource instead of creating them directly
- Deployment resource creates an intermediate resource called replica set, which is a Kubernetes controller
- Replica set rolls out the pods and allows for defining the number of replicas for high availability or load balancing

ReplicaSet ensures that the desired number of replicas are always maintained.
- Auto healing: If a pod is accidentally deleted, ReplicaSet will recreate it based on the deployment yaml manifest.
- Scaling: ReplicaSet can scale the number of replicas according to the count mentioned in the deployment yaml manifest.

ReplicaSet controller implements auto-healing feature and ensures desired state
- ReplicaSet controller is responsible for auto-healing pods and scaling deployments
- Desired state in deployment manifest should match the actual state in the cluster

Use 'kubectl get all' to list all resources in a namespace
- The 'kubectl get all' command lists all deployments, services, and other resources in the specified namespace.
- If you want to list resources in all namespaces, use 'kubectl get all -A'.

Create deployment instead of pod and refer to Kubernetes documentation for syntax
- Refer to official Kubernetes documentation or examples to remember syntax and make necessary modifications
- In interviews, focus on understanding concepts like images, labels, selectors, and replicas rather than memorizing syntax

Deployment creates replica sets and pods automatically in Kubernetes.
- Replica sets are created by deployment and are responsible for creating and managing pods.
- Deployment is an abstraction that handles auto-healing and zero downtime in Kubernetes.

Kubernetes deployment is a high-level abstraction and uses replica sets to ensure a specified number of pods are always running.
- Replica sets are responsible for creating and maintaining a specified number of pods.
- Deleting a pod triggers the replica set to create a new pod to maintain the desired number of pods.

Understand how to replace images and play with Kubernetes deployments and replica sets
- Experiment with killing pods and observe the behavior
- Increase the replica count and verify if replica sets are created

Launch your GraphyLaunch your Graphy
100K+ creators trust Graphy to teach online
𝕏
Tech Guides 2024 Privacy policy Terms of use Contact us Refund policy