Skip to main content

Posts

Showing posts with the label docker

Installing Kubernetes 1.8.1 on centos 7 with flannel

Prerequisites :- You should have at least two VMs (1 master and 1 slave) with you before creating cluster in order to test full functionality of k8s. 1] Master :- Minimum of 1 Gb RAM, 1 CPU core and 50 Gb HDD     ( suggested ) 2] Slave :- Minimum of 1 Gb RAM, 1 CPU core and 50 Gb HDD     ( suggested ) 3] Also, make sure of following things. Network interconnectivity between VMs. hostnames Prefer to give Static IP. DNS entries Disable SELinux $ vi /etc/selinux/config Disable and stop firewall. ( If you are not familiar with firewall ) $ systemctl stop firewalld $ systemctl disable firewalld Following steps creates k8s cluster on the above VMs using kubeadm on centos 7. Step 1] Installing kubelet and kubeadm on all your hosts $ ARCH=x86_64 $ cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-${ARCH} enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yu...

Docker - Ubuntu - bash: ping: command not found

Docker images are pretty minimal, But you can install  ping  in your official ubuntu docker image via: apt-get update apt-get install iputils-ping Chances are you dont need  ping  your image, and just want to use it for testing purposes. Above example will help you out. But if you need ping to exist on your image, you can create a  Dockerfile  or  commit  the container you ran the above commands in to a new image. Commit: docker commit -m "Installed iputils-ping" --author "Your Name <name@domain.com>" ContainerNameOrId yourrepository/imagename:tag Dockerfile: FROM ubuntu RUN apt-get update && apt-get install -y iputils-ping CMD bash

Install kubernetes on Centos/RHEL 7

Kubernetes is a  cluster  and  orchestration  engine for docker containers. In other words Kubernetes is  an open source software or tool which is used to orchestrate and manage docker containers in cluster environment. Kubernetes is also known as k8s and it was developed by Google and donated to “Cloud Native Computing foundation” In Kubernetes setup we have one master node and multiple nodes. Cluster nodes is known as worker node or Minion. From the master node we manage the cluster and its nodes using ‘ kubeadm ‘ and ‘ kubectl ‘  command. Kubernetes can be installed and deployed using following methods: Minikube ( It is a single node kubernetes cluster) Kops ( Multi node kubernetes setup into AWS ) Kubeadm ( Multi Node Cluster in our own premises) In this article we will install latest version of Kubernetes 1.7 on CentOS 7 / RHEL 7 with kubeadm utility. In my setup I am taking three CentOS 7 servers with minimal installation. One server will acts master node and rest two serve...

Chef: Test Kitchen

Install docker with the following command: yum install docker systemctl start docker Then we need to install the kitchen-docker ruby gem. chef gem install kitchen-docker Create a cookbook: chef generate cookbook my_cookbook Edit the .kitchen.yml file in the generated cookbook. Change the driver name from vagrant to docker and delete the line - name: centos-7 Save and close. Then execute kitchen converge . This command will create a docker container for us and put all the settings in place. The output will be something as follows: Synchronizing Cookbooks: - my_cookbook (0.1.0) Installing Cookbook Gems: Compiling Cookbooks... Converging 0 resourcesRunning handlers: Running handlers complete Chef Client finished, 0/0 resources updated in 18 seconds Finished converging <default-ubuntu-1604> (7m3.52s). Then run kitchen list The output will be something as follows: Instance Driver Provisioner Verifier Transport Last Action Last Error default-ubuntu-1604 Docker ChefZero Ins...

Docker Security

Docker contaniners share the kernel wth the machine they are running on. If any of the containers starts using up more resources like CPU, RAM the other containers might run ino /do/s issue. The attack can break out from a container into the host  machine or other containers. Make sure that the images coming from dockerhub are from trusted sources. You should be careful with what secrets you store in your containers. You can use the commands: docker network disconnect nh nh is the name of the container. This will disconnect your containers from the network and they will be inaccessible. docker diff Docker diff will show you which files have been modified. If you do not want external invalid/destructive files to modify your containersthen you can make your containers read-only Specify --read-only option while running your container.