Kubernetes Container Orchestration

 

Kubernets Site

Kubernets Documentation

Overview

Setup

Note : I am running Kubernets on my Windows 10 desktop utilizing Minikube.  Most of the command seen here will either work for both or be specific to MiniKube.  I will add production commands as I either run across them or learn them.

I followed this walkthru to setup Kubernetes on my Windows 10 server.

  1. Download MiniKube - Why?
  2. Download Kubectl.exe - MiniKube uses. - Why?
  3. Start the MiniKube and allow it to create a VM for you - Defaults to Virtualbox will need to specify Hyperv - minikube start --vm-driver 'hyperv' --v=7 --alsologtostderr
  4. Configuration Settings are in users profile under .MiniKube

Production Setup

https://kubernetes.io/docs/setup/independent/install-kubeadm/ 

Kubernetes needs a master installed on a Linux VM to control the nodes and containers.

  1. Create VM with Ubuntu
    1. Best Practices for Linux on Hyper-v                                   https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/best-practices-for-running-linux-on-hyper-v 
  2. Install Docker
  3. Install Kubeadm, kubelet and kubectl
    1. sudo apt-get update
    2. sudo apt-get install -y apt-transport-https curl
    3. sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
    4. sudo cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list > /dev/null
      1. this command is different than on the web because we need to run the redirection as sudo and the > operator doesn't allow that.  So the TEE command is used.  
    5. deb http://apt.kubernetes.io/ kubernetes-xenial main
    6. EOF
    7. sudo apt-get update
    8. sudo apt-get install -y kubelet kubeadm kubectl
    9. sudo apt-mark hold kubelet kubeadm kubectl
  4. Initailize the master
    1. https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#whats-next
    2. Install a Pod network Add-on
      1. https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network 
      2. Good Info on choosing: https://chrislovecnm.com/kubernetes/cni/choosing-a-cni-provider/ 

 

Dashboard

Kubernetes Dashboards

The dashboard is an overview of applications running on your Kubernetes cluster.  You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster itself along with its attendant resources

Enter the following to open the dashboard

MiniKube Dashboard

Troubleshooting

Error : You must be logged in to the server (the server has asked for the client to provide credentials)

Kubectl needs to be connected to the correct Kubernetes cluster.  This is done via a config file that sets the correct context for the cluster.  If this is not set correctly you can get the above error.  Behind the scenes in your %HOMEPATH%\.kube directory, there is a config file that contains information about your Kubernetes cluster and the details for connecting to your various clusters is present over there.

To set the context

kubectl config use-context minikube