Note: This document is deprecated
In this document we will create a kubernetes cluster with Ubuntu 18.04 servers and Hyperkube, It’s a multi master cluster.
Requirements
- Two Ubuntu 18.04 as master
- Two Ubuntu 18.4 as worker
- Minimum 2 core vCPU per server
- Minimum 2 GB RAM per server
PreConfiguration
Setup DNS resolver for servers in own client
Setup date/time in all servers
Setup DNS resolver for servers in all servers
Setup bridge netfilter and IP forwarding
Create cerficates
Login to first master with ssh
Create openssl configuration
Create kubernetes CA certificate
Create kube apiserver certificate
Create apiserver kubelet client certificate
Create admin client certificate
Create service account key
Create kube-scheduler certificate
Create front proxy CA certificate
Create front proxy client certificate
Create kube-proxy certificate
Create etcd CA certificate
Create etcd certificate
Create etcd peer cert
View created certificates
Copy certificates to another controller
Install binaries
Install these binaries in all controllers
Generate kubernetes configs
Generate kubeconfig files on all controller nodes
Create service account kubeconfig
Create kube-scheduler kubeconfig
Create admin kubeconfig
Deploy etcd
Do this in first conroller
Install etcd binaries
Create systemd for etcd
Verify etcd is working
With etcdctl command
Verify etcd is working with openssl
Create systemd for Kubernetes API Server
Do this in all controllers
Create systemd for Kubernetes Controller Manager
Do this in all controllers
Create systemd for Kubernetes Scheduler
Do this in all controllers
Verify the controllers
Do this in all controllers
Create kubectl bash completion
Do this in all controllers
Generate bootstrap token
Do this in one of controllers and save TOKEN_PUB, TOKEN_SECRET and BOOTSTRAP_TOKEN in secured places
Create bootstrap kubeconfig
Do this in one of controllers
Expose CA and bootstrap kubeconfig via configmap
Do this in one of controllers
Make sure the bootstrap kubeconfig file does not contain the bootstrap token
before you expose it via the cluster-info configmap.
Allow anonymous user to acceess the cluster-info configmap.
Do this in one of controllers
Allow a bootstrapping worker node join the cluster.
Do this in one of controllers
Install Docker
Do this in all of servers
Edit docker systemd file and check ExecStart to
Then restart docker’s systemd
Install Kubernetes binaries in workers
Do this in all of workers
Retrieve CA and the bootstrap kubeconfig
Do this in all workers
Now write previously generated BOOTSTRAP_TOKEN to the bootstrap kubeconfig
Install CNI plugins
Do this in all servers
Need to find latest version
Create systemd for Kubernetes Kubelet
Do this all of server
For master nodes do
For worker nodes do
Make controller nodes unschedulable by any pods
Install kube-proxy
Create a kube-proxy service account in one of controllers
Create a kube-proxy kubeconfig
Bind a kube-proxy service account (from kube-system namespace) to a clusterrole system:node-proxier to allow RBAC
Copy kube-proxy.kubeconfig to workers
Create systemd for kube-proxy
Deploy Calico
Do this in one of controllers
Deploy kube-DNS
Do This in one of controllers
YOUR WELCOME :-)