DevOps Kubernetes and Python Scripting Interview Preparation

preview_player
Показать описание
DevOps Interview Questions : Kubernetes and Python Scripting

1) Can you explain Kubernetes Architecture
2) What is PDB , Have you applied it.
3) Explain the role of the kube-proxy in Kubernetes.
4) How will you maintain security for Kubernetes
5) What is the role of the kube-controller-manager in Kubernetes
6) How will you handle and process data of excel workbook using python
7) Python scripting for handling API requests

#devopsengineer
#devopsmadeeasy
#devopsengineering
#devops
Рекомендации по теме
Комментарии
Автор

1) Can you explain Kubernetes Architecture
: So starting with two components Control Plane and Worker Nodes
Components of Control Plane: (Brain of K8s like Mitochondria is the Powerhouse Cell😅)
API server: Its like a receptionist all request will got through API server when first
applied, request like create, delete, update.

Scheduler: Decides where the app should run based on available resource with node
Controller Manager: it will monitor health of all apps and check everything is running.
ETCD: Its a store like database store, it stores entire state of K8s, like which app is
running which is stop.
Cloud controller manager: specifically for cloud specific tasks like for create load
balancers.

WORKER NODE:

Kubelet: Its like supervisor, keep eye and make sure app is running as per instruction.
Container Runtime: Run app inside container, so it could be docker or containerd.
Kube-Proxy: It will manage all network between pods and other services.

Lets take an example if we run kubectl run myapp --image-my-app-image
Steps:
1. API server receive command and validate it
2. Schedular will decide which worker node should run container.
In case you want the image should run on your desired container use Pod Affinity.
3. controller manager will create a new object called pod.
4. ETCD will store pod info.
5. Kubelet on chosen node by scheduler gets notifed by schedular and ask docker to
run the container.
6. The app starts running inside container.
7. If someone wants to access app they can use KubeProxy.


2) What is PDB, Have you applied it.
: So, PDB is short Hand for Pod Distribution Budget.
In case you want to maintain cluster and keep it down so PDB is set to run minimum amount
of pods just to make application available to end users with zero downtime. Also it works
with voluntary disruptions only not with unexpected crashes. During maintenance it is used

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: my-app-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app: my-app


3) Explain the Role of the Kube-Proxy in Kubernetes.
: 3 steps--> service discovery --> load balancing --> network connectivity
so service discovery is like frontend service should talk to frontend pod so it maps
service.
load balancing will distribute traffic across multiple pod instances.
Network connectivity: ensuring seamless communication between service and pods.
Lets say there is one service name my-demo with Clusterip 10.0.0.1
okay and 2 pods are running on different nodes
so when a request comes to the IP
KubeProxy will check IP table rules,
it sees that my-demo service map 2 pods.
it select one pod based on round-robin or any random algorithm.
forward request to selected pods IP & port.

so in short, KubeProxy is nothing but bridge between Service and Pods.


4) How will you maintain security for Kubernetes
: 1. Used private networks like keep worker nodes in private subnets
2. Used RBAC role based access control to limited users.
3. Restrict API server to only trusted IP's
4. Define traffic rules between the pods.
5. Use tools like trivy to proactively counter any vulnerability
6. store sensitive data securely.
7. use proper logging tools to proactively get any alerts.
8. set memory limits to prevent resource exhaustion.

5) What is the role of the kube-controller-manager in Kubernetes
: So Kube container manages the desired state of cluster with current state.
some key controllers are:
Node Controller: monitor health of nodes. it detect any failure mark node as unhealthy.
and removes the pod from this node after timeout.
Replication controller: ensure desired number of pod replica are always up and running.
Persistent volume controller: manager persistent volume claims and binds them to available
persistent volume.
HPA controller: horizontal pod AutoScaler Controller, Automatically scales number of pods
based on CPU or memory usage.
Namespace controller: automatically deletes resource when namespace is created.
These are main controllers.


6) How will you handle and process data of excel workbook using python
: Never did but please let us know overview of how to handle excel files in linux as well and how to convert them to json to use

7) Python scripting for handling API requests
: Never did, if you can show any demo shell script it would be great.😊

rawvikrant
Автор

Thank you Sakshi, I am left with last round where they will test me with Python and Bash.. Is there any suggestion you can give me for prep ?

JaskaranSingh-iouj
Автор

linux interview qustion answer par ak video banayo

gurukirpa
Автор

In how many interviews they asked you about python scripting?

rahul_rg_
Автор

Hi @SakshiGautam-19 I am also trying to switch but my resume is not shortlisting, can you please share your resume template and tell us how to keep work experience and projects in resume

KaturiBhanu-rx
Автор

For freshers no calls and no response i applied more number of jobs in cloud and devops iam graduate bsc in 2024
If in case any calls means they asked how many years of experience u have if tell freshers ok if any openings for freshers we will get back to you thankyou that's it how? Can get job as a fresher

BhavithaE
welcome to shbcf.ru