{"id":8763,"date":"2020-01-15T07:10:54","date_gmt":"2020-01-15T07:10:54","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=8763"},"modified":"2021-11-13T11:32:43","modified_gmt":"2021-11-13T11:32:43","slug":"kubernetes-interview-questions-and-answer-part-8","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/kubernetes-interview-questions-and-answer-part-8\/","title":{"rendered":"Kubernetes Interview Questions and Answer Part \u2013 8"},"content":{"rendered":"\n<p><strong>What is the primary application transport mechanism for the Kubernetes API Server?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Server side RPC calls<\/li><li>Javascript over WebSockets<\/li><li>TCP multiplexing over HTTP\/S<\/li><li><strong>JSON Over HTTP\/S (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Objects in the Kubernetes API are organized by which following methods?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Kind, Group and API Version  (Ans)<\/strong><\/li><li>etcd\u2019s concurrency model<\/li><li>Object level resourceVersion<\/li><li>Key value store<\/li><\/ul>\n\n\n\n<p><strong>Which kubectl command will retrieve the definition\/documentation for an API Object from the API Server?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>get document<\/li><li>&#8211;objectName<\/li><li><strong>explain (Ans)<\/strong><\/li><li>get object  <\/li><\/ul>\n\n\n\n<p><strong>As new API Versions become available what is the release cadence?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Alpha -&gt; Beta -&gt; Stable (Ans)<\/strong><\/li><li>Versioning<\/li><li>Stable &#8211; &gt; Production -&gt; Primary Release<\/li><li>Release<\/li><\/ul>\n\n\n\n<p><strong>If you needed to assign workload to a subset of nodes in your cluster, what method would you choose so that you are not dependent on the Node names in the cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Annotate the nodes and use a hardwareSelector in your Pod Spec<\/li><li>Annotate the nodes and use a namespace in your Pod Spec<\/li><li>Label the nodes and use a nodeSelector in your Pod Spec    <\/li><li><strong>This is not possible in Kubernetes due to it\u2019s declarative model for deployments (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following will remove the label disk from a node?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>kubectl label node c1-node2 disk<\/li><li>kubectl relabel node c1-node2 disk-<\/li><li>kubectl label node c1-node2 disk-<\/li><li><strong>kubectl remove label node c1-node2 disk (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the primary function of a Controller in Kubernetes?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Running bare\/naked Pods<\/li><li>Migrating Pod workloads to the Cloud<\/li><li>Migrating Pod workloads between Nodes<\/li><li><strong>To keep your application in the desired state (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the primary design goal for using multi-container Pods?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Scaling stateful containers<\/li><li><strong>Tightly coupled applications (Ans)<\/strong><\/li><li>More flexible recovery options when restarting Pods<\/li><li>Scaling stateless containers<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the appropriate order of a Pod\u2019s lifecycle?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Creation -&gt; Running -&gt; Restart<\/li><li>PodSpec -&gt; Running -&gt; Termination<\/li><li>Kubectl run -&gt; Running -&gt; Termination<\/li><li><strong>Creation -&gt; Running -&gt; Termination (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which container restart policy will restart a container only on a non-zero exit code?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>OnFailure (Ans)<\/strong><\/li><li>Never<\/li><li>OnNonZeroExitCode<\/li><li>Always<\/li><\/ul>\n\n\n\n<p><strong>For Kubernetes API Objects that were part of the initial releases, which API Group are they in?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>They\u2019ve been refactored into their appropriate API Groups<\/li><li>Fundamental<\/li><li>Workload<\/li><li><strong>Core\/Legacy (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is the primary way to subdivide a cluster on the basis of resource isolation and\/or organization?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Namespace (Ans)<\/strong><\/li><li>Label<\/li><li>Annotation<\/li><li>Subclustering\/Federation<\/li><\/ul>\n\n\n\n<p><strong>What is the primary way in Kubernetes to execute a command on a grouping of resources based on using a selector?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Annotations<\/li><li><strong>Labels (Ans)<\/strong><\/li><li>Querying<\/li><li>Namespaces<\/li><\/ul>\n\n\n\n<p><strong>What is the primary way to store information along with your resources in the cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Annotations (Ans)<\/strong><\/li><li>resourceNotes<\/li><li>Labels<\/li><li>Namespaces<\/li><\/ul>\n\n\n\n<p><strong>Which of the following will return the pods whose label is app=prod?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>kubectl get pods -l app=prod (Ans)<\/strong><\/li><li>kubectl get pods -l app&lt;&gt;prod<\/li><li>kubectl get pods -l prod<\/li><li>kubectl get pods -l app!=prod<\/li><\/ul>\n\n\n\n<p><strong>What is the primary unit of allocating work in a Kubernetes Cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Manifest<\/li><li><strong>Pod (Ans)<\/strong><\/li><li>Deployment<\/li><li>Container<\/li><\/ul>\n\n\n\n<p><strong>What is the primary function of a Controller in Kubernetes?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>To keep your application in the desired state (Ans)<\/strong><\/li><li>Migrating Pod workloads to the Cloud<\/li><li>Migrating Pod workloads between Nodes<\/li><li>Running bare\/naked Pods<\/li><\/ul>\n\n\n\n<p><strong>When using kubectl exec, a connection is first made to what cluster component prior to sending the command to the Pod?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The Controller Manager<\/li><li><strong>The API Server (Ans)<\/strong><\/li><li>The Scheduler<\/li><li>The Kubelet<\/li><\/ul>\n\n\n\n<p><strong>Which type of container probe will restart your container on probe failure?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>livenessProbe (Ans)<\/strong><\/li><li>SIGTERM<\/li><li>readinessProbe<\/li><li>SIGKILL<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_59564\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_85193\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_59564\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><\/div><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>What is the primary application transport mechanism for the Kubernetes API Server? Server side RPC calls Javascript over WebSockets TCP multiplexing over HTTP\/S JSON Over HTTP\/S (Ans)&#8230; <\/p>\n","protected":false},"author":1,"featured_media":12761,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4859],"tags":[5676,4860,5677,5117],"class_list":["post-8763","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes","tag-api-server","tag-kubernetes","tag-kubernetes-cluster","tag-pods"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=8763"}],"version-history":[{"count":4,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8763\/revisions"}],"predecessor-version":[{"id":25119,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8763\/revisions\/25119"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/12761"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}