Kubenetes Walkthrough
This chapter will introduce you to the basic workings of Kubernetes, This is mandatory if you are new to Kubernetes
- Kubernetes (k8s) Basics
- Kubernetes Architecture
- Amazon EKS
You may click on the below chapters to jump on that
- Workshop Introduction
- An Introduction To Kubernetes
- Setting up The Workshop Environment
- Building a private EKS cluster with Terraform
- Extra optional activities
- Conclusion
- Cleanup
- Open source container management platform
- Helps you to run your container at scale
- Provides Objects and APIs for building modern applications
- Machines (Servers) utilizes kubernetes cluster, called Nodes
- Nodes in a Kubernetes cluster may be physical, or virtual.
- A Control-plane-node type, which makes up the Control Plane, acts as the “brains” of the cluster.
- A Worker-node type, which makes up the Data Plane, runs the actual container images (via pods).
- Kubernetes objects are entities that are used to represent the state of the cluster.
- Object: “record of intent” – once created, the cluster does its best to ensure it exists as defined. This is known as the cluster’s “desired state.”
- Kubernetes is always working to make an object’s “current state” equal to the object’s “desired state.”
- What pods (containers) are running, and on which nodes
- IP endpoints that map to a logical group of containers
- How many replicas of a container are running And much more…
- Smallest unit that is managed by Kubernetes, it runs one or more containers inside it
- Implements a single instance of a pod on a worker node
- Details how to roll out (or roll back) across versions of your application
- You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate
- You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments
The following are typical use cases for Deployments:
- Create a Deployment to rollout a ReplicaSet. The ReplicaSet creates Pods in the background.
- Declare the new state of the Pods by updating the PodTemplateSpec of the Deployment. A new ReplicaSet is created and the Deployment manages moving the Pods from the old ReplicaSet to the new one at a controlled rate. Each new ReplicaSet updates the revision of the Deployment.
- Rollback to an earlier Deployment revision if the current state of the Deployment is not stable. Each rollback updates the revision of the Deployment.
- Scale up the Deployment to facilitate more load.
- Pause the rollout of a Deployment to apply multiple fixes to its PodTemplateSpec and then resume it to start a new rollout.
- Use the status of the Deployment as an indicator that a rollout has stuck.
- Clean up older ReplicaSets that you don't need anymore.
- Ensures a defined number of pods are always running
- Ensures a pod properly runs to completion
- Maps a fixed IP address to a logical group of pods
- Key/Value pairs used for association and filtering (Like Tags)
- API Server: Entry point for REST / kubectl
- etcd: Distributed key/value store (Like Tags)
- Controller-manager: Always evaluates current vs desired state
- Scheduler: Schedules pods to worker nodes
- Made up of worker nodes
- kubelet: Acts as a channel between the API server and the node
- kube-proxy: Manages IP translation and routing