Table of contents
- 📍Week 03: Exploring Kubernetes Objects and Setting Up a Minikube Cluster
- 📍Kubernetes Objects:
- 📍The Basic Kubernetes Objects Include:
- 📍Relation between these objects
- 📍State of the objects
- 📍Kubernetes object management
- 📍Fundamental Of Pods
- 📍Kubernetes Configuration
- 📍Important Notes on Minikube Installation📍
- 📍References
📍Week 03: Exploring Kubernetes Objects and Setting Up a Minikube Cluster
Hello everyone👋,
👉In Week 03, we are diving into Kubernetes objects and setting up a Minikube cluster. Kubernetes objects, such as deployments, services, and pods, are the building blocks of your cluster. Understanding these is crucial for managing applications.
We will explore the different types of objects, how to create and manage them, and guide you through setting up a Minikube cluster on AWS EC2 instances. All manifests for this lab will be available on my GitHub repository. Whether you're new to Kubernetes or looking to deepen your knowledge, this week's content will provide essential insights.
🚀Let's dive in and explore the core components that make Kubernetes work!🚀
📍Kubernetes Objects:
A Kubernetes object is a persistent entity in the Kubernetes system that represents the desired state of a cluster. It describes what you want your cluster to do, such as running a specific number of pod instances or setting up network routes. Kubernetes objects are used to manage and automate containerized applications in a Kubernetes cluster.
🔶Kubernetes uses objects to represent the state of your cluster.
🔶What containerized applications are running ( and on which node ).
🔶The policies around how these applications behave, such as restart policies, upgrades, and fault tolerance.
🔶Once you create the object, the Kubernetes system will constantly work to ensure that the object exists and maintains the cluster's desired state.
🔶Every Kubernetes object includes two nested fields that govern the object configuration.👇
🔶Object Specification:
The specification, which we provide, describes your desired state of the object, the characteristics that you want the object to have.
🔶Object Status:
The status describes the actual state of the object and is supplied and updated by the kubernetes system.
🔶All objects are identified by a unique name and a UID.
🔶It represents as JSON or YAML files
🔶You create these and then push them to the kubernetes API with kubectl.
📍The Basic Kubernetes Objects Include:
💠Pod | 💠Secretes |
💠Service | 💠ConfigMaps |
💠Volume | 💠Deployments |
💠Namespace | 💠Jobs |
💠Replicasets | 💠Daemonsets |
📍Relation between these objects
🔶 Pod manages containers
🔶 Replicaset manage pods
🔶Services expose pod processes to the outside world
🔶 Configmaps and Secretes helps you configure pods
📍State of the objects
💮Replicas (2/2)
💮Image (Tomcat/Ubuntu)
💮Name
💮Port
💮Volume
💮Startup
💮Detached (default)
📍Kubernetes object management
The kubectl command line tool supports several different ways to create and manage kubernetes object.
🔶Declarative:
It is about describing what you are trying to achieve, without instructing how to do it.
🔶Imperative:
This method explicitly tells " how to accomplish it "
🔶Management Technique | 🔶Operates On | 🔶RecommendedEnvironment |
Imperative Commands | Live Objects | Development projects |
Declarative object configuration | Individual files(Yml/Jason) | Production |
📍Fundamental Of Pods
💮When a pod gets created, it is scheduled to run on a node in your cluster.
💮The pod remains on that node until one of the following occurs:
💮The process is terminated,
💮The pod object is deleted,
💮The pod is evicted due to a lack of resources, or
💮The node fails.
💮If a pod is scheduled to a node that fails, or if the scheduling operation itself fails, the pod is deleted.
💮If a node dies, the pods scheduled to that node are scheduled for deletion after a time-out period.
💮A given pod is not rescheduled to a new pod, instead it will be replaced by an identical pod, with even the same name if desired, but with a new user id (UID).
💮Volume in a pod will exist as long as that pod exists. if that pod is deleted for any reason, the volume is also destroyed and created as new on the new pod.
💮A controller can create and manage multiple pods, handling replication, rollout, and providing self-healing capabilities.
📍Kubernetes Configuration
💠All-in-one single-node installation | 💠Single-Node etcd, Single-Master and Multi-Worker installation | 💠Single-Node etcd, Multi-Master and Multi-Worker installation |
With an all-in-one, all the master and worker components are installed on a single node. this is very useful for learning, development, and testing. this type should not be used in production. Minikube is one such example. and we are going to explore it soon. | In this setup, we have a single master node, which also runs single-node etcd instance. multiple worker nodes are connected to the master node. . | In this setup, we have multiple master nodes, which works in a high availability mode, but we have a single-node etcd instance. multiple worker nodes are connected to the master node. |
Note: In the above all three setups the master node must be at least 2vcpu and 4GB RAM.
📍Important Notes on Minikube Installation📍
I encountered an issue with the first video: it does not provide up-to-date instructions for installing the Minikube cluster. So, you should watch the second video, because it contains the most current information. The links to both videos are provided in the References section.
If you start installing Minikube by following the second video and find yourself concerned about writing long commands, don’t worry. Visit my GitHub repository, fork it, and simply copy and paste all the commands into your Ubuntu machine. Additionally, you can find all manifests and commands related to manifests in my GitHub repository.
🙏 Thank you for reading! 🙏
If you have any questions or suggestions, feel free to leave a comment or reach out to me directly. You can contact me through the following:
Email: muhammad77pro@gmail.com
LinkedIn: Click Here
Let’s continue learning and growing together in the fascinating world of DevOps!
📍References
I covered all these concepts from the following video tutorials:
👉Click Here to watch the first video — Note: You may encounter issues installing the Minikube cluster using this video due to outdated content.
👉Click Here to watch the second video — This video provides updated instructions for installing the Minikube cluster.
NOTE: After watching these videos, if you’re concerned about taking notes or running into issues with long commands, don’t worry! Simply click on my 👉GitHub link to access and fork the repository. You can copy and paste all the commands into your Ubuntu machine. Additionally, all manifests and related commands are available in the repository.
💟 💟 💟 Just keep me in your prayers! 💟 💟 💟