InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Can you explain the differences between Docker Swarm and Kubernetes? |
|
Answer» Below are the main difference between Kubernetes and Docker:
|
|
| 2. |
How can we forward the port '8080 (container) -> 8080 (service) -> 8080 (ingress) -> 80 (browser)and how it can be done? |
|
Answer» The ingress is exposing port 80 externally for the browser to access, and CONNECTING to a service that listens on 8080. The ingress will LISTEN on port 80 by default. An "ingress controller" is a pod that receives external traffic and handles the ingress and is configured by an ingress resource For this you need to configure the ingress selector and if no 'ingress controller selector' is MENTIONED then no ingress controller will manage the ingress. Simple ingress CONFIG will look like host: abc.orghttp:paths:BACKEND:serviceName: abc-serviceservicePort: 8080Then the service will look likekind: ServiceapiVersion: v1metadata:name: abc-servicespec:ports:protocol: TCPport: 8080 # port to which the service listens totargetPort: 8080Additional ResourcesKubernetes Vs Openshift |
|
| 3. |
What are the different ways to provide external network connectivity to K8? |
|
Answer» By DEFAULT, POD should be able to reach the external network but vice-versa we NEED to make some changes. Following options are available to connect with POD from the outer world.
Another method is to use Kube-proxy which can expose a service with only cluster IP on the local system port. $ kubectl proxy --port=8080 $ HTTP://localhost:8080/api/v1/proxy/namespaces//services/:/ |
|
| 4. |
How to run a POD on a particular node? |
|
Answer» Various methods are AVAILABLE to achieve it.
|
|
| 5. |
How to troubleshoot if the POD is not getting scheduled? |
|
Answer» In K8’s scheduler is responsible to SPAWN pods into nodes. There are MANY factors that can lead to unstartable POD. The most COMMON one is running out of resources, use the commands like kubectl describe <POD> -n <Namespace> to see the reason why POD is not started. Also, keep an EYE on kubectl to get events to see all events coming from the CLUSTER. |
|
| 6. |
What is the difference between Docker Swarm and Kubernetes? |
|
Answer» Below are the main difference between Kubernetes and Docker:
|
|
| 7. |
What the following in the Deployment configuration file mean? |
|
Answer» spec: containers: - name: USER_PASSWORD valueFrom: secretKeyRef: name: some-SECRET key: password Explanation - USER_PASSWORD environment variable will STORE the VALUE from the password key in the secret called "some-secret" In other WORDS, you reference a value from a KUBERNETES Secret. |
|
| 8. |
What is Kubernetes Load Balancing? |
|
Answer» Load Balancing is one of the most common and standard ways of exposing the services. There are two types of load balancing in K8S and they are: INTERNAL load balancer – This type of balancer automatically balances LOADS and allocates the pods with the REQUIRED incoming load. EXTERNAL Load Balancer – This type of balancer directs the traffic from the external loads to backend pods. |
|