Minikube MetalLB: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
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-ad
  namespace: metallb-system
spec:
  ipAddressPools:
  - metallb-ip-pool
YML
</syntaxhighlight>
|}
==Uninstall==
<syntaxhighlight lang="bash">
helm uninstall -n=metallb-system metallb
kubectl delete namespace metallb
</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
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>
|-
| colspan="3" |
----
|-
|valign="top"|
|valign="top"|
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 56: Line 149:
| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
minikube addons enable metallb
minikube addons disable metallb
minikube addons enable metallb
minikube addons list
minikube addons list
minikube status
minikube status
minikube ssh
</syntaxhighlight>
</syntaxhighlight>


| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
sudo journalctl -xeu minikube-tunnel
sudo journalctl -xeu minikube
sudo -i -u minikube
minikube ssh
</syntaxhighlight>


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


|}
|}

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