Test your deployments locally with minikube

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?

Read more

Persistent volumes with Rancher/Kubernetes on AWS

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.

I’ve bootstrapped ec2 instances with the last RancherOS version available on AWS, which is currently v1.0.2.

Read more

Hands on Kubernetes with kubeadm

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

Read more

Contact Us