Minikube MetalLB: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 58: Line 58:
kind: L2Advertisement
kind: L2Advertisement
metadata:
metadata:
   name: metallb-l2-advertisement
   name: metallb-l2-ad
   namespace: metallb-system
   namespace: metallb-system
spec:
spec:
Line 79: Line 79:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl get pods -n metallb-system -o=yaml|yq -r .items[].spec.containers[].image|awk -F @ '{printf("%s\n", $1)}'|sort -h
kubectl get pods -n metallb-system -o=yaml|yq -r .items[].spec.containers[].image|awk -F @ '{printf("%s\n", $1)}'|sort -h
kubectl -n=metallb-system logs -f svc/metallb-webhook-service -c=controller
kubectl -n=metallb-system logs -f svc/metallb-webhook-service
kubectl -n=metallb-system describe L2Advertisement metallb-l2-ad
kubectl -n=metallb-system get L2Advertisement
kubectl -n=metallb-system describe IPAddressPool metallb-ip-pool
kubectl -n=metallb-system get IPAddressPool
</syntaxhighlight>
</syntaxhighlight>



Latest revision as of 11:01, 21 December 2024

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-ad
  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

kubectl -n=metallb-system logs -f svc/metallb-webhook-service -c=controller
kubectl -n=metallb-system logs -f svc/metallb-webhook-service

kubectl -n=metallb-system describe L2Advertisement metallb-l2-ad
kubectl -n=metallb-system get L2Advertisement

kubectl -n=metallb-system describe IPAddressPool metallb-ip-pool
kubectl -n=metallb-system get IPAddressPool

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