Last active
March 4, 2024 19:35
-
-
Save Flagro/d35fdf7a13eb20c504f51021b4f9f042 to your computer and use it in GitHub Desktop.
Kubernetes bare metal setup for easy use outside of cloud (on VPS)
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
# Install helm | |
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null | |
sudo apt-get install apt-transport-https --yes | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list | |
sudo apt-get update | |
sudo apt-get install helm | |
# Install Traefik | |
helm repo add traefik https://traefik.github.io/charts | |
helm repo update | |
kubectl create namespace traefik | |
helm install traefik traefik/traefik -n traefik | |
# Install MetalLB | |
# Set strictARP to true: | |
kubectl get configmap kube-proxy -n kube-system -o yaml | \ | |
sed -e "s/strictARP: false/strictARP: true/" | \ | |
kubectl apply -f - -n kube-system | |
# Install MetalLB by manifest: | |
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.3/config/manifests/metallb-native.yaml | |
# Config MetalLB for L2 with your address (here presented for a single IPv4 address) | |
kubectl apply -f - <<EOF | |
apiVersion: metallb.io/v1beta1 | |
kind: IPAddressPool | |
metadata: | |
name: first-pool | |
namespace: metallb-system | |
spec: | |
addresses: | |
- x.x.x.x/32 | |
EOF | |
# Advertise your MetalLB config for ingress controllers: | |
kubectl apply -f - <<EOF | |
apiVersion: metallb.io/v1beta1 | |
kind: L2Advertisement | |
metadata: | |
name: example | |
namespace: metallb-system | |
EOF | |
# Install NFS | |
# TODO... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment