DevOps(Day-49) : Kubernetes Important interview Questions - Part 2
What is a namespace is Kubernetes? Which namespace any pod takes if we don't specify any namespace?
Namespace is the methodology of categorizing a single cluster into multiple sub-clusters in an organisation. These sub-clusters are then managed by different teams that can interact and share information between them. While the clusters can function autonomously, they are still connected to other clusters and aren’t completely independent, and can even support one cluster nested within another. In general, there is a default namespace where all the resources exist.
How does ingress help in Kubernetes?
Ingress defines a set of rules that allows the inbound connection of the external world to access Kubernetes cluster services. An ingress controller needs to be installed.
When the external Ip hits, the Ingress controller routes to Kubernetes endpoints.
Explain different types of services in Kubernetes.
NodePorts, ClusterIP and load-balancers are different ways to get external traffic into a Kubernetes cluster.
A ClusterIP service is the default type of service in Kubernetes. It creates a service inside the Kubernetes cluster, which can be accessed by other applications in the cluster, without allowing external access.
A NodePort service opens a specific port on all the Nodes in the cluster, and any traffic sent to that port is forwarded to the service. The service cannot be accessed from the cluster IP.
LoadBalancer is the most commonly used service type for Kubernetes networking. It is a standard load balancer service that runs on each pod and establishes a connection to the outside world, either to networks like the Internet or within your data centre.
Can you explain the concept of self-healing in Kubernetes and give examples of how it works?
There are two ways of self-healing in K8s.
The first way is to use Replicas that ensure the availability of the Pods required to maintain the stability of the application.
The second one is the use of scalability with which the number of Pods is increased or decreased according to the application demand which ensures the Load stability on the application at all times.
How does Kubernetes handle storage management for containers?
Kubernetes uses Persistent Volumes to keep the data intact in the containers. Kubernetes persistent volumes are administrator-provided volumes. They have predefined properties including file system, size, and identifiers like volume ID and name.
For a Pod to start using these volumes, it must request a volume by issuing a persistent volume claim (PVC). PVCs describe the storage capacity and characteristics a pod requires, and the cluster attempts to match the request and provision the desired persistent volume.
How does the NodePort service work?
To allow external traffic into a Kubernetes cluster, you need a NodePort ServiceType. When Kubernetes creates a NodePort service, Kube-Proxy allocates a port in the range 30000-32767 and opens this port on the interface of every node (the Node port). Connections to this port are then forwarded to the service’s cluster IP.
What are a multinode cluster and a single-node cluster in Kubernetes?
A single-node cluster is a basic infrastructure platform. Everything that needs to be executed is deployed to the current Kubernetes cluster.
Multinode Kubernetes clusters make up a Kubernetes multi-cluster environment. They can be set up in various ways – within the confines of a single physical host, with a variety of hosts in the same data centre, or using the same cloud provider in multiple geographies.
Difference between creating and applying in Kubernetes?
When Create is provided as input, K8s then creates a file according to the defined configuration files.
While Apply in K8s is used to make the changes in the already existing Kubernetes application Pods, Services, deployments, etc.
Thanks for reading my article. Have a nice day.
Comments
Post a Comment