{"id":10931,"date":"2016-11-30T11:35:17","date_gmt":"2016-11-30T09:35:17","guid":{"rendered":"https:\/\/blog.zhaw.ch\/icclab\/?p=10931"},"modified":"2019-08-05T13:54:33","modified_gmt":"2019-08-05T11:54:33","slug":"container-management-with-kubernetes-practical-example","status":"publish","type":"post","link":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/","title":{"rendered":"Container management with Kubernetes: Practical Example"},"content":{"rendered":"\n<p>by <a href=\"https:\/\/blog.zhaw.ch\/icclab\/josef-spillner\/\">Josef Spillner<\/a><\/p>\n\n\n<p><span style=\"font-weight: 400\">Following the series that we started with the<a href=\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-vamp-practical-example\/\"> Vamp Blog post<\/a><\/span><span style=\"font-weight: 400\">, we proceed to take a look of one more of the container management tools which includes running a simple practical example while we pay attention to the main advantages and limitations. This series happens in the context of the work on cloud-native applications in the <a href=\"https:\/\/blog.zhaw.ch\/icclab\/category\/labs\/splab\/\">Service Prototyping Lab<\/a> to explore how easily developers can decompose their applications and fit them into the emerging platforms.<br>\n<\/span><\/p>\n<p><span style=\"font-weight: 400\">On this occasion, we inspect <a href=\"http:\/\/kubernetes.io\/\">Kubernetes<\/a><\/span><span style=\"font-weight: 400\">, one of the most popular open-source container orchestration tool for production environments. Kubernetes builds upon 15 years of experience of running production workloads at Google. Moreover the community of Kubernetes appears to be the biggest among all the open source container management communities. Kubernetes provides a <a href=\"http:\/\/slack.k8s.io\/\">Slack channel<\/a><\/span><span style=\"font-weight: 400\">&nbsp;with more than 8000 users who share ideas and are often Kubernetes engineers. Also, one can find community support in <a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/kubernetes\">Stack Overflow<\/a> using the tag <em>kubernetes<\/em><\/span><span style=\"font-weight: 400\">. Inside the&nbsp;<a href=\"https:\/\/github.com\/kubernetes\/kubernetes\">Github repository<\/a>,<\/span><span style=\"font-weight: 400\">&nbsp;we can see more than 970 contributors, 1500 watches, 18500 starts and 6000 forks. In the community it is popular to abbreviate the system as K8s.&nbsp;<\/span><\/p>\n<p><!--more--><\/p>\n<p><span style=\"font-weight: 400\">Some of the self-declared features of Kubernetes are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/compute-resources\/\">Automatic binpacking<\/a>: &nbsp;<\/span>With that, you can specify how much CPU &nbsp;or RAM each container needs. Also you can add a specified limit.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/horizontal-pod-autoscaling\/\">Horizontal scaling<\/a>:&nbsp;<\/span>You can scale your application with a simple command or automatically based on CPU usage.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/replicasets\/\">Self-healing<\/a>:&nbsp;<\/span>Restarts the containers that fail, replaces and reschedules containers when nodes die.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/services\/\">Service discovery and load balancing<\/a>:&nbsp;<\/span>Kubernetes gives containers their own IP addresses and a single DNS name for a set of containers, and can load-balance across them.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/deployments\/\">Automated rollouts and rollbacks<\/a>:&nbsp;<\/span>With this feature, Kubernetes does progressively roll out changes and it ensure it doesn\u2019t kill all your instances at the same time.<\/li>\n<li style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/secrets\/\"><span style=\"font-weight: 400\">Secrets <\/span><\/a><span style=\"font-weight: 400\">and<a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/configmap\/\"> configuration&nbsp;<\/a><\/span><span style=\"font-weight: 400\">management.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/persistent-volumes\/\">Storage orchestration<\/a>:&nbsp;<\/span>Automatically mount the storage system of your choice, whether from local storage, a public cloud provider such as <a href=\"https:\/\/cloud.google.com\/storage\/\"><span style=\"font-weight: 400\">GCP<\/span><\/a><span style=\"font-weight: 400\"> or <\/span><a href=\"http:\/\/media.amazonwebservices.com\/AWS_Storage_Options.pdf\"><span style=\"font-weight: 400\">AWS<\/span><\/a><span style=\"font-weight: 400\">, or a network storage system such as NFS, iSCSI, Gluster, Ceph, Cinder, or Flocker.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/jobs\/\">Batch execution<\/a>:&nbsp;<\/span>Kubernetes can manage your batch and CI workloads using jobs.<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">The main associated concepts for defining a microservice architecture on the application level using Kubernetes are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/pods\/\">Pod<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/replicasets\/\">Replica set&nbsp;<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/deployments\/\">Deployment&nbsp;<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/services\/\">Service<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/labels\/\">Label and selector<\/a><\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">These are the concepts that we are going to use in our practical example.&nbsp;<\/span><span style=\"font-weight: 400\">Other useful and important concepts that Kubernetes provides are:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/jobs\/\">Job<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/persistent-volumes\/\">Persistance volume<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/ingress\/\">Ingress<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/secrets\/\">Secrets<\/a> <\/span><span style=\"font-weight: 400\">&nbsp;and <a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/configmap\/\">configuration<\/a><\/span><\/li>\n<li style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/user-guide\/horizontal-pod-autoscaling\/\"><span style=\"font-weight: 400\">Horizontal Pod Autoscaling<\/span><\/a><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">Note that for each feature that Kubernetes provides to us, there is a Kubernetes concept responsible of it. You can see this relation in the next table.<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10932\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png\" alt=\"screen-shot-2016-11-30-at-10-05-38\" width=\"584\" height=\"371\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-300x190.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-768x487.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-473x300.png 473w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38.png 1210w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">Now, let\u2019s go to see an example using Kubernetes as management tool for a multi-service application. Like in our other blog post for Vamp, w<\/span><span style=\"font-weight: 400\">e demonstrate how to deploy a simple three-tier architecture that we are running in a development environment with docker-compose into a production environment using Kubernetes. The application is a prototype mimicking the functionality of an actual industry use case, a document management application, in the context of our research on <\/span><a href=\"https:\/\/blog.zhaw.ch\/icclab\/category\/research-approach\/themes\/cloud-native-applications\/\"><span style=\"font-weight: 400\">cloud-native applications<\/span><\/a><span style=\"font-weight: 400\">. All containers of the prototype can be found in the <\/span><a href=\"https:\/\/hub.docker.com\/u\/chumbo\/\"><span style=\"font-weight: 400\">public Docker Hub<\/span><\/a><span style=\"font-weight: 400\"> for reproducing our results.<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/3layer.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10853\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/3layer.png\" alt=\"3-layer\" width=\"643\" height=\"133\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/3layer.png 643w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/3layer-300x62.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/3layer-500x103.png 500w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">The first step is to install Kubernetes. For this step, there are different options:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Custom&nbsp;option: You must install all the Kubernetes requirements by yourself. It is the most difficult option but also it is the most flexible one and without any limitation.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/getting-started-guides\/kops\/\">kops<\/a>: <\/span><span style=\"font-weight: 400\">Easy way to install a Kubernetes cluster on AWS. It has some prefixed options. <\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"http:\/\/kubernetes.io\/docs\/getting-started-guides\/kubeadm\/\">kubadm<\/a>:&nbsp;<\/span><span style=\"font-weight: 400\">One easy way to install a Kubernetes cluster in production. It is currently in alpha stage and it has some <a href=\"http:\/\/kubernetes.io\/docs\/getting-started-guides\/kubeadm\/#limitations\">limitations<\/a>.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\"><a href=\"https:\/\/github.com\/kubernetes\/minikube\">minikube<\/a><\/span><span style=\"font-weight: 400\">: The option to run Kubernetes locally. It has severe limitations like <\/span><span style=\"font-weight: 400\">LoadBalancers, PersistentVolumes or Ingress but is typically the fastest to just get a running cluster environment<\/span><span style=\"font-weight: 400\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">In this example, we will use the easiest way to install Kubernetes: minikube. Therefore, for starting it you must follow this <a href=\"http:\/\/kubernetes.io\/docs\/getting-started-guides\/minikube\/\">tutorial<\/a><\/span><span style=\"font-weight: 400\">. <\/span><span style=\"font-weight: 400\">We start from our <em>docker-compose<\/em> file which we assume a developer has already at hand. We expect that in the future, automatic application decomposition might happen, but until then, wiring all microservices manually will be the norm.<br>\n<\/span><\/p>\n<p><span style=\"font-weight: 400\"><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/blueprint-docker-compose.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10845 aligncenter\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/blueprint-docker-compose.png\" alt=\"blueprint-docker-compose\" width=\"180\" height=\"236\"><\/a><\/span><span style=\"font-weight: 400\">For converting our docker-compose file to the Kubernetes DSL we use the tool <a href=\"https:\/\/github.com\/kubernetes-incubator\/kompose\">Kompose<\/a><\/span><span style=\"font-weight: 400\">. We go to the directory where we have docker-compose.yaml and we run:<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.26.40.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10933\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.26.40.png\" alt=\"kompose \" width=\"954\" height=\"276\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.26.40.png 954w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.26.40-300x87.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.26.40-768x222.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.26.40-500x145.png 500w\" sizes=\"auto, (max-width: 954px) 100vw, 954px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">Now, if we have minikube running in our machine we can start the dashboard running \u201c<em>minikube dashboard<\/em>\u201d in our terminal. This action will open our browser with the dashboard of Kubernetes.<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.32.44.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10934\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.32.44-1024x529.png\" alt=\"minikube dashboard\" width=\"584\" height=\"302\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.32.44-1024x529.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.32.44-300x155.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.32.44-768x397.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.32.44-500x258.png 500w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">For creating our deployments or services we can use the command line with: <\/span><span style=\"font-weight: 400\"><em>kubectl create -f name.json<\/em> or the dashboard using the button CREATE. <\/span><span style=\"font-weight: 400\">After this step we have created our deployments and services, and we must see in our dashboard something similar to the next screenshots:<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.40.42.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10935\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.40.42-1024x534.png\" alt=\"Workloads minikube tutorial\" width=\"584\" height=\"305\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.40.42-1024x534.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.40.42-300x156.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.40.42-768x401.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.40.42-500x261.png 500w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.41.07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10936\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.41.07-1024x179.png\" alt=\"service minikube tutorial\" width=\"584\" height=\"102\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.41.07-1024x179.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.41.07-300x52.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.41.07-768x134.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.41.07-500x87.png 500w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">Using Kompose, the services that we have created by default are of mode ClusterIP. Hence, these services do not have an external IP. We can change the type of the service using the dashboard and clicking on edit.<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.42.03.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10937 aligncenter\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.42.03-851x1024.png\" alt=\"services edit minikube tutorial\" width=\"304\" height=\"365\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.42.03-851x1024.png 851w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.42.03-249x300.png 249w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.42.03-768x924.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-11.42.03.png 1268w\" sizes=\"auto, (max-width: 304px) 100vw, 304px\" \/><\/a><span style=\"font-weight: 400\">In this case we change the type to NodePort. If we want choose a fix external port we can add a nodePort, too. <\/span><span style=\"font-weight: 400\">Now we have running our simple microservice architecture in our own Kubernetes cluster. As we are using replica sets, it is already self-healing. Also, we can modify our deployments for horizontal scaling or do a rollout.&nbsp;<\/span><span style=\"font-weight: 400\">For example, for scaling the <em>arkisbackend<\/em> container to 4 pods we just change the number of replicas.<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-10938 aligncenter\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15-1024x992.png\" alt=\"deployment replicas 4\" width=\"324\" height=\"314\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15-1024x992.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15-300x291.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15-768x744.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15-310x300.png 310w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.15.png 1584w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/a><span style=\"font-weight: 400\">And now we can see the result:<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.36.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10939\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.36-1024x165.png\" alt=\"4 replicas\" width=\"584\" height=\"94\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.36-1024x165.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.36-300x48.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.36-768x124.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.17.36-500x80.png 500w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">If now we want do a rollout, we just must change the version of the container image. In this case Kubernetes create first the news pods:<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.33.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-10940\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.33-1024x119.png\" alt=\"rollout 1\" width=\"694\" height=\"93\"><\/a><\/p>\n<p><span style=\"font-weight: 400\">And afterwards Kubernetes will delete the pods with the old version:<\/span><\/p>\n<p><a href=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.40.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-10941\" src=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.40-1024x116.png\" alt=\"rollout 2\" width=\"584\" height=\"66\" srcset=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.40-1024x116.png 1024w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.40-300x34.png 300w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.40-768x87.png 768w, https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-28-at-13.18.40-500x57.png 500w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">Using the tool this way, we will are sure that the application is always running.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Kubernetes thus proves useful as a lower-level tool for managing both single containers and composition of containers. There are also some disadvantages when using Kubernetes:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You must learn new concepts with partially confusing terminology, e.g. the concept of services.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You must learn a new DSL for describing it when developing with Docker tools. Kubernetes attempts to solve this with Kompose.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The difficulty to install a Kubernetes cluster in a production environment if we compare with other tools like <a href=\"https:\/\/docs.docker.com\/swarm\/\">docker swarm<\/a><\/span><span style=\"font-weight: 400\">. From the version 1.4 we can use the tool <em>kubeadm<\/em> that do it more easy. But it is still in alpha stage and it has important limitations yet.<\/span><\/li>\n<li style=\"font-weight: 400\">It misses crucial service platform ingredients including a marketplace and broker. The development roadmap is not very clear on these features.<\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">As future work we will continue writing blog posts about container management and compare the tools more thoroughly once we have established a more complex common example. <\/span><\/p><div class=\"pt-sm\">Schlagw\u00f6rter: <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/cloud-native-applications\/\">cloud-native applications<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/composition\/\">composition<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/containers\/\">containers<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/microservices\/\">microservices<\/a>, <a href=\"https:\/\/blog.zhaw.ch\/icclab\/tag\/runtime\/\">runtime<\/a><br><\/div>","protected":false},"excerpt":{"rendered":"<p>Following the series that we started with the Vamp Blog post, we proceed to take a look of one more of the container management tools which includes running a simple practical example while we pay attention to the main advantages and limitations. This series happens in the context of the work on cloud-native applications in [&hellip;]<\/p>\n","protected":false},"author":486,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1,15],"tags":[551,622,609,566,821],"features":[],"class_list":["post-10931","post","type-post","status-publish","format-standard","hentry","category-allgemein","category-howtos","tag-cloud-native-applications","tag-composition","tag-containers","tag-microservices","tag-runtime"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Container management with Kubernetes: Practical Example - Service Engineering (ICCLab &amp; SPLab)<\/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:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Container management with Kubernetes: Practical Example\" \/>\n<meta property=\"og:description\" content=\"Following the series that we started with the Vamp Blog post, we proceed to take a look of one more of the container management tools which includes running a simple practical example while we pay attention to the main advantages and limitations. This series happens in the context of the work on cloud-native applications in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Service Engineering (ICCLab &amp; SPLab)\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-30T09:35:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-05T11:54:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png\" \/>\n<meta name=\"author\" content=\"icclab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"icclab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\"},\"author\":{\"name\":\"icclab\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/045c6bde7e681e689e4fc051d8932563\"},\"headline\":\"Container management with Kubernetes: Practical Example\",\"datePublished\":\"2016-11-30T09:35:17+00:00\",\"dateModified\":\"2019-08-05T11:54:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\"},\"wordCount\":1153,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png\",\"keywords\":[\"cloud-native applications\",\"composition\",\"containers\",\"microservices\",\"runtime\"],\"articleSection\":[\"*.*\",\"HowTos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\",\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\",\"name\":\"Container management with Kubernetes: Practical Example - Service Engineering (ICCLab &amp; SPLab)\",\"isPartOf\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png\",\"datePublished\":\"2016-11-30T09:35:17+00:00\",\"dateModified\":\"2019-08-05T11:54:33+00:00\",\"author\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/045c6bde7e681e689e4fc051d8932563\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage\",\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38.png\",\"contentUrl\":\"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38.png\",\"width\":1210,\"height\":768},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\/\/blog.zhaw.ch\/icclab\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Container management with Kubernetes: Practical Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#website\",\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/\",\"name\":\"Service Engineering (ICCLab &amp; SPLab)\",\"description\":\"A Blog of the ZHAW Zurich University of Applied Sciences\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.zhaw.ch\/icclab\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/045c6bde7e681e689e4fc051d8932563\",\"name\":\"icclab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/7b13169e03783f50e96b96fa2ff222b9c530d13c3125f077c7c44f729b857a51?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7b13169e03783f50e96b96fa2ff222b9c530d13c3125f077c7c44f729b857a51?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7b13169e03783f50e96b96fa2ff222b9c530d13c3125f077c7c44f729b857a51?s=96&d=mm&r=g\",\"caption\":\"icclab\"},\"url\":\"https:\/\/blog.zhaw.ch\/icclab\/author\/icclab\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Container management with Kubernetes: Practical Example - Service Engineering (ICCLab &amp; SPLab)","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:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/","og_locale":"en_US","og_type":"article","og_title":"Container management with Kubernetes: Practical Example","og_description":"Following the series that we started with the Vamp Blog post, we proceed to take a look of one more of the container management tools which includes running a simple practical example while we pay attention to the main advantages and limitations. This series happens in the context of the work on cloud-native applications in [&hellip;]","og_url":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/","og_site_name":"Service Engineering (ICCLab &amp; SPLab)","article_published_time":"2016-11-30T09:35:17+00:00","article_modified_time":"2019-08-05T11:54:33+00:00","og_image":[{"url":"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png","type":"","width":"","height":""}],"author":"icclab","twitter_card":"summary_large_image","twitter_misc":{"Written by":"icclab","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#article","isPartOf":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/"},"author":{"name":"icclab","@id":"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/045c6bde7e681e689e4fc051d8932563"},"headline":"Container management with Kubernetes: Practical Example","datePublished":"2016-11-30T09:35:17+00:00","dateModified":"2019-08-05T11:54:33+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/"},"wordCount":1153,"commentCount":0,"image":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png","keywords":["cloud-native applications","composition","containers","microservices","runtime"],"articleSection":["*.*","HowTos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/","url":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/","name":"Container management with Kubernetes: Practical Example - Service Engineering (ICCLab &amp; SPLab)","isPartOf":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage"},"image":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38-1024x650.png","datePublished":"2016-11-30T09:35:17+00:00","dateModified":"2019-08-05T11:54:33+00:00","author":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/045c6bde7e681e689e4fc051d8932563"},"breadcrumb":{"@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#primaryimage","url":"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38.png","contentUrl":"https:\/\/blog.zhaw.ch\/icclab\/files\/2016\/11\/Screen-Shot-2016-11-30-at-10.05.38.png","width":1210,"height":768},{"@type":"BreadcrumbList","@id":"https:\/\/blog.zhaw.ch\/icclab\/container-management-with-kubernetes-practical-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/blog.zhaw.ch\/icclab\/"},{"@type":"ListItem","position":2,"name":"Container management with Kubernetes: Practical Example"}]},{"@type":"WebSite","@id":"https:\/\/blog.zhaw.ch\/icclab\/#website","url":"https:\/\/blog.zhaw.ch\/icclab\/","name":"Service Engineering (ICCLab &amp; SPLab)","description":"A Blog of the ZHAW Zurich University of Applied Sciences","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.zhaw.ch\/icclab\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.zhaw.ch\/icclab\/#\/schema\/person\/045c6bde7e681e689e4fc051d8932563","name":"icclab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7b13169e03783f50e96b96fa2ff222b9c530d13c3125f077c7c44f729b857a51?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7b13169e03783f50e96b96fa2ff222b9c530d13c3125f077c7c44f729b857a51?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7b13169e03783f50e96b96fa2ff222b9c530d13c3125f077c7c44f729b857a51?s=96&d=mm&r=g","caption":"icclab"},"url":"https:\/\/blog.zhaw.ch\/icclab\/author\/icclab\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts\/10931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/users\/486"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/comments?post=10931"}],"version-history":[{"count":6,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts\/10931\/revisions"}],"predecessor-version":[{"id":12488,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/posts\/10931\/revisions\/12488"}],"wp:attachment":[{"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/media?parent=10931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/categories?post=10931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/tags?post=10931"},{"taxonomy":"features","embeddable":true,"href":"https:\/\/blog.zhaw.ch\/icclab\/wp-json\/wp\/v2\/features?post=10931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}