Last active
September 16, 2025 17:16
-
-
Save dmi3mis/e52c64d4d0b07fc154b49671edd97019 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-native.yaml | |
| echo " | |
| --- | |
| apiVersion: metallb.io/v1beta1 | |
| kind: IPAddressPool | |
| metadata: | |
| name: default | |
| namespace: metallb-system | |
| spec: | |
| addresses: | |
| - 172.20.20.100-172.20.20.150 | |
| autoAssign: true | |
| --- | |
| apiVersion: metallb.io/v1beta1 | |
| kind: L2Advertisement | |
| metadata: | |
| name: default | |
| namespace: metallb-system | |
| spec: | |
| ipAddressPools: | |
| - default | |
| " |kubectl create -f - |
This file contains hidden or 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/bash | |
| swapoff -a | |
| sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab | |
| tee /etc/modules-load.d/containerd.conf <<EOF | |
| overlay | |
| br_netfilter | |
| EOF | |
| modprobe overlay -v | |
| modprobe br_netfilter -v | |
| tee /etc/modules <<EOF | |
| overlay | |
| br_netfilter | |
| EOF | |
| tee /etc/sysctl.d/kubernetes.conf <<EOF | |
| net.bridge.bridge-nf-call-ip6tables = 1 | |
| net.bridge.bridge-nf-call-iptables = 1 | |
| net.ipv4.ip_forward = 1 | |
| EOF | |
| sysctl --system | |
| # Add Docker's official GPG key: | |
| sudo apt-get update | |
| sudo apt-get -y install ca-certificates curl | |
| sudo install -m 0755 -d /etc/apt/keyrings | |
| sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc | |
| sudo chmod a+r /etc/apt/keyrings/docker.asc | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ | |
| $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| sudo apt-get update | |
| apt install -y curl gnupg2 patch software-properties-common apt-transport-https ca-certificates containerd.io | |
| rm -rf /etc/containerd/certs.d/ | |
| containerd config default | sudo tee /etc/containerd/config.toml >/dev/null 2>&1 | |
| sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml | |
| cat > ~/config.toml.patch <<'EOF' | |
| 162c162 | |
| < config_path = "" | |
| --- | |
| > config_path = "/etc/containerd/certs.d/" | |
| > | |
| EOF | |
| sudo patch /etc/containerd/config.toml ~/config.toml.patch | |
| mkdir -p /etc/containerd/certs.d/docker.io | |
| cat > /etc/containerd/certs.d/docker.io/hosts.toml <<'EOF' | |
| server = "https://registry-1.docker.io" | |
| [host."https://mirror.gcr.io"] | |
| capabilities = ["pull", "resolve"] | |
| EOF | |
| systemctl stop containerd | |
| systemctl start containerd | |
| systemctl enable containerd | |
| apt-get update | |
| apt-get install -y apt-transport-https ca-certificates curl gpg | |
| curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg | |
| echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
| apt-get update | |
| apt-get install -y kubelet kubeadm kubectl | |
| apt-mark hold kubelet kubeadm kubectl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment