From 494bd77ea57159313f8bb1786e606ab30aaf872c Mon Sep 17 00:00:00 2001 From: Sambo Chea <7059827+sombochea@users.noreply.github.com> Date: Sat, 9 Oct 2021 15:18:30 +0700 Subject: [PATCH] Install kubeadm kubelet and add as service --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a146fad..8632819 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,37 @@ EOF sudo sysctl --system ``` -# Install CNI plugins (required for most pod network) +# Install kubernetes tools +### Install CNI plugins (required for most pod network) ```shell CNI_VERSION="v0.8.2" ARCH="amd64" sudo mkdir -p /opt/cni/bin curl -L "https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz" | sudo tar -C /opt/cni/bin -xz ``` + +```shell +DOWNLOAD_DIR=/usr/local/bin +sudo mkdir -p $DOWNLOAD_DIR +``` + +### Install crictl (required for kubeadm / Kubelet Container Runtime Interface (CRI)) +```shell +CRICTL_VERSION="v1.17.0" +ARCH="amd64" +curl -L "https://github.com/kubernetes-sigs/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-${ARCH}.tar.gz" | sudo tar -C $DOWNLOAD_DIR -xz +``` + +### Install kubeadm, kubelet and add a kubelet systemd service +```shell +RELEASE="$(curl -sSL https://dl.k8s.io/release/stable.txt)" +ARCH="amd64" +cd $DOWNLOAD_DIR +sudo curl -L --remote-name-all https://storage.googleapis.com/kubernetes-release/release/${RELEASE}/bin/linux/${ARCH}/{kubeadm,kubelet} +sudo chmod +x {kubeadm,kubelet} + +RELEASE_VERSION="v0.4.0" +curl -sSL "https://raw.githubusercontent.com/kubernetes/release/${RELEASE_VERSION}/cmd/kubepkg/templates/latest/deb/kubelet/lib/systemd/system/kubelet.service" | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service +sudo mkdir -p /etc/systemd/system/kubelet.service.d +curl -sSL "https://raw.githubusercontent.com/kubernetes/release/${RELEASE_VERSION}/cmd/kubepkg/templates/latest/deb/kubeadm/10-kubeadm.conf" | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf +```