{"id":374,"date":"2020-01-21T01:15:14","date_gmt":"2020-01-21T01:15:14","guid":{"rendered":"https:\/\/bootstrap-it.com\/blog\/?p=374"},"modified":"2020-01-21T01:15:14","modified_gmt":"2020-01-21T01:15:14","slug":"a-simple-introduction-to-kubernetes-container-orchestration","status":"publish","type":"post","link":"https:\/\/bootstrap-it.com\/blog\/?p=374","title":{"rendered":"A Simple Introduction to Kubernetes Container Orchestration"},"content":{"rendered":"<div id=\"s-share-buttons\" class=\"horizontal-w-c-circular s-share-w-c\"><a href=\"http:\/\/www.facebook.com\/sharer.php?u=https:\/\/bootstrap-it.com\/blog\/?p=374\" target=\"_blank\" title=\"Share to Facebook\" class=\"s3-facebook hint--top\"><\/a><a href=\"http:\/\/twitter.com\/intent\/tweet?text=A Simple Introduction to Kubernetes Container Orchestration&url=https:\/\/bootstrap-it.com\/blog\/?p=374\" target=\"_blank\"  title=\"Share to Twitter\" class=\"s3-twitter hint--top\"><\/a><a href=\"http:\/\/reddit.com\/submit?url=https:\/\/bootstrap-it.com\/blog\/?p=374&title=A Simple Introduction to Kubernetes Container Orchestration\" target=\"_blank\" title=\"Share to Reddit\" class=\"s3-reddit hint--top\"><\/a><a href=\"http:\/\/www.linkedin.com\/shareArticle?mini=true&url=https:\/\/bootstrap-it.com\/blog\/?p=374\" target=\"_blank\" title=\"Share to LinkedIn\" class=\"s3-linkedin hint--top\"><\/a><a href=\"mailto:?Subject=A%20Simple%20Introduction%20to%20Kubernetes%20Container%20Orchestration&Body=Here%20is%20the%20link%20to%20the%20article:%20https:\/\/bootstrap-it.com\/blog\/?p=374\" title=\"Email this article\" class=\"s3-email hint--top\"><\/a><\/div>\n<p>In the beginning there was the FreeBSD &#8211; and later Linux &#8211; chroot jail. Chroot was a way to bring an unmounted file system to life so you could execute commands as though it was actually running on its own host. Then came the Linux Containers project (LXC and LXD) that added network and storage configurations to run jails (now more commonly called containers) within appropriately isolated and optimized environments.<\/p>\n\n\n\n<p>And then there was Docker. Docker containers streamlined container operations so that software resources used by multiple containers could be efficiently shared. They also added online public repositories populated by vast collections of software tools. But the real value of Docker was in how easy it made deploying reliably predictable application environments.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-kubernetes-brings-to-the-table\">What Kubernetes Brings to the Table<\/h3>\n\n\n\n<p>Then, out of the mists of time appeared Kubernetes. While originally developed within Google, Kubernetes has since been released as open source software under the control of the Cloud Native Computing Foundation.<\/p>\n\n\n\n<p>At its heart, Kubernetes manages containers just the way Docker does. But Kubernetes adds a vast ecosystem of scaling, load balancing, network proxying, and multi-node administration tools to the mix. Docker\u2019s own Swarm comes with a comparable suite of tools, but Kubernetes has, so far at least, proven far more popular.<\/p>\n\n\n\n<p>Kubernetes is much more of a native enterprise-scale tool than Docker Swarm. It&#8217;s not that Docker Swarm can&#8217;t be used in the enterprise &#8211; it certainly can &#8211; it&#8217;s that Kubernetes isn&#8217;t necessarily such a great fit for a quick and dirty local development environment. The main reason is that, at this point at any rate, you need an existing cluster before you can get anything to happen, and creating a local cluster requires a running hypervisor of one flavor or another. So having a public cloud like AWS where you can freely provision all the bits and pieces that go into a cluster without having to worry about infrastructure, matters more for Kubernetes than it does for Docker in general.<\/p>\n\n\n\n<p>Kubernetes&#8217; larger resource footprint and steeper learning curve can be offset by some impressive integration: working with persistent storage volumes is straightforward. And robust deployment monitoring solutions are easily available.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a-quick-look-at-the-kubernetes-cluster\">A Quick Look at the Kubernetes Cluster<\/h3>\n\n\n\n<p>Here &#8211; based on content from&nbsp;<a href=\"https:\/\/pluralsight.pxf.io\/nZgKx\">my Pluralsight course, \u201cUsing Docker on AWS\u201d<\/a>&nbsp;&#8211; is how Kubernetes works. A cluster is made up of the networking, storage, and compute resources that your workloads will use. The cluster&#8217;s physical or virtual computers &#8211; called nodes &#8211; serve as either masters or slaves. A master runs the services that manage all cluster operations. The master itself is managed through the kube-apiserver service which responds to instructions you send to it using the kubectl client software. The master also hosts:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u2022 A database of cluster configuration known as etcd<br>\u2022 kube-controller-manager, that measures the current state of a cluster<br>against its desired state<br>\u2022 kube-scheduler, which balances configuration specifications against avail-<br>able resources<br>\u2022 The cloud-controller-manager that provides critical integration with public<br>cloud providers like AWS<\/p><\/blockquote>\n\n\n\n<p>Nodes are controlled by software agents called kubelets and maintain reliable and secure network connectivity through the kube-proxy service. Important stuff &#8211; your actual application workload &#8211; happens on the nodes within pods, which are organizing structures within which the application containers themselves run. Multiple containers can run on a pod, all sharing a single IP address and compute resources &#8211; providing a single instance of your application.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.freecodecamp.org\/news\/content\/images\/2019\/10\/cluster.jpg\" alt=\"\"\/><figcaption>The components of a typical Kubernetes environment<\/figcaption><\/figure>\n\n\n\n<p>The good news is that the kubectl software is smart enough to simply read your YAML configuration document and use it to bring all the details to life without your help. If you want to become a successful Kubernetes admin you really should understand all these details. But you can be forgiven for being a bit relaxed about it all in the meantime: most of the action takes place invisibly, hidden by the relatively simple command set we&#8217;ll soon see.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a-quick-kubernetes-installation\">A Quick Kubernetes Installation<\/h3>\n\n\n\n<p>Just so you can&#8217;t say I didn&#8217;t show you anything practical here, let&#8217;s install the lightweight Kubernetes version, MicroK8s, on a Linux machine. All you&#8217;ll need for this in-and-out exercise is a working copy of the Snaps package manager. This single command will install all the core services, libraries, and binaries necessary for small, proof-of-concept demos.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>snap install microk8s --classic<\/code><\/pre>\n\n\n\n<p>Just to prove that the installation succeeded, ask the service to list all the nodes<br>that are currently running. Of course, there won\u2019t be any of those yet.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo microk8s.kubectl get nodes\nNo resources found.<\/code><\/pre>\n\n\n\n<p>There will, however, be a single service with a private IP address associated with<br>it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo microk8s.kubectl get services\nNAME         TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE\nkubernetes   ClusterIP   10.152.183.1   &lt;none>        443\/TCP   80s<\/code><\/pre>\n\n\n\n<p>Finally, you can enable the browser-based Kubernetes administration dashboard using this microk8s.enable command. The output you&#8217;ll get will include extra instructions for displaying and using the authentication token you&#8217;ll need to connect.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo microk8s.enable dns dashboard\nEnabling DNS\nApplying manifest\nserviceaccount\/coredns created\nconfigmap\/coredns created\n[...]\nIf RBAC is not enabled access the dashboard using the default token retrieved with:\n\ntoken=$(microk8s.kubectl -n kube-system get secret | grep default-token | cut -d \" \" -f1)\nmicrok8s.kubectl -n kube-system describe secret $token<\/code><\/pre>\n\n\n\n<p>In an RBAC enabled setup (microk8s.enable RBAC) you need to create a user with restricted permissions as shown in&nbsp;<a href=\"https:\/\/github.com\/kubernetes\/dashboard\/wiki\/Creating-sample-user\">https:\/\/github.com\/kubernetes\/dashboard\/wiki\/Creating-sample-user<\/a><\/p>\n\n\n\n<p><em>This article is based on content in&nbsp;<a href=\"https:\/\/pluralsight.pxf.io\/nZgKx\">my Pluralsight course, &#8220;Using Docker on AWS.&#8221;<\/a>&nbsp;There&#8217;s much more administration goodness in the form of books, courses, and articles available at&nbsp;<a href=\"https:\/\/bootstrap-it.com\/\">bootstrap-it.com<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the beginning there was the FreeBSD &#8211; and later Linux &#8211; chroot jail. Chroot was a way to bring an unmounted file system to life so you could execute commands as though it was actually running on its own&hellip; <a href=\"https:\/\/bootstrap-it.com\/blog\/?p=374\" class=\"more-link\">Continue Reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":375,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A Simple Introduction to Kubernetes Container Orchestration - Bootstrap IT<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bootstrap-it.com\/blog\/?p=374\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Simple Introduction to Kubernetes Container Orchestration - Bootstrap IT\" \/>\n<meta property=\"og:description\" content=\"In the beginning there was the FreeBSD &#8211; and later Linux &#8211; chroot jail. Chroot was a way to bring an unmounted file system to life so you could execute commands as though it was actually running on its own&hellip; Continue Reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bootstrap-it.com\/blog\/?p=374\" \/>\n<meta property=\"og:site_name\" content=\"Bootstrap IT\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-21T01:15:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bootstrap-it.com\/blog\/wp-content\/uploads\/adult-audience-band-2102568-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"dbclin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@davidbclinton\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dbclin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bootstrap-it.com\/blog\/?p=374\",\"url\":\"https:\/\/bootstrap-it.com\/blog\/?p=374\",\"name\":\"A Simple Introduction to Kubernetes Container Orchestration - Bootstrap IT\",\"isPartOf\":{\"@id\":\"https:\/\/bootstrap-it.com\/blog\/#website\"},\"datePublished\":\"2020-01-21T01:15:14+00:00\",\"dateModified\":\"2020-01-21T01:15:14+00:00\",\"author\":{\"@id\":\"https:\/\/bootstrap-it.com\/blog\/#\/schema\/person\/ae0fb1d5b3b01558b92b6426d77766ec\"},\"breadcrumb\":{\"@id\":\"https:\/\/bootstrap-it.com\/blog\/?p=374#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bootstrap-it.com\/blog\/?p=374\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bootstrap-it.com\/blog\/?p=374#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bootstrap-it.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Simple Introduction to Kubernetes Container Orchestration\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bootstrap-it.com\/blog\/#website\",\"url\":\"https:\/\/bootstrap-it.com\/blog\/\",\"name\":\"Bootstrap IT\",\"description\":\"Learn technology using technology\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bootstrap-it.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/bootstrap-it.com\/blog\/#\/schema\/person\/ae0fb1d5b3b01558b92b6426d77766ec\",\"name\":\"dbclin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bootstrap-it.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a93785d437350478a7f1dfcbec58d26bc28e0124e405179acbe1b4325c09f90a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a93785d437350478a7f1dfcbec58d26bc28e0124e405179acbe1b4325c09f90a?s=96&d=mm&r=g\",\"caption\":\"dbclin\"},\"sameAs\":[\"http:\/\/bootstrap-it.com\/\",\"dbclinton\",\"https:\/\/twitter.com\/davidbclinton\"],\"url\":\"https:\/\/bootstrap-it.com\/blog\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A Simple Introduction to Kubernetes Container Orchestration - Bootstrap IT","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bootstrap-it.com\/blog\/?p=374","og_locale":"en_US","og_type":"article","og_title":"A Simple Introduction to Kubernetes Container Orchestration - Bootstrap IT","og_description":"In the beginning there was the FreeBSD &#8211; and later Linux &#8211; chroot jail. Chroot was a way to bring an unmounted file system to life so you could execute commands as though it was actually running on its own&hellip; Continue Reading &rarr;","og_url":"https:\/\/bootstrap-it.com\/blog\/?p=374","og_site_name":"Bootstrap IT","article_published_time":"2020-01-21T01:15:14+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/bootstrap-it.com\/blog\/wp-content\/uploads\/adult-audience-band-2102568-1.jpg","type":"image\/jpeg"}],"author":"dbclin","twitter_card":"summary_large_image","twitter_creator":"@davidbclinton","twitter_misc":{"Written by":"dbclin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/bootstrap-it.com\/blog\/?p=374","url":"https:\/\/bootstrap-it.com\/blog\/?p=374","name":"A Simple Introduction to Kubernetes Container Orchestration - Bootstrap IT","isPartOf":{"@id":"https:\/\/bootstrap-it.com\/blog\/#website"},"datePublished":"2020-01-21T01:15:14+00:00","dateModified":"2020-01-21T01:15:14+00:00","author":{"@id":"https:\/\/bootstrap-it.com\/blog\/#\/schema\/person\/ae0fb1d5b3b01558b92b6426d77766ec"},"breadcrumb":{"@id":"https:\/\/bootstrap-it.com\/blog\/?p=374#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bootstrap-it.com\/blog\/?p=374"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/bootstrap-it.com\/blog\/?p=374#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bootstrap-it.com\/blog"},{"@type":"ListItem","position":2,"name":"A Simple Introduction to Kubernetes Container Orchestration"}]},{"@type":"WebSite","@id":"https:\/\/bootstrap-it.com\/blog\/#website","url":"https:\/\/bootstrap-it.com\/blog\/","name":"Bootstrap IT","description":"Learn technology using technology","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bootstrap-it.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/bootstrap-it.com\/blog\/#\/schema\/person\/ae0fb1d5b3b01558b92b6426d77766ec","name":"dbclin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bootstrap-it.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a93785d437350478a7f1dfcbec58d26bc28e0124e405179acbe1b4325c09f90a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a93785d437350478a7f1dfcbec58d26bc28e0124e405179acbe1b4325c09f90a?s=96&d=mm&r=g","caption":"dbclin"},"sameAs":["http:\/\/bootstrap-it.com\/","dbclinton","https:\/\/twitter.com\/davidbclinton"],"url":"https:\/\/bootstrap-it.com\/blog\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=374"}],"version-history":[{"count":1,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":376,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions\/376"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/375"}],"wp:attachment":[{"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bootstrap-it.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}