Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Top 10 Container(Docker) Monitoring Solutions and Tools in 2018

Top 10 Container Monitoring Solutions/Tools in 2018

  1. Native Docker
  2. cAdvisor
  3. Scout
  4. Pingdom
  5. Datadog
  6. Sysdig
  7. Prometheus
  8. Heapster / Grafana
  9. ELK stack
  10. Sensu

Reference

https://rancher.com/comparing-10-container-monitoring-solutions-rancher/

Tagged : / / / /

What is EKS and How EKS can help you?

In simple line, Amazon EKS is generally available, bringing fully-managed Kubernetes to AWS.

Amazon launched Amazon EKS in November at its re:Invent 2017 conference. Till the time this article is written, Amazon EKS is available in the US East (N. Virginia) and US West (Oregon) Regions only.

The cost of running EKS is $0.20 per hour for the EKS Control Plane, apart from EC2, EBS, and Load Balancing prices for resources that run in your account.

How does Amazon EKS work?

Amazon EKS works by provisioning (starting) and managing the Kubernetes control plane for you. At a high level, Kubernetes consists of two major components – a cluster of ‘worker nodes’ that run your containers and the control plane that manages when and where containers are started on your cluster and monitors their status.

Without Amazon EKS, you have to run both the Kubernetes control plane and the cluster of worker nodes yourself. With Amazon EKS, you provision your cluster of worker nodes using the provided Amazon Machine Image (AMI) and AWS CloudFormation script and AWS handles provisioning, scaling, and managing the Kubernetes control plane in a highly available and secure configuration. This removes a significant operational burden for running Kubernetes and allows you to focus on building your application instead of managing AWS infrastructure.

Major Features of Amazon Elastic Container Service for Kubernetes (EKS)
Amazon Elastic Container Service for Kubernetes (EKS) is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane.

  1. Availability and Scalability of Nodes – Amazon EKS automatically manages the availability and scalability of the Kubernetes control plane nodes that are responsible for
    1. Starting and stopping containers,
    2. Scheduling containers on virtual machines,
    3. Storing cluster data, and other tasks.
  2. Health check of Nodes – Amazon EKS Automatically detects and replaces unhealthy control plane nodes for each cluster.
  3. Amazon EKS Integration – Great Integration with AWS networking and security services, such as Application Load Balancers for load distribution, IAM for role based access control, and VPC for pod networking.
  4. Managed Kubernetes Control Plane – Amazon EKS provides a scalable and highly-available control plane that runs across multiple AWS availability zones.
  5. Kubernetes Masters in three Availability Zones – Amazon EKS runs the Kubernetes control plane across three Availability Zones in order to ensure high availability, and it automatically detects and replaces unhealthy masters.
  6. Amazon EKS with IAM Authentication – Amazon EKS integrates Kubernetes RBAC (the native role based access control system for Kubernetes) with IAM authentication through a collaboration with Heptio. You can assign RBAC roles directly to each IAM entity allowing you to granularly control access permissions to your Kubernetes masters.
  7. Amazon EKS with VPC Support
    Your EKS clusters run in an Amazon VPC, allowing you to use your own VPC security groups and network ACLs. No compute resources are shared with other customers. This provides you a high level of isolation and helps you use Amazon EKS to build highly secure and reliable applications.
  8. Container Interface – EKS uses the Amazon VPC CNI to allow Kubernetes pods to receive IP addresses from the VPC means The Container Network Interface for Kubernetes uses Elastic Network Interfaces to provide secondary IP addresses for Kubernetes Pods.
  9. Amazon EKS Logging
    Amazon EKS is integrated with AWS CloudTrail to provide visibility and audit history of your cluster and user activity. You can use CloudTrail to view API calls to the Amazon EKS API.
  10. Amazon EKS with EBS – Kubernetes PersistentVolumes (used for cluster storage) are implemented as Amazon Elastic Block Store (EBS) volumes.
  11. Amazon EKS with Route 53 – The External DNS project allows services in Kubernetes clusters to be accessed via Route 53 DNS records. This simplifies service discovery and supports load balancing.
  12. Amazon EKS Support – Amazon EKS runs up-to-date versions of the open-source Kubernetes software, so you can use all the existing plugins and tooling from the Kubernetes community.

Reference
EKS Getting Started Guide
EKS Publication
EKS FAQ

Tagged : / / / / / /

Lifecycle of Docker Containers

We need to carefully understand the life cycle of Docker containes. There are following images which depicts the the right phases of docker containers.

Phase of Docker Containers

  • Create -> Destroy
  • Create -> Start -> Stopped -> Destroy
  • Create -> Start -> Pause -> Unpause
  • Create -> Start -> Restart

Image flow of Simple Docker Container Lifecycle

Image flow of Detailed Docker Container Lifecycle

 

Image Source and Credits: http://docker-saigon.github.io/post/Docker-Internals/

Create container
$ docker create –name ubuntu-cont ubuntu

Run docker container
$ docker run -itd ubuntu
$ docker run -itd –name ubuntu-cont ubuntu

Pause container
$ docker pause <container-id/name>

Unpause container
$ docker unpause <container-id/name>

Start container
$ docker start <container-id/name>

Stop container
$ docker stop <container-id/name>

Restart container
$ docker restart <container-id/name>

Kill container
$ docker kill <container-id/name>

Destroy container
$ docker rm <container-id/name>

Tagged : / / /

Understanding the tools sets in kubernetes ecosystem

Kubernetes at Public Cloud

  1. Google Container Engine – Google Kubernetes Engine is a powerful cluster manager and orchestration system for running your Docker containers.
  2. ECS – Amazon Elastic Container Service (Amazon ECS) is a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster.
  3. EKS – Amazon Elastic Container Service for Kubernetes (Amazon EKS) makes it easy to deploy, manage, and scale containerized applications using Kubernetes on AWS.

Kubernetes cli tools

  1. kubectl – Main CLI tool for running commands and managing Kubernetes clusters.
  2. JSONPath – Syntax guide for using JSONPath expressions with kubectl.
  3. kubeadm – CLI tool to easily provision a secure Kubernetes cluster.
  4. kubefed – CLI tool to help you administrate your federated clusters.
  5. Minikube – This is the simplest way to get a Kubernetes cluster on your Mac or Windows machine.
  6. Kops – kops helps you create, destroy, upgrade and maintain production-grade, highly available, Kubernetes clusters from the command line. AWS (Amazon Web Services) is currently officially supported, with GCE in beta support , and VMware vSphere in alpha, and other platforms planned.

kubernetes config reference

  1. kubelet – The primary node agent that runs on each node. The kubelet takes a set of PodSpecs and ensures that the described containers are running and healthy.
  2. Container runtime – Container runtime is Docker engine which resides in each node
  3. kube-proxy – Can do simple TCP/UDP stream forwarding or round-robin TCP/UDP forwarding across a set of back-ends.

Cluster control plane (AKA master)

  1. kube-apiserver – REST API that validates and configures data for API objects such as pods, services, replication controllers.
  2. Cluster state store – All persistent cluster state is stored in an instance of etcd. This provides a way to store configuration data reliably.
  3. kube-controller-manager – Daemon that embeds the core control loops shipped with Kubernetes.
  4. kube-scheduler – Scheduler that manages availability, performance, and capacity.
  5. Federation – A single Kubernetes cluster may span multiple availability zones.
  6. federation-apiserver – API server for federated clusters.
  7. federation-controller-manager – Daemon that embeds the core control loops shipped with Kubernetes federation

Kubernetes Add ons

  1. DNS
  2. Ingress controller
  3. Heapster (resource monitoring)
  4. Dashboard (GUI)
Tagged : / / / / / / / / / / / / / / /

Simple Docker workflow – Quick start | Docker Tutorial

docker-workflow
Simple Docker workflow – Quick start
In this tutorials, I am trying to cover the simple quickstart Docker workflow and for the example, I am creating Ubantu containee and using it to showcase this tutorial.
Step 1 – Download the Ubantu image container from the Docker Hub
# docker pull -a ubuntu
Step 2 – Run the ubuntu container and access to ther /bin/bash commands prompt
# docker run -it ubuntu /bin/bash
Step 3 – Stop the container 
# docker stop container_id
How to get the container id?
# docker ps -a
Step 4: Start the container again?
# docker start container_id
Step 5: Exit the running container without stopping the container
# exit
Step 6: Login the running container for bash prompt
# sudo docker exec -i -t 2e56ad1705b1 /bin/bas
For more – Refer 
Tagged : / / / / / / / / /

How to get bash or ssh into a running container in background mode?

bash-or-ssh-into-a-running-container
How to get bash or ssh into a running container in background mode?
Step 1: First of all, try to find your active container by running
# docker ps
or
# docker ps -a
Step 2: If the container is not running,
# docker start your_id
Step 3: If we use attach we can use only one instance of shell.
# sudo docker attach 665b4a1e17b6 #by ID
or
# sudo docker attach loving_heisenberg #by Name
If we want open new terminal with new instance of container’s shell, we just need run the following:
# sudo docker exec -i -t 2e56ad1705b1 /bin/bash #by ID
or
# sudo docker exec -i -t loving_heisenberg /bin/bash #by Name
# root@665b4a1e17b6:/#
Step 4: To exit bash without leaving bash running in a rogue process
# exit
Notes:
A reminder for boot2docker users: remove sudo
If you are using docker in Linux, you will have to use sudo along with docker commands.
You should try not to run commands as sudo, rather add your user to the docker group and just run normally.
Tagged : / / / / / / / /