{"id":9030,"date":"2020-01-20T07:48:15","date_gmt":"2020-01-20T07:48:15","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9030"},"modified":"2021-11-13T07:06:03","modified_gmt":"2021-11-13T07:06:03","slug":"docker-interview-questions-and-answer-part-17","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-17\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 17"},"content":{"rendered":"\n<p><strong>If you run docker network ls and do not see a network that you&#8217;re looking for, what is the most likely culprit?culprit?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>That node is not a worker node.<\/li><li>That node is not a manager node.<\/li><li>You&#8217;re not authorized to see the network.<\/li><li><strong>That node doesn&#8217;t have a container running that uses that network. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What does &#8211;update-parallelism control?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The time between updating tasks<\/li><li><strong>The number of tasks updated at the same time (Ans)<\/strong><\/li><li>What to do when an update fails<\/li><li>Whether or not to update all tasks at once, or one at a time<\/li><\/ul>\n\n\n\n<p><strong>Which published port mode would you use to load balance requests across all containers for a service?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Host<\/li><li>None<\/li><li>Ingress<\/li><li><strong>Bridge (Ans)<\/strong><\/li><li>LoadBalanced<\/li><\/ul>\n\n\n\n<p><strong>If you only have a replicated service, what will happen when you add a new node to the cluster?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The pending task for the service will be assigned to the new node and a container will be started.<\/li><li>The existing containers for the service will be rebalanced so that a fair share are placed onto the new node.<\/li><li><strong>Nothing will run on the new node unless you change the service. (Ans)<\/strong><\/li><li>A new task will be allocated to the new node for the global service.<\/li><\/ul>\n\n\n\n<p><strong>If you want multiple containers for an application, what command is easiest to use to go from a service with one task replicas to two?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker clone \u2026<\/li><li>docker service rm; docker service create &#8211;replicas 2 \u2026<\/li><li>docker service scale \u2026<\/li><li><strong>docker service update &#8211;replicas 2 \u2026 (Ans)<\/strong><\/li><li>docker run \u2026<\/li><\/ul>\n\n\n\n<p><strong>On a swarm, if a container dies that&#8217;s part of a service, and a new container is created, what concept explains this?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>High Availability<\/li><li><strong>Desired State Reconciliation (Ans)<\/strong><\/li><li>Scheduling<\/li><li>Service Scaling<\/li><\/ul>\n\n\n\n<p><strong>What does the &#8220;*&#8221; mean in the output of docker node ls?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The nearest manager<\/li><li>The leader<\/li><li>A worker node<\/li><li><strong>The node you&#8217;re connected to (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Joining a node as a manager by default that node will perform <em>__<\/em> role(s).<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Manager only<\/li><li>Leader only<\/li><li><strong>Manager and Worker (Ans)<\/strong><\/li><li>Replica only<\/li><li>Slave and Replica<\/li><\/ul>\n\n\n\n<p><strong>Which of the following would you use to decrease the time between health checks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>retries<\/li><li>CMD<\/li><li>timeout<\/li><li><strong>interval (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Assuming you have a stack called APIS, what is the equivalent of docker service ls for stacks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker stack deploy<\/li><li><strong>docker stack services APIS (Ans)<\/strong><\/li><li>docker stack ps APIS<\/li><li>docker stack ls<\/li><\/ul>\n\n\n\n<p><strong>What happens to containers on a node that you drain?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>They&#8217;re shut down until you make the node active again.<\/li><li>They keep running, just no new work is allowed to be put onto the node.<\/li><li>They&#8217;re snapshotted and migrated to other nodes.<\/li><li><strong>They&#8217;re terminated and migrated as new containers on other nodes. (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Assuming you have a service named web, what will the dns query tasks.web return?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The Swarm Load Balancer<\/li><li><strong>Individual container IPs for the web service (Ans)<\/strong><\/li><li>The web service&#8217;s Virtual IP<\/li><\/ul>\n\n\n\n<p><strong>What does &#8211;update-delay control?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What to do when an update fails<\/li><li>The number of tasks updated at the same time<\/li><li><strong>The time between updating tasks (Ans)<\/strong><\/li><li>Whether or not to update all tasks at once, or one at a time<\/li><\/ul>\n\n\n\n<p><strong>What command do you use to create containers on a swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker service create (Ans)<\/strong><\/li><li>docker swarm run<\/li><li>docker run<\/li><li>docker-compose up<\/li><\/ul>\n\n\n\n<p><strong>Which of the following has a one-to-one relationship with a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Task (Ans)<\/strong><\/li><li>Service<\/li><li>Image<\/li><li>Swarm<\/li><\/ul>\n\n\n\n<p><strong>What can you put in front of a swarm so that end users don&#8217;t have to pick a node, nor deal with node failures, to access a service with a published port?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Round Robin DNS to all nodes<\/li><li><strong>Load Balancer to all nodes (Ans)<\/strong><\/li><li>Single DNS entry to one node<\/li><\/ul>\n\n\n\n<p><strong>When no nodes in the cluster fulfill the constraints of a service, what is the status of the service?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Failed<\/li><li>Running<\/li><li><strong>Pending (Ans)<\/strong><\/li><li>Started<\/li><\/ul>\n\n\n\n<p><strong>What does &#8220;starting&#8221; mean in terms of health checks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The health check has not yet run for a new container. (Ans)<\/strong><\/li><li>This shows each time the health check runs to indicate that it is starting. <\/li><li>The health checking service is starting up and is not ready to run health checks.<\/li><\/ul>\n\n\n\n<p><strong>What happens when Docker Swarm Mode detects an unhealthy container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Restarts the container<\/li><li><strong>Shuts the corresponding task down and starts a new one (Ans)<\/strong><\/li><li>Nothing, health checks are not integrated into Swarm Mode.<\/li><li>Sends an email to the system operator<\/li><\/ul>\n\n\n\n<p><strong>Which of the following would you use to avoid recreating a task on a recoverable application failure?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>retries (Ans)<\/strong><\/li><li>timeout<\/li><li>interval<\/li><li>CMD<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_71606\"><iframe loading=\"lazy\"  id=\"_ytid_88344\"  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_71606\"  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 class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>If you run docker network ls and do not see a network that you&#8217;re looking for, what is the most likely culprit?culprit? That node is not a worker node. That&#8230; <\/p>\n","protected":false},"author":1,"featured_media":10439,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-9030","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9030","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=9030"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9030\/revisions"}],"predecessor-version":[{"id":25051,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9030\/revisions\/25051"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/10439"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}