Minikube MetalLB: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
helm repo add metallb https://metallb.github.io/metallb
helm repo update && helm repo list
kubectl config get-contexts
==Config==
<syntaxhighlight lang="properties">
export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"
</syntaxhighlight>
==Install==
{|
|valign="top"|
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
|-
|colspan="2"|
----
|-
|colspan="2"|
<syntaxhighlight lang="yaml">
cat <<YML | helm -n=metallb-system install    metallb metallb/metallb --version=0.14.9 -f=-
---
installCRDs: true
fullnameOverride: metallb
YML
</syntaxhighlight>
|-
|colspan="2"|
----
|-
|colspan="2"|
<syntaxhighlight lang="bash">
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
</syntaxhighlight>
|}
==Uninstall==
<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
helm uninstall -n=metallb-system metallb
kubectl delete namespace metallb
</syntaxhighlight>
</syntaxhighlight>


==Playground==
==Playground==
{|
{|
| colspan="3" |
<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
</syntaxhighlight>
|-
| colspan="3" |
----
|-
|valign="top"|
|valign="top"|
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 75: Line 155:


| valign="top" |
| valign="top" |
|-
| colspan="3" |
----
|-
| colspan="3" |
<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
</syntaxhighlight>


|}
|}

Revision as of 06:53, 20 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-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