{"id":3257,"date":"2018-07-20T14:43:16","date_gmt":"2018-07-20T19:43:16","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=3257"},"modified":"2018-07-30T09:17:43","modified_gmt":"2018-07-30T14:17:43","slug":"minikube-sandbox","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=3257","title":{"rendered":"Kubernetes Sandbox With Minikube"},"content":{"rendered":"<p>A scaled down sandbox can be used to gain experience with the applications and techniques used to deploy containerized applications and microservices. This sandbox will be built on a Windows 10 laptop, but the same components can be run on Linux variants.<\/p>\n<p><strong>Prerequisites<\/strong>:<\/p>\n<p><strong><em>Verify Virtualization is enabled:<\/em><\/strong><\/p>\n<p>Open Task Manager (taskman.exe) and ensure the virtualization extensions have been enabled.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3258\" rel=\"attachment wp-att-3258\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3258\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-01.png\" alt=\"\" width=\"624\" height=\"522\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-01.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-01-300x251.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>If virtualization is disabled, boot into the system config (start menu =&gt; settings =&gt; update &amp; security =&gt; recovery, click \u201cRestart now\u201d under \u201cAdvanced startup\u201d)<\/p>\n<p><strong><em>Uninstall the Windows OpenSSH client<\/em><\/strong><\/p>\n<p>Click \u2018Start\u2019 and type \u201cManage optional features\u201d \u2013 within the installed feature list, find \u201cOpenSSH Client\u201d. If present, remove it.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3259\" rel=\"attachment wp-att-3259\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3259\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-02.png\" alt=\"\" width=\"624\" height=\"487\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-02.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-02-300x234.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3260\" rel=\"attachment wp-att-3260\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3260\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-03.png\" alt=\"\" width=\"322\" height=\"311\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-03.png 322w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-03-300x290.png 300w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/a><\/p>\n<p><strong><em>Enable Hyper-V<\/em><\/strong><\/p>\n<p>Enable the Hyper-V Windows feature (Control Panel =&gt; Programs =&gt; Programs and Features, &#8220;Turn Windows features on or off&#8221; and check both Hyper-V components).<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3261\" rel=\"attachment wp-att-3261\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3261\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-04.png\" alt=\"\" width=\"555\" height=\"492\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-04.png 555w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-04-300x266.png 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/a><\/p>\n<p><strong><em>Add Virtual Switch To Hyper-V<\/em><\/strong><\/p>\n<p>In the Hyper-V Manager, open the \u201cVirtual Switch Manager\u201d. Create a new External virtual switch. Record the name used for your new virtual switch.<\/p>\n<p><strong>\u00a0<a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3262\" rel=\"attachment wp-att-3262\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3262\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-05.png\" alt=\"\" width=\"624\" height=\"594\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-05.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-05-300x286.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/strong><\/p>\n<p><strong>Install Minikube<\/strong><\/p>\n<p>View <a href=\"https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt\">https:\/\/storage.googleapis.com\/kubernetes-release\/release\/stable.txt<\/a> and record the version number. The current stable release version is v1.11.1<\/p>\n<p>Modify the URL http:\/\/storage.googleapis.com\/kubernetes-release\/release\/v#.##.#\/bin\/windows\/amd64\/kubectl.exe to use the current stable release version. Current URL is <a href=\"http:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.11.1\/bin\/windows\/amd64\/kubectl.exe\">http:\/\/storage.googleapis.com\/kubernetes-release\/release\/v1.11.1\/bin\/windows\/amd64\/kubectl.exe<\/a><\/p>\n<p>Create a folder %ProgramFiles%\\Minikube and add this folder to your PATH variable.<\/p>\n<p>Download kubectl.exe from the current release URL to %ProgramFiles%\\Minikube<\/p>\n<p>Download the current Minikube release from <a href=\"https:\/\/github.com\/kubernetes\/minikube\/releases\">https:\/\/github.com\/kubernetes\/minikube\/releases<\/a> (scroll down to the \u201cDistribution\u201d section, locate the Windows\/amd64 link, and save that binary as %ProgramFiles%\\Minikube\\minikube.exe). ** v0.28.1 was completely non-functional for me (and errors were related to existing issues on the minikube GitHub site) so I used v0.27.0<\/p>\n<p>Verify both are functional. From a command prompt (run as administrator) or Powershell (again run as administrator), run \u201ckubectl version\u201d and verify the output includes a client version<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3263\" rel=\"attachment wp-att-3263\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3263\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-06.png\" alt=\"\" width=\"624\" height=\"130\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-06.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-06-300x63.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Run \u201cminikube get-k8s-versions\u201d and verify there is output.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3264\" rel=\"attachment wp-att-3264\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3264\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-07.png\" alt=\"\" width=\"624\" height=\"227\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-07.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-07-300x109.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Configure the Minikube VM using the Hyper-V driver and switch you created earlier.<\/p>\n<p>minikube start &#8211;vm-driver hyperv &#8211;hyperv-virtual-switch &#8220;Minikube Switch&#8221; \u2013alsologtostderr<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3265\" rel=\"attachment wp-att-3265\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3265\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-08.png\" alt=\"\" width=\"624\" height=\"362\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-08.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-08-300x174.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Once everything has started, \u201ckubectl version\u201d will report both a client and server version.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3266\" rel=\"attachment wp-att-3266\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3266\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-09.png\" alt=\"\" width=\"624\" height=\"159\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-09.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-09-300x76.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>You can use \u201cminikube ip\u201d to ascertain the IP address of your cluster<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3267\" rel=\"attachment wp-att-3267\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3267\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-10.png\" alt=\"\" width=\"624\" height=\"159\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-10.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-10-300x76.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>If the cluster services fail to start, there are a few log locations.<\/p>\n<p>Run \u201cminikube logs\u201d to see the log information from the minikube virtual machine<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3268\" rel=\"attachment wp-att-3268\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3268\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-11.png\" alt=\"\" width=\"624\" height=\"394\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-11.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-11-300x189.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Use \u201ckubectl get pods \u2013all-namespaces\u201d to determine which component(s) fail, then use \u201ckubectl logs -f <em>name<\/em> -n kube-system\u201d to review logs to determine why the component failed to start.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3269\" rel=\"attachment wp-att-3269\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3269\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-12.png\" alt=\"\" width=\"624\" height=\"394\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-12.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-12-300x189.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>If you need to connect to the minikube Hyper-V VM, the username is docker and the password is tcuser \u2013 you can ssh into the host or connect to the console through the Hyper-V Manager.<\/p>\n<p>Before the management interface comes online, you can use view the status of the containers using the docker command line utilities on the minikube VM.<\/p>\n<p>$ docker ps<\/p>\n<p>CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IMAGE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 COMMAND\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CREATED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES<\/p>\n<p>7d8d66b5e465\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 af20925d51a3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;kube-apiserver &#8211;ad\u2026&#8221;\u00a0\u00a0 About a minute ago\u00a0\u00a0 Up About a minute\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_kube-apiserver_kube-apiserver-minikube_kube-system_0f6076ada4273000c4b2f846f250f3f7_3<\/p>\n<p>bb4be8d267cb\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 52920ad46f5b\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;etcd &#8211;advertise-cl\u2026&#8221;\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_etcd_etcd-minikube_kube-system_0199781185b49d6ff5624b06273532ab_0<\/p>\n<p>d6be5d6ae360\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9c16409588eb\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;\/opt\/kube-addons.sh&#8221;\u00a0\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_kube-addon-manager_kube-addon-manager-minikube_kube-system_3afaf06535cc3b85be93c31632b765da_1<\/p>\n<p>b5ddf5d1ff11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ad86dbed1555\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;kube-controller-man\u2026&#8221;\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_kube-controller-manager_kube-controller-manager-minikube_kube-system_d9cefa6e3dc9378ad420db8df48a9da5_0<\/p>\n<p>252d382575c7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 704ba848e69a\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;kube-scheduler &#8211;ku\u2026&#8221;\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0k8s_kube-scheduler_kube-scheduler-minikube_kube-system_2acb197d598c4730e3f5b159b241a81b_0<\/p>\n<p>421b2e264f9f\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s.gcr.io\/pause-amd64:3.1\u00a0\u00a0 &#8220;\/pause&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_POD_kube-scheduler-minikube_kube-system_2acb197d598c4730e3f5b159b241a81b_0<\/p>\n<p>85e0e2d0abab\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s.gcr.io\/pause-amd64:3.1\u00a0\u00a0 &#8220;\/pause&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_POD_kube-controller-manager-minikube_kube-system_d9cefa6e3dc9378ad420db8df48a9da5_0<\/p>\n<p>2028c6414573\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s.gcr.io\/pause-amd64:3.1\u00a0\u00a0 &#8220;\/pause&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_POD_kube-apiserver-minikube_kube-system_0f6076ada4273000c4b2f846f250f3f7_0<\/p>\n<p>663b87989216\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s.gcr.io\/pause-amd64:3.1\u00a0\u00a0 &#8220;\/pause&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 7 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_POD_etcd-minikube_kube-system_0199781185b49d6ff5624b06273532ab_0<\/p>\n<p>7eae09d0662b\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s.gcr.io\/pause-amd64:3.1\u00a0\u00a0 &#8220;\/pause&#8221;\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a07 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 7 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 k8s_POD_kube-addon-manager-minikube_kube-system_3afaf06535cc3b85be93c31632b765da_1<\/p>\n<p>&nbsp;<\/p>\n<p>This allows you to view the specific logs for a container that is failing to launch<\/p>\n<p>$ docker logs 0d21814d8226<\/p>\n<p>Flag &#8211;admission-control has been deprecated, Use &#8211;enable-admission-plugins or &#8211;disable-admission-plugins instead. Will be removed in a future version.<\/p>\n<p>Flag &#8211;insecure-port has been deprecated, This flag will be removed in a future version.<\/p>\n<p>I0720 16:37:07.591352\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 server.go:135] Version: v1.10.0<\/p>\n<p>I0720 16:37:07.596494\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a01 server.go:679] external host was not specified, using 10.5.5.240<\/p>\n<p>I0720 16:37:08.555806\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 feature_gate.go:190] feature gates: map[Initializers:true]<\/p>\n<p>I0720 16:37:08.565008\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 initialization.go:90] enabled Initializers feature as part of admission plugin setup<\/p>\n<p>I0720 16:37:08.690234\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 plugins.go:149] Loaded 10 admission controller(s) successfully in the following order: NamespaceLifecycle,LimitRanger,ServiceAccount,NodeRestriction,DefaultTolerationSeconds,DefaultStorageClass,MutatingAdmissionWebhook,Initializers,ValidatingAdmissionWebhook,ResourceQuota.<\/p>\n<p>I0720 16:37:08.717560\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 master.go:228] Using reconciler: master-count<\/p>\n<p>W0720 16:37:09.383605\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 genericapiserver.go:342] Skipping API batch\/v2alpha1 because it has no resources.<\/p>\n<p>W0720 16:37:09.399172\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 genericapiserver.go:342] Skipping API rbac.authorization.k8s.io\/v1alpha1 because it has no resources.<\/p>\n<p>W0720 16:37:09.407426\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 genericapiserver.go:342] Skipping API storage.k8s.io\/v1alpha1 because it has no resources.<\/p>\n<p>W0720 16:37:09.445491\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1 genericapiserver.go:342] Skipping API admissionregistration.k8s.io\/v1alpha1 because it has no resources.<\/p>\n<p>[restful] 2018\/07\/20 16:37:09 log.go:33: [restful\/swagger] listing is available at https:\/\/10.5.5.240:8443\/swaggerapi<\/p>\n<p>[restful] 2018\/07\/20 16:37:09 log.go:33: [restful\/swagger] https:\/\/10.5.5.240:8443\/swaggerui\/ is mapped to folder \/swagger-ui\/<\/p>\n<p>[restful] 2018\/07\/20 16:37:52 log.go:33: [restful\/swagger] listing is available at https:\/\/10.5.5.240:8443\/swaggerapi<\/p>\n<p>[restful] 2018\/07\/20 16:37:52 log.go:33: [restful\/swagger] https:\/\/10.5.5.240:8443\/swaggerui\/ is mapped to folder \/swagger-ui\/<\/p>\n<p>&nbsp;<\/p>\n<p>Worst case, we haven\u2019t really <em>done<\/em> anything yet and you can start over with \u201cminikube delete\u201d, then delete the .minikube directory (likely located in %USERPROFILE%), and start over.<\/p>\n<p>Once you have updated the Hyper-V configuration and started the cluster, you should be able to access the kubernetes dashboard<\/p>\n<p><strong>Actually using it<\/strong><\/p>\n<p>Now that you have minikube running, you can access the dashboard via a web URL \u2013 or just type \u201cminikube dashboard\u201d to have the site launched in your default browser.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3270\" rel=\"attachment wp-att-3270\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3270\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-13.png\" alt=\"\" width=\"624\" height=\"176\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-13.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-13-300x85.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a> <a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3271\" rel=\"attachment wp-att-3271\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3271\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-14.png\" alt=\"\" width=\"624\" height=\"335\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-14.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-14-300x161.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Create a deployment \u2013 we\u2019ll use the nginx sample image here<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3272\" rel=\"attachment wp-att-3272\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3272\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-15.png\" alt=\"\" width=\"624\" height=\"176\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-15.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-15-300x85.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Voila, under Workloads =&gt; Deployments, you should see this test deployment (if the Pods column has 0\/1, the image has not completely started \u2026 wait for it!)<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3273\" rel=\"attachment wp-att-3273\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3273\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-16.png\" alt=\"\" width=\"624\" height=\"335\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-16.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-16-300x161.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Under Workloads=&gt;Pods, you can select the sample. In the upper right-hand corner, there are buttons to shell into the Pod as well as view logs from the Pod.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3274\" rel=\"attachment wp-att-3274\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3274\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-17.png\" alt=\"\" width=\"624\" height=\"335\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-17.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-17-300x161.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Expose the deployment as a service. You can use the web GUI to verify the service or \u201ckubectl describe service <em>servicename<\/em>\u201d<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3275\" rel=\"attachment wp-att-3275\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3275\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-18.png\" alt=\"\" width=\"624\" height=\"176\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-18.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-18-300x85.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3276\" rel=\"attachment wp-att-3276\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3276\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-19.png\" alt=\"\" width=\"624\" height=\"234\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-19.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-19-300x113.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3277\" rel=\"attachment wp-att-3277\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3277\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-20.png\" alt=\"\" width=\"623\" height=\"109\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-20.png 623w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-20-300x52.png 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/a><\/p>\n<p>Either method provides the TCP port to access the service. Access the URL in a browser. Voila, a web site:<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3278\" rel=\"attachment wp-att-3278\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3278\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-21.png\" alt=\"\" width=\"624\" height=\"218\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-21.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-21-300x105.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Viewing the Pod logs should now show the web server access logs.<\/p>\n<p>That\u2019s all fine and good, but there are dozens of <em>other<\/em> ways to bring up a quick web server. Using Docker directly. Magic cloudy hosting services. A server with a web server on it. K8 allows you to quickly scale the deployment \u2013 specify the number of replicas you want and you\u2019ve got them:<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3279\" rel=\"attachment wp-att-3279\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3279\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-22.png\" alt=\"\" width=\"624\" height=\"279\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-22.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-22-300x134.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>Describing the service, you will see multiple endpoints.<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3280\" rel=\"attachment wp-att-3280\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3280\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-23.png\" alt=\"\" width=\"624\" height=\"233\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-23.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-23-300x112.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p><strong>What do I <em>really<\/em> have?<\/strong><\/p>\n<p>You\u2019ve got containers \u2013 either your own container for <em>your<\/em> application or some test container. Following these instructions, we\u2019ve got a test container that serves up a simple web page.<\/p>\n<p>You\u2019ve got a Pod \u2013 one or more containers are run in a Pod. A pod exists on a single machine, so all containers within a Pod share resources. This is good thing if the containers interact with each other (shared resources speed up this communication), but it\u2019s a bad thing if the containers have no correlation but run high I\/O functions (shared resources create contention for this communication).<\/p>\n<p>You\u2019ve got a deployment \u2013 a managed group of Pods. Each application or microservice will have a deployment. The deployment keeps the desired number of instances running \u2013 if an instance is not healthy, it is terminated and a new instance spawned. You can resize the deployment on a schedule, or you can use load metrics to manage capacity.<\/p>\n<p>You\u2019ve got services \u2013 services map resources running within pods to internal or external access. The service has an IP address and port for client access, and requests are load balanced across healthy, running Pods. In our case, we are using NodePort, and \u201ckubectl describe service ngnix-sample\u201d will provide the port number.<\/p>\n<p>Because client access is performed through the service, you can perform \u201crolling updates\u201d by setting a new image (and even roll back if the newly deployed image is malfunctioning). To roll a new image into service, use \u201ckubectl set image deployments\/ngnix-sample ngnix-sample=something\/image:v5\u201d. Using \u201ckubectl get pods\u201d, you can see replicas come online with the new image and ones with the old image terminate. Or, for a quick summary of the rollout status, run \u201ckubectl rollout status deployment nginx-sample\u201d<\/p>\n<p><a href=\"http:\/\/lisa.rushworth.us\/?attachment_id=3281\" rel=\"attachment wp-att-3281\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3281\" src=\"http:\/\/lisa.rushworth.us\/wp-content\/uploads\/2018\/07\/minikube-24.png\" alt=\"\" width=\"624\" height=\"233\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-24.png 624w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2018\/07\/minikube-24-300x112.png 300w\" sizes=\"auto, (max-width: 624px) 100vw, 624px\" \/><\/a><\/p>\n<p>If the new container fails to load, or if adverse behavior is experienced, you can run &#8220;kubectl rollout undo deployment nginx-sample&#8221; to revert to the previous working container image.<\/p>\n<p>When you are done with your sandbox, you can stop it using &#8220;minikube stop&#8221;, and &#8220;minikube start&#8221; will bring the sandbox back online.<\/p>\n<p>A \u201creal world\u201d deployment would have multiple servers (physical, virtual, or a combination thereof) essentially serving as a resource pool. You wouldn\u2019t manually scale deployments either.<\/p>\n<p>Notice that the dashboard \u2013 and all of its administrative functions \u2013 are open to the world. A \u201creal world\u201d deployment would either include something like OpenUnison to authenticate through ADFS or some web hook that performs LDAP authentication and provides an access token.<\/p>\n<p>And there\u2019s no reason to use kubectl to <em>manually<\/em> deploy updates. Commit your changes into the git repository. Jenkins picks up the changes, runs the Maven build and tests, and creates a Docker build. The final step within the Jenkins workflow is to perform the image rollout. This means you can have a new image deployed within minutes (actual time depends on the build\/test time) of committing code to a repo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A scaled down sandbox can be used to gain experience with the applications and techniques used to deploy containerized applications and microservices. This sandbox will be built on a Windows 10 laptop, but the same components can be run on Linux variants. Prerequisites: Verify Virtualization is enabled: Open Task Manager (taskman.exe) and ensure the virtualization &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[618,620,231,616,615,619],"class_list":["post-3257","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-build-automation","tag-continuous-delivery","tag-docker","tag-jenkins","tag-kubernetes","tag-microservices"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3257"}],"version-history":[{"count":5,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3257\/revisions"}],"predecessor-version":[{"id":3298,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3257\/revisions\/3298"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}