KUBERNETES! Let’s take it easy…

Gabriel Augusto da Costa
Quick Mobile Labs
Published in
3 min readFeb 22, 2017

Our last article about Kubernetes was kind of rush, so let’s take it easy…

What the hell is kubernetes?

“Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure.”

Take it easy goddammit!

Ok, sorry… :(

Kubernetes is a PaaS (Platform as a Service) developed by Google to simplify applications management across multiple hosts in a cluster. Its main objective is to facilitate the deployment of applications based on microservices. Kubernetes was based on Google’s experience of many years working with containers, adapting it to work with Docker.

In order to understand it better, we need some definitions:

  • Minions: it’s every host in the cluster. (No, there’s nothing to do with the yellow ones from the movies. ba dun tiss)
  • Kubelet: an agent who runs on every host.
  • Pods: it is nothing more than containers running within its cluster of Kubernetes.
  • Replication Controller: you tell the RC (Replication Controller xD) how many containers you want to be running (kind of a scale), and its responsibility is to take care of them. In case one falls, the RC creates another automatically.
  • Services: it’s responsible for linking an IP range to a particular CR. Thanks to these services, each time the RC creates a new instance of the pod, it starts with an IP determined by the service.
  • Namespace: using namespace you can split your Kubernetes Cluster into environments like Production, Staging, Development and you can also limit the computational resources.

We’ve had enough of this! Let’s up this things in practice!

There’s an awesome “Hello World”:

https://kubernetes.io/docs/tutorials/kubernetes-basics/

Everything is online, there’s no need for installation or some kind of configuration to raise the environment. :O

In every module, the tutorial will give you some information and then a terminal to put everything in practice.

Ohh! You’re back! Now you understand Kubernetes right? Kind of? Follow me!

Why should I use this thing?

At a minimum, Kubernetes can schedule and run application containers on clusters of physical or virtual machines. However, Kubernetes also allows developers to ‘cut the cord’ to physical and virtual machines, moving from a host-centric infrastructure to a container-centric infrastructure, which provides the full advantages and benefits inherent to containers. Kubernetes provides the infrastructure to build a truly container-centric development environment.

Kubernetes also provides load balancing, service discovery, auto-scaling, health checking and a lot of other things you need in your microservices architecture.

How do I set this up? This thing is kind of hard…

if(i_use_google_cloud):

  • Well, then is kind of simple, one or two clicks and our environment is done. You “just” need to deploy your applications.

else:

  • It’s not that hard. You need to install the kubectl on your cluster’s nodes, then you are able to deploy your applications.

Of course, a change in your company’s architecture takes a lot of time and effort, so make sure Kubernetes is for you! There’s a lot of other tools like Mesos or Docker Swarm, test them! Choose the one you’re liked the most or the easiest one.

--

--