What is kubernetes?
– Kubernetes is a tool developed by google to manage a high availablity of a application
– its is developed on a same genetics as borg and omega on which Google runs its higly scalable application
– in days when there is an intro to contanerised world and we were to spin up our infra / app using containers in a matter of sec for DEV & QA environments, there was a question to manage these containers in a complex environment like PROD
– Kubernetes comes in picture then and perfectly fits in this secenerio and manages the containers in a efficient manner including networking, securities aspects
Why Kubernetes?– There is a time when its difficult to manage a containers in a complex environment like PROD
– here comes the kubernetes which ease the infra complexity.
– it help to provide a highly scalable environment with a minimum downtime
– it also makes easier to establish the effective networking communications between the different nodes & pods.
How Kubernetes works?
Kubernetes has below main components in its architecture.
a. Apiserver : It is the main front end component of kubernetes.We can say its a bridge that is connecting all components within kubernetes it has many or all services of kubernetes which makes an API call according to the service type to get & send requests.
b. ETCD : its a database which stores all data in the form of key value pair.it has all the informations stored related to the kubernetes cluster
c. Controller: it is the component in master node which always keeps an eye for all services.it runs in a loop and always keeps track of service like nodes, endpoints, replicas etc .if anything is not up to date as per the required desired state it sends those infor to api server which inturns talks to etcd and scheduler.
d. Schedular: this component basically schedule all the required service as per the desired state .Apiserver when recieve anything from controller then it sends requests to schedular to schedule the jobs to the worker nodes.
a. Kubelet: its is the agent running on worker nodes to register them with the cluster.it serves the requests coming from scheduler via apiserver
b. container runtime: any contanerised tool like docker to run containers
c. kube-proxy : to estabilish a networking within kubernetes cluster
What is POD?– Pod is a tiny atomic object running on master/worker nodes to have running container
– it is instantiated when scheduler schedules anything
– each pod will get a unique IP and containers inside a pod may have different IP’s but in truth will have same IP of that pod- all containers inside a POD shares the same IP
– all containers within a pod can communicate via localhost
How certifcations based auth works ??
Write a diff between Create vs Apply and Put Vs Post and define IDEOMPOTENCY?
Kubernetes create will allow us to create objects in kubernetes and will throw error if the object is already present.
Kubernetes apply allow us to create a object if not present and update the existing objects without any error as in case of ‘create’.
What is diff between kubectl exec and kubectl attach ?
kubectl exec will allow us to run any process or execute any cmd witing a container.
While attach will be attached to the stdin,stdout,stderr of main process PID 1 of the running containers of that pod.
What is diff between docker exec and docker attach ?
Docker exec will allow to run any cmd , create a new process against the docker container and also to get into the intractive terminal of running container.
Docker attach will be actually attached to the stdin,stdout,stderr of main process PID 1 of a running docker container.
Define ReplicaSets with atleast 2 example :
Replicaset is the upgraded version of Replication controller. The only difference between replicaset & replication controller is in rc we dont have selector and in rs we have selector to match the labels of the desired pods in cluster.
What happen when you pause a deployment using rollout?
If a rollout process already started and if we pause this in between then it will be paused at that particular state itself (that can be observed in rollout status).
to continue with the rollout we need to resume it and then the rollout process will continue and a new revision number can be seen in rollout history.
What is a Deamonset? Explain with Example.