We are pleased to have had the opportunity to present a technical talk on Kubernetes and Rook.io at VoxxedDays this year!
I grant you, “Cloud Native” has something of a buzzword, but there is still a reality behind all that. A Cloud Native application leverages and takes advantage of Cloud features. And today, a native Cloud application likely to be cut into microservices, that these microservices turn in containers, and that these containers are orchestrated by Kubernetes.
But who has looked at these technologies in recent years is well aware of how fast they are evolving, which makes the technology watch even more relevant, but also more complicated, much more complicated. Indeed, where to find these new projects, how to follow them, how to evaluate their degree of maturity, is it time to adopt them to solve our production problems?
A chapter of the courses that I give demonstrates how easy it is to implement a multi-tier application on Rancher / Kubernetes (thanks to the Rancher Catalog). The recipe is the same, whether you are on Rancher 1.x or 2.0! The exercise also uses a storage driver that allows application deployment with persistent storage.
My application is on Github, it is simply an application in Node.js with a MongoDB backend, which displays “Hello MyApp from MongoDB!” in the browser when it is called on the route /myapp. To familiarize yourself a bit with Kubernetes, I decided to deploy this application directly on a cluster, with CLI.
You can use any K8s cluster, a deployed with Rancher, or with kubeadm (see my previous blog), or do it locally with kinikube. This is the last option that I chose because it allows to test our deployment locally. For the installation of minikube and kubectl, I invite you to read this tutorial.
If I consider that my application is a MongoDB backend and a Node.js frontend, what will I need in K8s? First of all a volume for persistence. With minikube, I use local storage. A volume claim, to make this volume available to MongoDB. A MongoDB deployment. One service, to make MongoDB available to other third parties. Another deployment for Node.js, as well as its service. And finally an ingress rule to access my application outside my cluster. I will even push the vice a little further by using a configMap for my Node.js environment varaibles (MongoDB URI). Ready?
Volume persistence in Kubernetes (and other orchestrators) is in full swing, and for good reason, Kubenetes is no longer satisfied today to be a stateless runtime environment, but also and more often stateful … Let’s see how with Rancher and AWS we may have volumes provisioned automatically.
High level architecture on AWS
For this blog I use a single group of ec2, all in the same security group, which allows all traffic between instances.
Passionate for Docker? Curious to learn more about Kubernetes, the Google orchestrator? Kubeadm is the solution! Kubeadm is a new tool to deploy painlessly kubernetes on Centos 7, Ubuntu 16.0′ or even Hypriot v1.0.1 on RPi! To learn more about kubeadm: http://kubernetes.io/docs/getting-started-guides/kubeadm/
In this technical blog, I’ll show you how to:
- Create four ec2 instances on AWS with Centos 7.2
- Install Docker on Centos with LVM devicemapper
- Install Kubernetes and Kubeadm on each instance
- Run your Master and join with the minion
- Launch your first nginx Pod
- Create your first Replication Controller
- Expose your Replication Controller with a Load Balancer Service