How to set up a kubernetes worker node on deepthot
Hopefully this is going to be easy peasy since I already have kubernetes on deepthot
So, I created a VM 4 core 8 gig 16 gig. Installed ubuntu 18.04 btrfs. Joined to deepthot.aa. Docker as outlined in the abovelinked blog post. Name k8s-worker-1. Wow, that was really easy. I got my config working flawlessly.
Tried kubeadm and kubectl as snaps. No go. I did notice that docker was still running on btrfs, boo. Restarted docker. I need to install docker-ce, kubeadm, kubectl, and kubelet per the instructions in yesterday’s blog.
If you don’t have a local artifactory set up
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
add-apt-repository -n \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
add-apt-repository \
"deb http://apt.kubernetes.io/ kubernetes-xenial main"
If you do have a local artifactory set up
curl -fsSL http://artifactory:8081/artifactory/docker-download/linux/ubuntu/gpg | apt-key add -
curl http://artifactory:8081/artifactory/google-packages/apt/doc/apt-key.gpg | apt-key add -
add-apt-repository -n \
"deb [arch=amd64] http://artifactory:8081/artifactory/docker-download/linux/ubuntu \
$(lsb_release -cs) \
stable"
add-apt-repository \
"deb http://artifactory:8081/artifactory/google-packages/apt kubernetes-xenial main"
apt-get update && apt-get install apt-transport-https ca-certificates curl software-properties-common -y
apt full-upgrade docker-ce=18.06.2~ce~3-0~ubuntu {kubectl,kubelet,kubeadm}=1.15.5-00 kubernetes-cni -y --allow-downgrades -y
apt-mark hold docker-ce kubectl kubelet kubeadm
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
systemctl daemon-reload
systemctl restart docker
On the control node type kubeadm token create --print-join-command copy the output of the command and paste it into the worker node.
sudo kubeadm join cluster-endpoint:6443 --token blah --discovery-token-ca-cert-hash blah blah
[preflight] Running pre-flight checks
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.16" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Activating the kubelet service
[kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap...
This node has joined the cluster:
* Certificate signing request was sent to apiserver and a response was received.
* The Kubelet was informed of the new secure connection details.
And woot, tiller is on, so yay
Easy peasy
Written with StackEdit.
No comments:
Post a Comment