Created
March 9, 2021 09:06
-
-
Save r10r/d940d4d5f786c0165719e992d75ce48b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# enable debug logging | |
set -x | |
# abort if subshell command exits non-zero | |
set -e | |
. $(dirname $(readlink -f $0))/utils.sh | |
CRIO_LXC_BUILD_DEPS="musl musl-tools libc6-dev pkg-config git wget make ca-certificates" | |
install_cni() { | |
https://github.com/containernetworking/plugins/releases/download/v0.9.1/cni-plugins-linux-amd64-v0.9.1.tgz | |
} | |
install_crio() { | |
} | |
install_kubernetes() { | |
ARCH="linux-amd64" | |
RELEASE="1.20.1" | |
ARCHIVE=kubernetes-server-$ARCH.tar.gz | |
CHECKSUM="0a5ff7082b9bd54592697ec9c4ea75e1be80de712823e5b76687a5a110c392e3e8cd88adbc5715cc39537143e7656b40a3f36e550183c8fa7215dc882d2bf61a" | |
DESTDIR="/usr/local/bin" | |
wget https://dl.k8s.io/v$RELEASE/$ARCHIVE | |
echo "$CHECKSUM $ARCHIVE" | sha512sum -c | |
tar -x -z -f $ARCHIVE -C $DESTDIR --strip-components=3 \ | |
kubernetes/server/bin/kubectl kubernetes/server/bin/kubeadm kubernetes/server/bin/kubelet | |
cat > /etc/systemd/system/kubelet.service <<-EOF | |
[Unit] | |
Description=kubelet: The Kubernetes Node Agent | |
Documentation=http://kubernetes.io/docs/ | |
[Service] | |
ExecStart=$DESTDIR/kubelet | |
Restart=always | |
StartLimitInterval=0 | |
RestartSec=10 | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
install -v kubelet.service /etc/systemd/system/ | |
install -v -D 10-kubeadm.conf /etc/systemd/system/kubelet.service.d/10-kubeadm.conf | |
#systemctl daemon-reload | |
systemctl enable kubelet.service | |
} | |
apt_install systemd | |
install_golang | |
install_crio | |
install_kubernetes | |
uninstall_golang | |
apt_clean $CRIO_LXC_BUILD_DEPS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment