Posts

Showing posts from July, 2018

Packer to Create Docker

Image
It is simple to create Docker from Packer. In this example I will show you how to create open JDK 8 installed Docker image. First you have to create a packer.json file: { "builders": [ { "name": "docker", "type": "docker", "image": "centos:7", "commit": true } ], "provisioners": [ { "type": "ansible", "playbook_file": "playbook.yaml" } ], "post-processors": [ { "type": "docker-tag", "repository": "ojitha/java8", "tag": "0.0.1" } ] } Here the playbook.yaml which will provision the docker instance: --- - hosts: all tasks: - name: message debug: msg="Container - {{ inventory_hostname }} running {{ ansible_distribution }}" - name: install the latest version of open jdk

Hands dirty with Kubernetes

Image
The smallest entity Kubernetes can manage is pod: specification of how to run the containers. The pod have network and the storage. Identical Pods can be in a collection called replicas set. Replicaset guarantee the availability of the deployment. However, Kubernetes cannot handle services as well as deployment. Through the services, deployment is exposed. Same Kubernetes host, there can be number of Pods, the namespace define the group of pods belongs to each other: guarantee the secure environment. Architecture . Following are running in the very well defined processes Head Node Worker Node Head Node API server scheduler- Place the containers where need to go Controller Manager- state of the system Etcd-Data store to store the state Kubelet docker Worker Node Kubelet is Kubenetes agent runs on all the cluster nodes Talks to API and local docker demon to manage the docker containers. Kube-proxy manage the trafie of the PODS and the node docker Install