DevOps(Day-48) : Kubernetes Important interview Questions - Part 1
What is Kubernetes and why it is important?
Kubernetes is the container orchestration tool. The container is used to package the application to run it in any system and this container's functionality is managed by Kubernetes.
Some advantages are:-
Hosts containerized workloads, providing them with computing, storage, and network resources.
Automatically manages large numbers of containerized applications keeping them healthy and available by adapting to changes and challenges.
What is the difference between docker swarm and Kubernetes?
Docker Swarm is simple to set up and run. You can be off and running with creating services in moments. To manage a swarm, you use the same Docker command line interface you use to build images and run containers on your workstation. This makes for a greater degree of approachability for Docker users.
Kubernetes uses a different command line interface. It has many similarities to the Docker interface, but it’s a separate executable with more commands to know. Kubernetes also has a vast array of configuration and authentication options. This gives much greater flexibility—but at the cost of having much more you need to know.
How does Kubernetes handle network communication between containers?
Components in a Kubernetes platform include nodes, applications, containers, and pods. These components communicate using different networking methods. The methods areas are shown below:-
Internet-to-service networking - Using the internet directly is critical. So, Ingress and egress techniques help to set up external access. These two policies are set up with either blacklisting or whitelisting to control traffic in and out of a network.
Container-to-container networking - It is straightforward for containers situated in the same pod to communicate with each other.
Pod-to-pod networking - Pods in Kubernetes are allocated a unique IP address which they use to communicate with each other.
Pod-to-service networking - Containers can go down at any moment, which may lead to the loss of all data stored in them. Same way, pods have IP addresses that may disappear unexpectedly. When this happens, Kubernetes replaces the lost IP addresses with new ones. So, each pod gets allocated a single IP address. An abstraction layer set on top of pods solves this problem. It helps communicate with the pods and eliminates the need to track pods as they start, die, and get rescheduled without affecting the application. Kubernetes services handle the abstraction layer. These services assign a single IP address to each set of pods. This enables the routing of traffic addressed to a pod through the virtual IP address of the service.
How does Kubernetes handle the scaling of applications?
Kubernetes uses Replicas to maintain the accountability of running Pods and ensures a fixed amount of Pods running each time. Even if due to some issues a Pod goes down, it automatically comes up. Based on CPU utilization K8s provides scalability to maintain application stability.
What is a Kubernetes Deployment and how does it differ from a ReplicaSet?
Kubernetes deployment is the methodology to rolling the updates of an application without making the services down. Deployment files have a set of features that define the application configurations and which include the replicas. ReplicaSets provides a set of replicas for the running Pods and on top of this additional configurations combine to form K8s deployment.
Can you explain the concept of rolling updates in Kubernetes?
The rolling update is the feature in K8s that allows the users to update the application without causing downtime. Rolling updates allow the following actions:
Promote an application from one environment to another (via container image updates)
Rollback to previous versions.
Continuous Integration and Continuous Delivery of applications with zero downtime
How does Kubernetes handle network security and access control?
Kubernetes uses the RBAC(RollBackAccessControl) method and a set of network policies to handle its network and access controls. Network Policies are defined to limit the traffic of external networks incoming to specific clusters. Access control policies restrict the access of unwanted users and allow only users with specific permissions.
Can you give an example of how Kubernetes can be used to deploy a highly available application?
Kubernetes uses Replicas in the Kubernetes configuration file which is responsible for making a fixed number of Pod available at all times. Let's say a Pod goes down to some issue then the application would become unstable and could go down. Here we define the replicas which contain the number of Pods that need to be available all time.
Kubernetes Uses Load balancer that distributes incoming traffic between the Pods which makes the application highly available.
Kubernetes uses network Policies that make prevents application vulnerability.
Thanks for reading my article. Have a nice day.
Comments
Post a Comment