Docker - Kubernetes Readme
Docker - Kubernetes Readme
Docker - Kubernetes Readme
Various links to website has been added. Check them out for more detailed info.
Docker Readme
===================Getting Started Docker============================
1. Make Dockerfile
2. Build image using Dockerfile also use a tag
3. Run container using the image we have built
4. Test container
5. Push Image to docker registry
** Use docker run with -i option to run terminal inside docker container
===========================Docker Commands===========================
Running a Container:
To run a container in an interactive mode:
$ sudo docker run –it centos /bin/bash
see all the commands that were run with an image via a container:
$ docker history ImageID
to delete a container:
$ docker rm ContainerID
##Docker Compose
Docker Compose is used to run multiple containers as a single service.
1. https://hub.docker.com/_/ubuntu/
2. https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
3. https://docs.docker.com/engine/reference/builder/
4. https://docs.docker.com/get-started/
5. https://www.tutorialspoint.com/docker/index.htm
---------------------------------------------------------------------------------------------------------------------------------------------
Kubernetes Readme
===================Getting started kubernetes============================
============================Kubernetes Commands=====================
Starting node:
$ minikube start
In order to pull the image and create a container, we will run the following command:
$ kubectl create –f Tesing_for_Image_pull
Controls:
$ kubectl create –f pod.yml #Making Pods
$ kubectl get pods #Show running pods
$ kubectl get pod <Pod name>
$ kubectl describe pod <Pod name> ---->4
$ kubectl delete pod <Pod name>
============================Kubernetes References=======================
1. https://medium.freecodecamp.org/learn-kubernetes-in-under-3-hours-a-detailed-
uide-to-orchestrating-containers-114ff420e882 (Best)
2. https://www.tutorialspoint.com/kubernetes/index.htm
3. https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-
service-proxies
4. https://kukulinski.com/10-most-common-reasons-kubernetes-deployments-fail-part-
1/
5. https://deis.com/blog/2016/kubernetes-illustrated-guide/
6. https://kubernetes.io/docs/concepts/services-networking/service/
7. https://kubernetes.io/docs/concepts/storage/volumes/
==============================Services=============================
A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy
by which to access them - sometimes called a micro-service. The set of Pods targeted
by a Service is (usually) determined by a label selector.
==============================Volumes=============================
** Docker + Kubernetes
** Docker + Kubernetes
Note -
Change image pull back policy accordingly
============================Scale up or down===========================
===============================Rolling Update========================
We can have a zero downtime rolling update with kubernetes.
$ kubectl apply -f deploy-frontend-green-pods.yaml --record
===================================Roll Back=========================
1. https://stackoverflow.com/questions/47729304/create-kubernetes-pod-with-
mysql-and-php
2. https://stackoverflow.com/questions/29679661/connecting-tomcat-webapp-
running-in-docker-container-to-mysql
3. https://linoxide.com/containers/setup-mysql-kubernetes/
4. https://hub.docker.com/_/mysql/
https://www.katacoda.com/courses/kubernetes/storage-introduction
https://kubernetes.io/docs/tasks/run-application/run-replicated-stateful-
application/#simulating-pod-and-node-downtime
https://www.katacoda.com/courses/kubernetes/getting-started-with-kubeadm
https://kubernetes.io/docs/setup/independent/high-availability/#installing-
prerequisites-on-masters
https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
======================Managing Secrets and passwords==============
https://www.katacoda.com/courses/kubernetes/managing-secrets
=====================Kubeadm==================================
Kubeadm is multi node kubernetes cluster making tool. Using this tool we can make
master-worker architecture clusters.
Installing- https://kubernetes.io/docs/tasks/tools/install-kubeadm/
Guide - https://www.mirantis.com/blog/how-install-kubernetes-kubeadm/
Trying online - https://www.katacoda.com/courses/kubernetes/getting-started-with-
kubeadm
Using guide - https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/
--------------------------------------------------------------------------------------------------------------------------------------------