Experimental kubectl
(Kubernetes CLI) plugin which provisions an node with kubeadm
from zero.
It's best practice to manage server configurations with some configuration management tool (Ansible, etc.), but sometimes you just want to connect an existing server to Kubernetes cluster quickly and easily.
kubeadm
do the heavy job for joining the node to the cluster, but before that, you need to install container runtime, kubelet and kubeadm.
kubectl provision node
will:
- Install required packages (runtime, kubelet, kubeadm)
- Get Kubernetes bootstrap token
- Joins the node to the target cluster with kubeadm.
brew install rsync ernoaapa/kubectl-plugins/provision
- Install rsync with your preferred package manager
- Download
kubectl-provision
binary from releases - Add it to your
PATH
When the plugin binary is found from PATH
you can just execute it through kubectl
CLI
kubectl provision node --help
- Golang v1.11
- Go mod enabled
You need to have following flags in your Kubernetes master to be able to join with bootstrap tokens
# kube-apiserver
--enable-bootstrap-token-auth=true
# kube-controller-manager
--controllers=*,bootstrapsigner,tokencleaner
Start the test node
vagrant up
Install and join the Vagrant VM to your Kubernetes cluster
go run ./main.go node -- -F =(vagrant ssh-config) node-1