Kubernetes Scenario Interview Questions | Kubernetes Interview Questions and Answers for Experienced

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey folks I'm back and this is the first video in this series uh this is the new series that I have started which you already know about and as I told that in the previous interviews which I took uh I have started reaching out to everyone whom I have interviewed and I'm getting their permission and I'm getting their consent so uh this is the first win in the series and I remember if I remember correctly uh the person I interviewed uh has given two to three rounds and I have all the recordings on my channel for this so I'll be working on them uh reframing them making a bit change in in the voices so that uh you cannot recognize and this person was on kubernetes so exactly uh kubernetes questions and nothing else on these questions so this is the one thing that I've started again and I'm going through all the videos I'm filtering out everything and if I won't be able to get the permission from the person who I have interviewed I won't be posting that so this is the person who has given me uh the permission and I think I have one or two more interviews of her alright so uh I have again used the same video and from when this video will jump cut you will see the older recording all right so uh yeah that's about it so let's jump into that recording hey folks my name is ravish and welcome back to another video in the series of devops interviews now the interview that I have taken today this is one of the best interview that I have ever taken and this uh this person is having around four years of experience in devops and four years of experience in it and four years of experience in Cloud so she has started her career in devops only as a fresher and then she was an amazing candidate and this was the second round and we were looking for someone who is well versed in kubernetes so the whole interview is a concentrated on kubernetes we have asked a few scenario based question we have asked a lot of questions around 15 to 20 questions and this interview is dedicatedly on around 30 minutes for the kubernetes part and hands down this is the best interview one of the best interview I have taken in recent times the candid new candidate knew almost all of the things I mean in my in the course of around 10 15 20 questions there was only one question that she was not aware about apart from that everything was perfect and on point so uh kindly take take a look at this video and learn take out your pen and paper learn from it and write down all of these questions and because they're going to help you in the future all right so uh again Watch the video till the end and subscribe to the channel because it really motivates me to create more content like this so without further Ado let's get started [Music] thank you hi good morning hi good morning how are you today uh I'm fine how about you I'm good I'm good so um can you please uh give me a brief introduction about yourself okay uh so I'm graduated from the IT University uh in 2018 with 9.2 cgpa and then I got campus placement in one of the product based company and there I worked for two years I have worked on some of the Technologies like I have worked on Jenkins bash bass printing I have also learned some python there and then after two years I shifted to another company that is almost like service based company there I basically worked on uh some that cubes and I have also created an environment from scratch like one of the QA environment and yeah and now currently I'm on in one of the another product based company and there I am as Cloud operation engineers and my main role is to like uh look into infrastructure and the main application on which I'm uh working is kubernetes and along with kubernetes I am working on grafana Loki Prometheus yeah these kind of things but basically on kubernetes okay okay okay um so your total years of experiences uh yeah sorry uh my totally of experience is four years four years okay and how much in Cloud same four years great I have worked on Azure devops basically that's your initiative Ops okay and then devops how much oh you started a career as a devops yeah okay I mean it's very rare to find people who have started their career as a devops but yeah great uh okay so I uh I have gone through your resume and it looks really good and this is the second one and I have got really good uh uh the person who took your interview uh gave a good feed feedback okay so uh as you have gone through the JD uh we are looking for someone who is good in a lot of things or someone who has worked on Azure devops he already know about it Azure and the main thing is that our application uses uh uh kubernetes a lot so as the HR conveyed the same that this would be strictly on kubernetes uh not much uh I mean not more than 30 40 minutes of interview but this would be highly concentrated on kubernetes only all right okay okay so uh I'll start with the scenario based question okay consider a company uh build some kind of Monolithic architecture that handles a lot of products okay now company is expanding and today today's industry is scaling so companies is expanding and then monolithic uh architecture started causing problems so uh how do you think the company should shift it from monolithic to microservices and how to how do they deploy their containers how can they Implement kubernetes in it so I hope you are aware about monolithic and microservices architecture right all right right okay great so uh how do you think that company should shift from monolithic to microservice and how can they Club kubernetes in it okay so first of all I want to share light on microservices so it isn't distributed and losing coupled applications like different applications are only coupled it's not same in modulating so it will help the team to change and don't break the entire app when we are moving from uh one it's like from one server to different servers so for that we can use orchestration tool which is the kubernetes platform so they can start by migrating their services once or twice and monitor them to make sure that everything is running stable and if everything is working fine we can migrate using kubernetes cluster so basically uh the solution of all these is using kubernetes okay so uh you folks are implementing it or uh your seniors or the whole team uh no like our work is basically monitoring a kubernetes cluster and everything is created but if we have to like CPU memory is the full so we can change the memory values like recently I was working on something and it was not getting up so we had to change the replica set so we do these kind of things okay okay great we'll talk about that uh later okay uh can you explain me the uh kubernetes architecture uh yeah so kubernetes mainly consists of two components we can say one is Master node and the second one is uh worker node so in masternode itself there are four components one is called Cube control manager Cube API server and one is cubic scheduler and etcd so by the name we can understood from control managers first of all it is inside Master node so it manages the multiple process which are running on a master node and it is combined all the processes together and the let in let inform uh Master node that what's happening so it basically manages all the processes that's why it's called control manager second one is API server qbi server so it act as front end of Master node so it exposes all the API of kubernetes to master node component and is responsible for like creating communication between Master node and worker node and third one is scheduler so again from name we can understand that it schedules like work for the worker node as it is inside masternode so it will schedule work for different worker nodes that's why it's called scheduler and the last one which is inside masternode is etcd so it is written in go programming language and it's basically key values to stores like there will be some key like username and password so if we have to store it in this it inside kubernetes then we'll mainly store it inside etcd okay so these are four components which are for masternode and there it again come worker node so inside open node we have two component one is called cubelet and the second one is called Q proxy so cubelet is again primary node for worker node and it runs for each of the nodes and Q proxy is a network proxy that again run on each of the nodes and implement the services which will come from masternode so yeah this is the basic architecture okay great great great um so uh so there is something known as docker's form have you heard about it yeah it is a container orchestration tool yeah just like just like kubernetes so uh like as a let's say if you if you are in a position to take decision uh why should I choose kubernetes and why shouldn't I go with a Docker swamp yeah so earlier uh Docker Swan came it like people used to work on that but there are some drawback which is available in Docker form that's why which ways to kubernetes uh first of all it's very simple to install Docker swamp we can't deny the fact but if the cluster is not robust while setting up the cube and it is very complicated but once you like set up that thing that kubernetes then it's very easy to work on that and the cluster is robust second thing is like in kubernetes we can do auto scaling like we don't have to go and check manually if we have to Auto scale uh even why right now I'm working on kubernetes so if some quad diet will automatically create new one we don't have a tension or in back of mind okay we have to go and change it but that's not the case and don't perform and again in kubernetes we can deploy a rolling update and it will automatically do rollbacks but that is not again not in the case of DocuSign we have to do it manually and one best thing uh which I think in kubernetes is like we have tools for logging and monitoring like we can connect with Prometheus and all in kubernetes but that is not the case in Dr we have to use external tools but in you can uh sorry kubernetes it's not there there is already built into level for logging and monitoring so okay so what is that built-in built-in tool uh like we can integrate uh kubernetes uh sorry from atheists grafana Loki for logging and monitoring in kubernetes okay what is this Loki I've never heard about it uh it's a logging tool like uh in grafana after the dashboard and then we have integrated Loki and it will take the logs like if I want to take a log of seven days what's happening on particular cluster then we have to go in Loki and it will show us all the logs available there like for past 10 days 30 days 10 hours whatever time you want you can see there in grafana dashboard okay okay great learn something new today okay so uh based on the first question uh I'm just uh curious about it uh the monolithic and the microservices architecture that you have worked on so uh see all of us uh know that uh that microservices will solve the problem right and for the development side people will write their own services but don't you think that uh when you as a devops engineer when you do the deployment right so it can increase the problem for you folks so how can you or your company or organization solve this problem on the deployment side okay uh so like again uh the same thing we can say the solution is again the kubernetes only uh so the company can generate a templated application and deploy it within five minutes and the actual instances which got created uh will be used in kubernetes like the project kubernetes project have dozens of micro Services running in parallel which is not available in docker.com again that's the benefit of losing kubernetes so we can run dozen of uh microservices in parallel which will improve the production rate and even if a node goes down as I informed earlier only like it can uh do rolling update rollback so even if like there is a lot of pressure on one particular load it will it will go down or if it will die by any means the new node will get up and it will work so it will reschedule immediately without uh impacting the performance so in this way it will be helpful for devops guy like we don't have to go and check manually uh kubernetes is doing our work by using a rollbacks or deploy rolling deployments okay have you ever done that like or like it does it automatically kubernetes does it automatically no it's the uh it do it automatically like we don't have to do anything I have seen it happening like okay if I kill any part it'll start automatically I don't have to go and update it like make it up okay so kubernetes is intelligent enough you're saying yeah okay great great um so uh what are all the services that you have uh worked on kubernetes and can you explain a few of them uh yeah I haven't like I have theoretical knowledge about the services available in kubernetes but practically I haven't got chance to work as of now on any service but I have not not even a single service uh no as of now like I know but like I have seen It's Already Done their load balancer is one of the services which we are using but I haven't done anything in that so but they are basically four type of services and kubernetes uh first one we can say cluster IP it basically exposes the services on the cluster internal IP and the note Port it it again the same thing but it exposes service on the basis of nodes it explores a service on nodes IP like one is cluster then there is a node so like that and the third one is load balancer so it again from name we can understand it exposes the services and help in load balancing to the cloud providers oh load balancing for what actually services okay okay yeah and the fourth one external name it will help to map the services to the content of external name field by returning a c name record so again what is cname record uh it is basically like it helped to map The Domain one domain to another domain that that senior record so these are the four services available okay okay uh okay so consider your company only okay now uh so your manager your technical manager uh wants to optimize the distribution of the workloads okay and you folks are not using uh your you let's say you are on some Legacy systems or something okay so how can I use kubernetes over here to achieve the distribution of resources efficiently so again I don't think how in the solution of this question is again kubernetes only and it is uh like that much intelligent it will be able to shift like as it has service with the name of load balances so it will automatically uh balance whatever work is coming on on any particular node if one again I have already informed if one node has so much of the pressure so much work that is getting killed or some health issue regarding to that particular node it's not working so uh it will get killed and the new node will get up or New Port will get created and the uh work may get distributed so again the solution is kubernetes only it act as an orchestration tool which will be used for distribution of workloads and it will do it automatically it's intelligent enough okay so you were talking something about a load balancer right so what do you understand by load balancer in in terms of kubernetes only okay so yeah so when load balancers they are two type of load balancer again one is internal and the external load balances so internal load balancer automatically balances loads and allocates the ports with the required configurations so internal means like inside node there are many ports so if if in what like there's two node node a and node B and we have to distribute work inside node a and inside load a they are 10 parts available so the work of internal load balancer will be to allocate the ports with different configuration their assign particular work and in external load balancer it directed the traffic coming from external load to the back end ports so like from name we can understand what's happening in external load balancer uh to work is distributed between nodes and in internal load balancer the work is distributed between Pawns in one in particular one nodes okay okay okay okay okay uh have you ever heard about uh an application known as quick ride yeah uh so it was basically a carpooling uh right okay so consider uh SRE team okay now they want to increase the number of servers okay and they want to this simultaneously scale their platform how do you uh think that your organization or you can suggest that the company will deal with the servers and their installation and everything how how can kubernetes be helpful over here yeah so again the solution is continuation and orchestration so once they use kubernetes for orchestration or Android monitoring tool like committees to monitor the action of their container that will be helpful so with the use of container it will give them better capacity planning in their Data Center and yeah by using kubernetes they can see uh what's going on and using Prometheus to monitor the actions of their containers so in this way they can okay so you have worked on Prometheus as well right all right yeah the book Prometheus and grafana yes so uh are they clubbed together or they are both separate entities uh in in your organization uh no no they are separated uh in my current online matchup from atheists we are more concentrated on grafana and Loki grafana and Loki okay okay okay okay okay uh what do you understand by our namespace in kubernetes yeah so like before like practically working on kubernetes it was really difficult and and confusing for me to understand what his name is like I was not understanding but when now I'm working practically I am getting to understand how useful it is okay and so it is used for uh dividing cluster resources between multiple users like I am a person I am working on something and I want a particular cluster only for me only I can access that I am doing some POC I'm not doing some real work so I'll create first of all I create a namespace there's a command for that to create a name space uh Cube CTL create minus n and then whatever name you want like if I am creating namespace for Prometheus uh sorry I am creating a cluster for Prometheus so I'll create a namespace with the name monitoring that will be helpful right so while doing POC I'll do Cube CTL create minus n minus n represent namespace monitoring so one name space will get created with the name monetary and inside that I'll create a cluster with any name probably yes for example and inside that there will be loads and costs available so when I am doing POC if only I can see and I have given the access that only I can see that particular namespace so I'll go and work there so in that particular namespace means like a workspace thing there only I'll go I'll do my work no other person can go and check into what is available in that particular name space even if they click on namespace they'll see no Bots or no uh cluster available it will be blank for them so it's a particular workspace that is assigned to me only so in this way namespace is useful it helps to divide the resources between multiple users and we can also use namespace for different environments like for Dev environment one particular set of name space available which is only will be available for Dev environment not for production one so in this way it has been bifurcation okay okay okay okay uh what is the purpose uh what is the purpose of operator uh in kubernetes so yeah I have recently learned this and it's a really cool feature available only in uh kubernetes okay so uh yeah so it provides a capability of managing the application and their component using a term called custom resources again like before using operators uh we used to like if I want like if I want open search open search is again to get the logs uh earlier we used to call it elasticsearch but then Amazon AWS actually uh copied the elasticsearch thing and you and they said that it's their copyright then they have created elastic set but it's not like that so there was some conflict happened and then decorated there they have the copy of elasticsearch only but they have taken their own copyright and changed its name to open search change their name to open search yeah like elasticsearch is used to take the logs okay so that is the elastic search is different entirely different thing different company and they have created elasticsearch okay and if it's open source everyone can use it like so dark okay okay but but AWS was also using that but they were not giving proper credit to elastic such company which was using it okay they were taking it at their own tools then some problem happened between these two company and last and Amazon AWS has created their own elasticsearch thing exactly similar the one we used before and named it as open search and then said okay it's my own my entity like I have created it okay okay yeah so yeah so that is open search we so now like as of now in my company we are using open search we are not using elasticsearch although both are typically same in the base is same yeah yeah so now like I am giving example like when we use open search like if I have to create open search we usually go to helm charts it's like a get repository thing only and uh we can create we have to go and manually run some set of commands and then your open search cluster will get created but now we have a solution in kubernetes we have operators and what that operator do it will it will help to automate the deployment like all the things which we require to create open search will automatically created by operator we don't have to go manually and run uh run each and every resources is the work of open operator it will get to know whatever things are required to deploy open search it will download it and it will create it okay so yeah so that is operator's main purpose I guess okay okay uh so in the last uh question you answered something related to sonar Cube so you have must have worked upon sonar Cube as well right not exactly what people say are part of security and there is a term known as devsecops right yes you must have heard about it uh yeah in my current company our project is okay okay great um so let's talk about the security then uh so what are the various things uh that you can do uh to increase the security in kubernetes okay so as they already know like by default we know that that for security reason we have to limit it that the point don't communicate material like all parts don't communicate with each other they are generally for security reasons so we have to set up some Network policies to limit this communication between parts and there are some ways by which we can do that the first of all first one we can say is our back role-based access controls like to narrow down the permission uh which part can access which or access or communicate to which other part and the second one the I already informed you about name spaces we can create different name spaces and we'll give permissions like okay that in the second like in one name is this for example namespace a has some Bond they can't have access to uh communicate with namespace in Part B name face B so we can bifurcate using namespaces and the third one is to create policies like we have some privileged containers like we'll give policy that this particular container is previous one and all part cannot communicate to that and the fourth one which is uh normal one is turned on audit logging so these are some of the way which we can by which we can limit the communication between our pods and which indirectly uh increase the security of kubernetes okay so have you ever uh worked on this um pipelines uh uh have you ever integrated your pipelines with sonar Cube for the security part as well so what was the CI that you folks were using or the CI tool I got a box I I was working on okay okay okay okay okay no problem let's Circle back um so you were talking about uh logs a lot uh that you folks were using Loki and Prometheus and grafana so if I want to get the central locks from any part how do I do that it depends really on many factors so I which we use as of now in my company is like using node level logging agent which will give us information on node levels like we'll get logged there and as I've already informed we are using a graphana dashboard there and like if I want to get information for past 7 days past eight days we can go and get one dashboard and we have integrated it with kubernetes and we can get written there and the third one we can say is streaming sidecar containers I'm sorry what what streaming Sidecar sidecar container okay okay and we can again we can like this one is easy one which we can directly also export logs from the application like even if we go on kubernetes there's a like in the Pod we have three dots they're available at the last and from where we can get the logs and we can export it directly also in our system so yeah in this way we can get the logs okay okay uh what do you understand by Ingress uh default backend uh okay so it specifies uh what to do with the incoming requests to the kubernetes cluster that isn't a map to the back end like uh if there's no rule defined like what do we do and done if some incoming HTTP request is there and there's no rule defined what to be uh like on which node or in which Port we have to schedule that request in that case uh in case before backend will come into use and it will specify where we have to uh divert or send that incoming request uh yeah so but it is recommended to Define it okay so you folks uh have you ever done it or like your senior or something or someone some someone from the team uh no I don't know uh but yeah we get the clear message so I guess someone has done but if you haven't done you will get some unclear message and will not understand what's happening but as of now if any such kind of incident happen we'll get clear message okay this is happening so I get some some of the senior has done but not in like when I came I don't know that okay okay okay fair enough fair enough okay uh let's say um uh you have a junior in your team who is very new okay and he who is very new in terms of kubernetes okay and he doesn't know much about it so his spot is not getting scheduled or something okay and he comes to you so like how would you how do you tell him that or her that how to troubleshoot it yeah so first of all there can be many reasons that can lead to unstartable quads so like first we should go and like check the logs and see what the issue happening but once we know the issue then only we can solve that so the command we can use to see what's happening in particular pod which is not getting started is like we have to use command Cube CTL describe particular quad which is not running we have to write the name again we have to specify the name space in which it's not it's running so minus n and the name space name so once you write Cube CTL describe pod and the name case you can see the reason why quad's not starting and according to that there can be many reason why Ford's not starting like uh as I said today only like like there are two two ports only available so a memory is gone so ircpu like only two CPU is given for a particular part so first we'll do this describe what then we'll get to know okay how many uh how much memory it's taking how many CPU assigned to that and we can change it like it's not working we can how many replicas that assigned it two is assigned we can change to ten if memory is yes we can change it so there can be many reasons but the most like I'll suggest first do this command see what what the issue is and follow it accordingly and then come back to you yeah okay okay okay um so is there any way uh to provide external network connectivity to to kubernetes okay I'll just uh reiterate the question uh is there any way to provide external network connectivity to kubernetes uh yeah it is there but right now I'm not able to recall that okay okay no problem no problem okay uh so this would be uh my last question for today uh how can we forward the port 8080 and consider this uh in a container okay to a service and then to a Ingress and then to a browser okay let me just reiterate it container to service to Ingress to the browser everyone is using eight zero eight zero as a port but browser is using eight zero how can we do this and I'm telling you it's possible how can we do it okay so uh the increase is exporting exposing Port 80 externally from the browser to access and to connect to a service that listens on 8080 okay so the interest will listen to Port 80 by default so as an Ingress controller it is a port that receives external traffic and handle the Ingress and is configured in the English resources so for this uh I guess we need in this selector which will help us to forward uh these upwards yeah I'm not sure but I guess it will like in in this controller will help in this okay okay fair enough fair enough um yeah I think I'm done do you have any questions for me uh yeah so uh what is the role of role of devops engineer there and uh how much work is on kubernetes in your company as of now okay so uh right now uh first of all this position that we are looking for is not on my project so if you will get selected you won't be working in my project uh we are recruiting for some other project and it's heavily based on uh kubernetes so probably we'll be using either uh we have not decided yet so that's where you folks come in uh there are few people we still need to hire and then we will be deciding either we have to go with AKs eks or something else and um we might do a POC on something that what is better for the application so I might be a part of it but I'm not the part of project that's for sure so uh I think this is your second round so uh okay so uh yeah we would be using kubernetes that's for sure but uh how are we dealing with it and how are we implementing it that's not decided yet so that's where new folks and The Architects come in okay all right thank you uh did I did I answer your question [Music] okay okay okay thanks a lot uh then the HR will come back to you okay bye have a great day ahead bye
Info
Channel: LogicOps Lab
Views: 52,642
Rating: undefined out of 5
Keywords: kubernetes interview questions and answers for experienced, kubernetes interview questions, kubernetes interview questions and answers, kubernetes, devops kubernetes, devops kubernetes interview questions, kubernetes scenario based questions, kubernetes scenario interview questions, kubernetes troubleshooting scenarios, kubernetes scenario based interview questions, devops kubernetes project, kubernetes questions and answers, kubernetes questions, kubernetes interview
Id: 0d2yHFjuZsA
Channel Id: undefined
Length: 33min 47sec (2027 seconds)
Published: Thu Jan 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.