Minikube MetalLB

From Chorke Wiki
Revision as of 06:53, 20 December 2024 by Shahed (talk | contribs)
Jump to navigation Jump to search
helm repo add metallb https://metallb.github.io/metallb
helm repo update && helm repo list
kubectl config get-contexts

Config

export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"

Install

helm show values metallb/metallb --version=0.14.8|less
helm show values metallb/metallb --version=0.14.9|less


kubectl get ns|grep metallb-system
kubectl delete ns   metallb-system

kubectl get ns|grep metallb-system
kubectl create ns   metallb-system

cat <<YML | helm -n=metallb-system install    metallb metallb/metallb --version=0.14.9 -f=-
---
installCRDs: true
fullnameOverride: metallb
YML

cat << YML | kubectl -n=metallb-system apply -f=-
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: metallb-ip-pool
  namespace: metallb-system
spec:
  addresses:
  - 192.168.49.100-192.168.49.200
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
  name: metallb-l2-advertisement
  namespace: metallb-system
spec:
  ipAddressPools:
  - metallb-ip-pool
YML

Uninstall

helm uninstall -n=metallb-system metallb
kubectl delete namespace metallb

Playground

kubectl get pods -n metallb-system -o=yaml|yq -r .items[].spec.containers[].image|awk -F @ '{printf("%s\n", $1)}'|sort -h

docker network prune -f
docker volume  prune -f
docker system  prune -f
docker image ls
cat <<'EXE' | bash
for d in system network volume
do docker ${d} prune -f;done
EXE
cat <<'EXE' | ssh [email protected]
for d in system network volume
do docker ${d} prune -f;done
EXE

systemctl stop    minikube.service
systemctl status  minikube.service
systemctl restart minikube.service
systemctl stop    minikube-tunnel.service
systemctl status  minikube-tunnel.service
systemctl restart minikube-tunnel.service
systemctl status network-online.target
systemctl status containerd.service
systemctl status docker.service

minikube addons disable metallb
minikube addons enable  metallb
minikube addons list
minikube status
sudo journalctl -xeu minikube-tunnel
sudo journalctl -xeu minikube
sudo -i -u minikube
minikube ssh

References