Posts

Taints and Tolerations in Kubernetes

Image
              We all know that Kubernetes is powerful orchestration tool in the world of containers. The whole complexity of managing, distributing multiple containers across the cluster is being taken care Kubernetes OOB. In shorts it takes care of all the heavy and complex lifting for us. Since, its K8S who takes care of all distribution and scheduling of pods across different nodes in the cluster. So, what we if we want to run specific pod on specific node only. Luckily we have option to manage this as well. In K8S its called " taint and toleration ". In general terms:         - Taint is the capability of the node which makes node to do not let any pod to be scheduled on it.         - On the other hand, Toleration is another capability makes that particular pod to be tolerated by specific Node. To summarise, Taint and Toleration are used to set restrictions on the what po...

Terraform setting up clustered web server !! Getting Started Part-3!!

Image
Last two posts first we saw the basics of terraform " Part-1 " and then created simple web server " Part-2 ".  Now as we know that running single web server in production is never a good idea. We always need services which should be highly available as well as should be scalable as per the requirements. Creating and managing a cluster always going to be a pain point. Fortunately  with new cloud technologies now its possible to automate all this and things will be much easier to manage. In this tutorial we'll use AWS's "Auto Scaling Group (ASG)".     An ASG takes care of everything automatically, including launching a cluster of EC2 instances , monitoring the health of each instance, replacing the failed instances and adjusting the size of cluster in response to the load. A full working ASG stack include multiple resources to make a working cluster. It starts with " launch configuration " which basically specify how a ...

Terraform setting up simple web server !! Getting Started Part-2!!

Image
In our last post " Getting started with terraform ", we just learn how to launch a simple EC2 instance in AWS. In this article we will dig more and will try to create a simple web server and try to access that. Architecture - We are not installing proper web-server, its just a hack. Using busybody to launch http process. #!/bin/bash echo "Hello, World" > index.html nohup busybox httpd -f -p 8080 & resource "aws_instance" "example" { ami = "ami-0cfee17793b08a293" instance_type = "t2.micro" user_data = << - EOF // Together #!/bin/bash echo "Hello, World" > index . html nohup busybox httpd -f -p 8080 & EOF tags = { Name = "terraform-example" } } The << - EOF (together)  and  EOF  are Terraform’s  heredoc  syntax, which allows...

Getting started with terraform

Image
What is Terraform -                                Ok, so Terraform is Open-Source Infrastructure-as-Code (IAC) software tool which created by HashiCrop . The idea behind IAC is to define, deploy, update and destroy your infrastructure without any much difficulties. The main idea behind this is to treat everything as a code. No matter what it is.  In this article, I am going in deep to explain about the software and compare this with other lots of available tool sets which together can be replaced this e.g. ansible, chef, puppet, salt, CloudFormation, ARM etc.  In this specific article, I'll just show how easily we can launch a basic EC2 instance with a small code set. Terraform is simple binary which you can download and put that in your path.  Below is the main architecture diagram which we are going to simulate. Create a file "main.tf" where tf stand...

Kubernetes Access Control Overview and setup up RBAC in Kubernetes Cluster

Image
You may have already seen lots of articles discussing about RBAC implementation in Kubernetes Cluster. In this article I am sharing the basic RBAC implementation which I have tested on my local Kubernetes cluster using  Minikube . Below are the details about  Minikube and  Kubectl , I am using for this test. Kubernetes Basic Architecture -  In Kubernetes, you must be authenticated (or logged in) before your request can be authorized (granted permission to access). You can go through official documentation for more details  Accessing Control Overview . There are two types for requests made to Kubernetes API-Serve one is the external request made by human being and another is internal from pod using service accounts.  In this post we'll discuss about first type. Note that external users not stored in Kubernetes, these will be stored somewhere in external system and there are multiple type of authentications. We...