In this post, I will be covering the concepts from our live session, some quick tips and Q/A’s from our Certified Kubernetes Certification Training Day 1 and Day 2. We covered Introduction to Kubernetes, its Architecture, installation, Basic building blocks, Static Pod and Kubernetes Basic Networking.
We also performed Lab 13 of Bootstrap Kubernetes Cluster Using Kubeadm from our extensive 35+ hands-on labs.
So, here are some Q/As asked during the Day 1 & Day 2 Live session:
Introduction to Kubernetes
Kubernetes is an open-source container orchestration tool, and it can be used to automate processes like deploying, managing, and scaling containerised applications. It was developed by Google, and now it is managed by a cloud-native computing foundation.
With Kubernetes, the following are possible:
- Orchestrate Containers
- Improve your hardware utilisation to maximise the resources required to operate your enterprise apps.
- Control and automate the deployment and updating of applications.
- To execute stateful apps, mount and add storage.
- On-the-fly scaling of containerised apps and their resources
- Declaratively manage services, which ensures that deployed applications are consistently functioning as intended.
- Check and self-heal your apps using auto-placement, auto-restart, auto replication, and auto-scaling.
Q1) What do you mean by Kubernetes cluster?
Ans) Kubernetes cluster consists of a set of the node that runs the containerised applications. A minimum cluster can contain a control plane and one or more nodes (virtual machines). The cluster is managed by the control plane.
Check out: Kubernetes Cluster and its installation.
Q2) What is a pod in Kubernetes?
Ans) A pod is the smallest deployable object in Kubernetes. It’s a process running inside your Kubernetes cluster. Containers are running inside the pod, and a pod can have more than one running container inside it. In a single node, we may have multiple pods, and pods can even share their resources.
Check out: Kubernetes Pods
Kubernetes Architecture
The architecture of Kubernetes is simple, yet it offers the most flexibility in today’s world!
It consists of Master nodes and Worker nodes; the Master communicates with the Worker using API-server. Multiple Master nodes may also exist to provide High Availability, which is indeed one of the most critical aspects of application deployment and advantage of Kubernetes.
- The Master node communicates with Worker nodes using Kube API-server to kubelet communication.
- There can be one or more pods in the Worker node, and pods can contain one or more containers.
- Containers can be deployed using the image also can be deployed externally by the user.
Check out: Kubernetes Architecture
Q3) Can we use any other container runtime engine instead of Docker as an exercise later? Since we know Docker is going away in K8s?
Ans) Yes, you can use any container runtime like containers or cri-o in Kubernetes instead of docker. Check out the list of most used container runtime
Q4) What other container engines does K8s support? What are the alternatives of Docker?
Ans) Kubernetes supports several other container runtimes than Docker like container, CRI-O, and any implementation of the Kubernetes CRI (Container Runtime Interface).
Kubernetes Master & Worker Components
The master components are in charge of coordinating each cluster node, allocating work via pod scheduling, providing administrative interfaces to the cluster, and monitoring cluster-wide health and services.
The fundamental workhorse of Kubernetes clusters is the node
or worker node. While the master components handle most of the structure and logic, the nodes are in charge of executing containers, providing health information back to the master servers, and controlling container access through network proxies.
Q5) What is the Master node?
Ans) A Master node is responsible for managing and controlling all the worker node inside a cluster. It has the following components.
Kube-APIServer – all the communication to the cluster is via the APIServer.
Kube-Controller – Manager-It takes care of the entire cluster by managing and controlling.
Etcd – It’s a database used to store cluster states.
Kube Scheduler – It’s used to schedules activities to the worker nodes and allocates resources to nodes.
Q6) What happens if the Master node goes down?
Ans) It will depend on the architecture you are following if you are using a single master setup; understand that the master manages the etcd database, API server, controller manager and scheduler with worker node. So, if you lost the master node, the entire cluster will be lost. On the other hand, if you are using a multi-master setup, if one master goes down, you continue your work with the other master node.
Q7) What is a worker node in Kubernetes?
Ans) Worker node can be a virtual machine or a physical machine. It depends upon the cluster. Each worker node in Kubernetes is managed by the Master node. Every worker node is composed of a pod. It is responsible for managing the containers ruining inside it. The following are the components of a worker node.
kubelet – it’s an agent running in every worker node. It makes sure the containers are running in a pod.
kube-proxy – It is used to expose services running inside a worker node to the external host.
Container runtime – It is used to run the containers.
Q8) What is the use of cAdvisor?
Ans: It is an agent integrated with kubelet. It monitors resource usage and analyses the performance of the container. It contains all the information like CPU, memory file, and network usage of all the running containers in a given node.
Check out: Kubernetes Monitoring
Kubernetes Cluster Creation
Kubernetes manages a highly available cluster of machines that are linked together to function as a single entity. Kubernetes abstractions enable you to deploy containerised apps to a cluster without attaching them to specific machines. To leverage this new deployment paradigm, programmes must be packaged in a way that decouples them from particular hosts: they must be containerised.
Q9) Kubernetes starts with three initial namespaces which are they?
Ans:
- default – If an object has not been assigned with any namespace it will get assigned automatically with default.
- kube-system – The namespace for objects created and managed by the Kubernetes.
- kube-public – This namespace is created automatically and is readable by all users. This is useful for exposing any cluster information necessary to bootstrap components.
Q10) What is the minimum requirement of VM to setups a Kubernetes cluster?
Ans:
1 Master Node with 2 Cores CPU and 2GB RAM ( disable SELinux , disable swap and disable firewall)
2 Worker Node with 1 Cores CPU and 1GB RAM ( disable SELinux , disable swap and disable firewall)
3 Virtual machine
Q11) What is the difference between kubectl create and kubectl apply command?
Ans)
- kubectl create – it is an imperative way of approach. If the resource is previously non-existing or deleted this command will create a whole new object.
- kubectl apply – it is a declarative way of approach. This command will make changes to the live object.
Q12) What is the use of kubeadm token create –print-join-command?
Ans) kubeadm token create will create token and –print-join-command kubeadm will output the token and SHA hash required to securely communicate with the master.
Check out: cluster creation with Kubeadm
Kubernetes Basic building blocks
Basic objects include:
- Pod: A group of one or more containers.
Service: An abstraction that defines a logical set of pods as well as the policy for accessing them. - Volume: An abstraction that lets us persist data. (This is necessary because containers are ephemeral—meaning data is deleted when the container is deleted.)
- Namespace: A segment of the cluster dedicated to a certain purpose, for example, a certain project or team of devs.
Controllers, or higher-level abstractions, include:
- ReplicaSet (RS): Ensures the desired amount of pod is what’s running.
- Deployment: Offers declarative updates for pods and RS.
- StatefulSet: A workload API object that manages stateful applications, such as databases.
- DaemonSet: Ensures that all or some worker nodes run a copy of a pod. This is useful for daemon applications like Fluentd.
- Job: Creates one or more pods, runs a certain task(s) to completion, then deletes the pod(s).
Check out: Kubernetes deployments
Network Policies
This is Kubernetes assets that control the traffic between pods. Kubernetes network policy lets developers secure access to and from their applications. This is how we can restrict a user for access.
Any request that is successfully authenticated (including an anonymous request) is then authorized. The default authorization mode is always allowed, which allows all requests. In Kubernetes, you must be authenticated (logged in) before your request can be authorized (granted permission to access).
Check out: Networking Policies
Q13) What is CNI in Kubernetes?
Ans) A CNI(container network Interface) is used to connect containers to the outside network. The pod can communicate with the network using IP addresses in a Kubernetes cluster.
Quiz Time (Sample Exam Questions)!
With our Kubernetes training program, we are going to cover 100+ sample exam questions to help you prepare for CKA certification.
Check out the questions and see if you can solve this.
Ques) Which of the following runs on each node and ensures containers are running in a pod?
A. Pod
B. Etcd
C. Kubelet
D. All of the above
Write down the right answer in the comment box. The right answer will be revealed in my next week’s blog.
Feedback
We always work on improving and being the best version of ourselves from the previous session hence constantly ask feedback from our attendees.
Here’s the feedback that we received from our trainees who had attended the session…
Related/References
- (CKA) Certification: Step By Step Activity Guides/Hands-On Lab Exercise
- Docker & Certified Kubernetes Administrator (CKA) Training
Next Task For You
Begin your journey towards becoming a Certified Kubernetes Administrator [CKA] and earning a lot more in 2021 by joining our FREE CLASS.
Click on the below image to Register Our FREE Masterclass on CKA exam preparation now!
The post [Recap] Day 1 & 2: K8s Architecture, Components, Installation, and Networking [CKA/D] [Kubernetes Certification] appeared first on Cloud Training Program.