Public ungleich kubernetes repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nico Schottelius 4984b3c51a Add v1 (thanks to a good friend) 1 year ago
cilium Add v1 (thanks to a good friend) 1 year ago Add v1 (thanks to a good friend) 1 year ago
kubeadm-config.yaml Add v1 (thanks to a good friend) 1 year ago

Kubernetes on alpine linux

Note: the kubeadm and cilium config files where created for use with

Configure OS

sysctl -w net.ipv6.conf.all.accept_ra=2
sysctl -w net.ipv6.conf.all.forwarding=1
sysctl -w net.ipv4.ip_forward=1

modprobe br_netfilter

apk update
apk add ip6tables
apk add git

# for cilium
mount --make-shared /sys
mount bpffs /sys/fs/bpf -t bpf

Install and configure container runtime

apk add cri-o

cat > /etc/crio/crio.conf.d/override.conf << DONE
# pivot_root does not work on tmpfs
no_pivot = true

# Overide defaults to not use systemd cgroups.
conmon_cgroup = "pod"
cgroup_manager = "cgroupfs"

rc-update add crio default
service start crio

# Make sure OS packages and cilium use the same cni-bin dir
rm -rf /opt/cni/bin
cd /opt/cni
ln -s ../../usr/libexec/cni bin

Optional cri tools.

apk add cri-tools

cat > /etc/crictl.yaml << DONE
runtime-endpoint: unix:///run/crio/crio.sock
image-endpoint: unix:///run/crio/crio.sock
timeout: 10
debug: false

Test if we can talk to cri-o

crictl info

Install kubeadm and friends

apk add kubeadm
apk add kubelet

# Save yourself lot's of typing
cd /usr/local/bin/
ln -s ../../bin/kubectl k

Install kubelet

apk add kubectl
apk add kubelet
rc-update add kubelet default
# Start kubelet as kubeadm can not do that on alpine
service start kubelet

Bootstrap kubernetes cluster (only on the first control plane node)

kubeadm init phase preflight --config ./kubeadm-config.yaml
kubeadm config images pull --config ./kubeadm-config.yaml
kubeadm init --config ./kubeadm-config.yaml --skip-phases=addon/kube-proxy

# Untaint master to allow running workloads on master nodes (for POC)
kubectl taint nodes --all

Configure cluster (ideally from laptop/external machine)

# install helm (the version from alpine causes problems with helmfile)
cd /tmp
tar -xvzf helm-v3.5.2-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/
chmod +x /usr/local/bin/helm

# install helm diff plugin
helm plugin install

# install helmfile (usually on laptop/external node)
cd /tmp
mv /usr/bin/helmfile_linux_amd64 /usr/local/bin/
chmod +x /usr/local/bin/helmfile

# Setup KUBECONFIG when running on the master node.
# Configure ~/.kube/config when running from laptop.
export KUBECONFIG=/etc/kubernetes/admin.conf

# Install cilium using helmfile and local values file
cd cilium/
helmfile diff
helmfile sync