music orchestra from http://newmusicresource.blogspot.com/2014/12/music-secrets-music-school-survival.html

Container Orchaestration

Container/pod operations: Docker vs Kubernetes vs Rancher

			Docker/EE		k8s			Rancher
			====================	======================	===================
version						kubectl version		
env info		docker info		kubectl cluster-info	rancher environment

Get image from registry	docker pull
List images		docker images -a				
Remove images		docker rmi IMG		
Build image		docker image build
Push img to registry	docker image push 

Start a container/pod	docker run 		kubectl run		rancher stack create 
Restart/Upgrade a pod 	docker start		kubectl apply -f yml	rancher up 
List running pods	docker ps		kubectl get pods	rancher ps
Stop container		docker stop
Clear container		docker rm NAME		kubectl delete deployments --all (?)

Get container's logs	docker logs		kubectl logs		rancher logs
Shell into container	docker exec -it 	kubectl exec -it	rancher exec -it 	# all docker stuff, -it for interactive terminal


Kubernetes

minikube start			# single node for very simple dev, http://localhost:8080 

kubectl version
kubectl cluster-info
kubectl cluster-info dump
source <(kubectl completion bash)  	# enable bash autocompletion  #>#  maybe add to .bashrc


kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
kubectl expose deployment hello-minikube --type=NodePort

kubectl get pod
curl $(minikube service hello-minikube --url)


# see docker process/container that is running inside the pod (eg VirtualBox)
eval $(minikube docker-env)
docker ps


minikube dashboard	# will launch a browser to eg 
http://192.168.99.100:30000/#!/overview?namespace=default

minikube ip
minikube service list

minikube stop

kubeadm

Ref
  1. What is Kubernetes? concise intro by RH
  2. Kubernetes clustering choices
    Kubeadm (Baremetal on CentOS)
    Fedora multi-node
  3. Create Custom Kubernetes Cluster from Scratch
  4. Kubespray: Kubernetes On-prem and cloud (as opposed to Kops or Kubeadm)
  5. Large (100+) deploymnents of K8s recommendations.
  6. Kubernetes on DC/OS (Medosphere)

Rancher

  1. Rancher is open source, premium for support service.
  2. RanchOS is a lightweight OS for hosting containers.
  3. Install trivially as a docker container.

# create an app stack (list of containers) to be run together 
# StackName is a directory containing docker compose yaml definition file listing all necessary containers
rancher stack create  StackName				

# redeploy a running application as per new spec (eg version upgrade)
rancher up --force-upgrade -d --stack  StackName 

# confirm upgrade (why was this needed?)
rancher up --confirm-upgrade -d --stack StackName

# look at logs of serverice.  web is the name of a service in the demo stack
rancher logs StackName/web

# scale the service "web" to have 2 instances:
rancher scale StackName/web=2

# get shell into container (will ask when when there are 1+ instance)
# largely same as docker exec
rancher exec -it StackName/web /bin/bash

Container Landscape

cncf.io lanscape chat circa 2018. (They have "interactive" view online, but that's mostly a dynamic list of links, don't give big picture view).




[Doc URL: http://tin6150.github.io/psg/k8s.html]
[Doc URL: http://psg.ask-margo.com/k8s.html]

(cc) Tin Ho. See main page for copyright info.


hoti1
bofh1