Unveiling the Kubernetes Learnings So Far
Harsh Gupta
DevOps?? | Cloud?? | Linux (RHEL)?? ? AWS / AZURE? ? Kubernetes?? ? Docker?? ? Ansible??? ? Jenkins/GitLab???? ? Terraform?? ? Openshift? ? Grafana?? ? Prometheus?? ? Mern Full Stack ? GitOps?? |
INTRODUCTION
Embarking on the Kubernetes journey has been a fascinating experience, and as a learner, I'm eager to share some insights from the early stages of this expedition. While the deployment intricacies and strategies are yet to unfold, the foundation has been laid with pods, manifests, replication controllers, and the art of labels and selectors. Join me in this exploration of Kubernetes, where every lesson is a step closer to mastering the orchestration symphony. ????
Kubernetes
Kubernetes, also known as K8s, is an open-source platform that helps manage containerized applications. It can be used to automate the deployment, scaling, and management of containerized applications. Kubernetes can also be used to manage microservice architectures.
Kubernetes is portable, extensible, and has a large ecosystem of services, support, and tools. It can be used across private, public, and hybrid cloud environments
Manifest
A Kubernetes manifest file is a YAML or JSON file that describes the desired state of a Kubernetes object. These objects can include deployment, replica set, service, and more.
Part 1: Deployment
A Kubernetes Deployment is a resource object that provides declarative updates to applications. It is a fundamental building block for managing containerized applications in a Kubernetes cluster.?A Deployment manages a set of Pods to run an application workload. A Deployment provides declarative updates for Pods and ReplicaSets.
kubectl create deployment <name> --image=<image-name>
We will share how deployment will be created with manifest next time.
Part 2: Pods - The Elemental Units:
As a learner, I'm unraveling the mysteries of pod lifecycles and the dynamics of managing application components within this essential Kubernetes entity.
A pod in Kubernetes is the smallest unit of the Kubernetes object model. It represents a single instance of a running process in a cluster. A pod can contain one or more containers that share resources and network namespaces. Pods are created, assigned a unique ID (UID), and scheduled to nodes. They remain there until termination or deletion.
The following is an example of a Pod which consists of a container running the image nginx:1.14.2.
To create the Pod shown above, run the following command:
kubectl create -f <file_name.yml>
领英推荐
Part 3: Labels and Selectors - Tagging for Harmony:
Labels and selectors add a layer of harmony to our Kubernetes environment.
In Kubernetes, labels and selectors are the standard way to group things together. Labels are properties attached to each item or object. Selectors help filter the items or objects that have labels attached to them.?
Labels and selectors are used together to manage objects or groups without the need for any specific information about the objects.
To filter the searches for getting this desired result.
kubectl get pods (-l or --selector ) region=India, team=Production
Part 4: Replication Controllers - Ensuring Resilience:
As a learner navigating Kubernetes, replication controllers become a pivotal guide. Discover their role in ensuring high availability by maintaining a specified number of pod replicas.
A ReplicationController is a Kubernetes resource that ensures a specified number of replica pods are always running. It's responsible for maintaining the desired state of a replicated application by creating or deleting pods as necessary to match the desired replica count.?It uses selector for targeting the desired resource.
The main difference between a Replica Set and a Replication Controller is that the replication controller supports equality based selectors whereas the replica set supports equality based as well as set based selectors
In the new updates of Kubernetes, the ReplicationController is being deprecated and instead use the ReplicaSet.
To create the ReplicationController shown above, run the following command:
kubectl create -f <file-name.yml>
Conclusion:
As this Kubernetes learning journey unfolds, every encounter with pods, manifests, replication controllers, and labels brings a richer understanding of container orchestration.
Stay tuned for the upcoming chapters where deployment strategies will be unveiled, taking this learner's expedition to new heights. ????
World Record Holder | 2x TEDx Speaker | Philanthropist | Sr. Principal Consultant | Entrepreneur | Founder LW Informatics | Founder Hash13 pvt ltd | Founder IIEC
1 年Nice