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

kubeadm cluster
2021.09 instructions from Kubernetes.io instruction on installing a cluster: Official setup doc

Kubectl
-------

This is command line tool to interact with cluster.  
Should be easy to install, for Linux, etc.  
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

Kubelet
-------

This is the daemon process that run on the worker nodes.  
Think slurmd on compute notes here.

Inbound ports: 
- 10250        kubelet API
- 30000-32767  NodePort Services†

There are version requirements:  
- Kubelet can NOT be newer than KubeAdm.  
- Kubelet can be 1 minor release behind KubeAdm.

Kubeadm
-------

Control workers, create cluster.  the real orchestrator.
Can get RHEL, Debian binaries.  Google host a yum repo for rpm.  
Non-package manager binaries available via github.


Etcd... API server...


Network
-------

additional vlan creation manageable via kubeadm would be nice for growth.
But for a small/static deployment, switch control by kubeAdm not needed.
A private network still need to be setup and used by kubernetes.

Container runtimes
  • Docker used to be the standard. But in 2020.12, the "dockershim" is being deprecated by kubernetes.
    Kubernetes 1.20 still supports it, with a warning.
    Kubernetes 1.22 (released 2021-08) maybe last version supporting dockershim.
    Kubernetes 1.23? will only support CRI at that point? Will docker support CRI by this point?
    Another company will provide a dockershim-ed version of kubernetes, at support expense?
  • CRI-O maybe the new container substrate Google is pushing for.
  • podman does not work with Kubernetes, so RHEL 8 maybe an issue. Should be able to install Docker via non OS provided rpm.
  • containerd, supported. Developed by Docker, use OCI image format, and supports CRI. Docker currently comes with this (in addition to docker), and it is the only "dual container" env that Kubeadm will support without erroring out during install.
  • Singularity not mentioned in Kubernetes.io site.
    Sylabs doc says it support is via CRI standard interface. See
  • See Diff b/w Docker, containerD, CRI-O and runc at Tutorial Works on the many nuance of the container stack.
    Ref
    2020:
    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, Free to run, Premium for support service. A Guide to Kubernetes with Rancher (sale brochure from 2021) page 11 states: Commitment-Free Open Source. No different binary for Free vs Enterprise. Just pay for support. (install over existing kubernetes cluster, so just provide GUI, view, management, but not an actual kubernetes cluster?
    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://tin6150.github.io/psg/k8s.html]

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


    hoti1
    bofh1