Helm/Traefik: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with " helm repo add traefik https://traefik.github.io/charts 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"> kubectl get ns|grep traefik kubectl delete ns traefik </syntaxhighlight> |...")
 
Line 137: Line 137:
| valign="top" |
| valign="top" |
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
kubectl -n traefik exec -it svc/traefik -c traefik -- cat /etc/os-release
kubectl -n traefik exec -it svc/traefik -c traefik -- which traefik
kubectl -n traefik exec -it svc/traefik -c traefik -- sh
kubectl -n traefik exec -it svc/traefik -c traefik -- sh
kubectl -n traefik logs -f  svc/traefik -c traefik
kubectl -n traefik logs -f  svc/traefik -c traefik

Revision as of 19:38, 24 August 2024

helm repo add traefik https://traefik.github.io/charts
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

kubectl get ns|grep traefik
kubectl delete ns   traefik
kubectl get ns|grep traefik
kubectl create ns   traefik

cat <<YML | helm -n traefik install    traefik traefik/traefik --version=30.1.0 -f -
---
autoscaling:
  enabled: false
persistence:
  enabled: true
ingressRoute:
  dashboard:
    enabled: true
gateway:
  listeners:
    web:
      hostname: traefik.k8s.local
YML

xdg-open http://traefik.k8s.local &>/dev/null &
gnome-open http://traefik.k8s.local &>/dev/null &
x-www-browser http://traefik.k8s.local &>/dev/null &
sensible-browser http://traefik.k8s.local &>/dev/null &

Uninstall

helm uninstall -n traefik traefik
kubectl delete ns traefik

Swiss Knife

kubectl -n traefik run -i --tty --rm traefik-cli --image=alpine --restart=Never -- sh
apk --update add inetutils-telnet

telnet traefik 80
telnet traefik 443

ping traefik.k8s.local
ping host.minikube.internal

telnet traefik.traefik.svc.cluster.local 80
telnet traefik.traefik.svc.cluster.local 443

Playground

helm -n traefik install    traefik traefik/traefik --version=29.0.1
helm -n traefik upgrade -i traefik traefik/traefik --version=30.1.0
helm show values bitnami/traefik --version=30.1.0|less

kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten

kubectl -n traefik delete all --all
kubectl -n traefik delete ing --all
kubectl -n traefik delete sts --all
kubectl -n traefik delete svc --all
kubectl -n traefik delete pvc --all
kubectl -n traefik delete pv  --all

kubectl -n traefik rollout history deploy traefik
kubectl -n traefik rollout restart deploy traefik
kubectl -n traefik rollout status  deploy traefik
kubectl -n traefik exec -it svc/traefik -c traefik -- which traefik
kubectl -n traefik exec -it svc/traefik -c traefik -- sh
kubectl -n traefik logs -f  svc/traefik -c traefik

References