Helm/Traefik: Difference between revisions
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> |...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 29: | Line 29: | ||
|- | |- | ||
|colspan="2"| | |colspan="2"| | ||
<syntaxhighlight lang="yaml" highlight=" | <syntaxhighlight lang="yaml"> | ||
cat << YML | kubectl -n traefik apply -f - | |||
--- | |||
apiVersion: v1 | |||
kind: PersistentVolumeClaim | |||
metadata: | |||
labels: | |||
app.kubernetes.io/name: traefik | |||
name: traefik-pvc | |||
spec: | |||
storageClassName: standard | |||
accessModes: | |||
- ReadWriteOnce | |||
resources: | |||
requests: | |||
storage: 128Mi | |||
YML | |||
</syntaxhighlight> | |||
|- | |||
|colspan="2"| | |||
---- | |||
|- | |||
|colspan="2"| | |||
<syntaxhighlight lang="yaml" highlight="12-15" line> | |||
cat <<YML | helm -n traefik install traefik traefik/traefik --version=30.1.0 -f - | cat <<YML | helm -n traefik install traefik traefik/traefik --version=30.1.0 -f - | ||
--- | --- | ||
logs: | |||
general: | |||
level: INFO | |||
ports: | |||
traefik: | |||
expose: | |||
default: true | |||
autoscaling: | autoscaling: | ||
enabled: false | enabled: false | ||
persistence: | persistence: | ||
size: 128Mi | |||
enabled: true | enabled: true | ||
existingClaim: traefik-pvc | |||
ingressRoute: | ingressRoute: | ||
dashboard: | dashboard: | ||
enabled: true | enabled: false | ||
ingressClass: | |||
enabled: true | |||
isDefaultClass: true | |||
gateway: | gateway: | ||
listeners: | listeners: | ||
Line 137: | Line 173: | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n traefik exec -it svc/traefik -c 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 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 | ||
Line 163: | Line 199: | ||
|- | |- | ||
| valign="top" | | | valign="top" | | ||
* [https://traefik.io/blog/install-and-configure-traefik-with-helm/ Traefik » Proxy » Install & Configure] | |||
* [https://github.com/traefik/traefik-helm-chart/blob/master/EXAMPLES.md#use-traefik-native-lets-encrypt-integration-without-cert-manager Traefik » Use native Let's Encrypt] | * [https://github.com/traefik/traefik-helm-chart/blob/master/EXAMPLES.md#use-traefik-native-lets-encrypt-integration-without-cert-manager Traefik » Use native Let's Encrypt] | ||
* [https://github.com/traefik/traefik-helm-chart Traefik » Helm Charts » GitHub] | * [https://github.com/traefik/traefik-helm-chart Traefik » Helm Charts » GitHub] | ||
* [https://doc.traefik.io/traefik/getting-started/install-traefik/#use-the-helm-chart Traefik » Helm Charts] | * [https://doc.traefik.io/traefik/getting-started/install-traefik/#use-the-helm-chart Traefik » Helm Charts] | ||
* [https://doc.traefik.io/traefik/getting-started/concepts/ Traefik » Concepts] | * [https://doc.traefik.io/traefik/getting-started/concepts/ Traefik » Concepts] | ||
* [https://faun.pub/setup-traefik-routing-in-kubernetes-with-helm-chart-34008100b88f Traefik » Routing] | |||
* [https://platform9.com/learn/tutorials/traefik-ingress Traefik » Ingress] | |||
* [https://doc.traefik.io/traefik/ Traefik » Docs] | * [https://doc.traefik.io/traefik/ Traefik » Docs] | ||
* [https://traefik.io/ Traefik] | * [https://traefik.io/ Traefik] |
Latest revision as of 23:21, 9 September 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 | kubectl -n traefik apply -f -
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: traefik
name: traefik-pvc
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 128Mi
YML
| |
| |
cat <<YML | helm -n traefik install traefik traefik/traefik --version=30.1.0 -f -
---
logs:
general:
level: INFO
ports:
traefik:
expose:
default: true
autoscaling:
enabled: false
persistence:
size: 128Mi
enabled: true
existingClaim: traefik-pvc
ingressRoute:
dashboard:
enabled: false
ingressClass:
enabled: true
isDefaultClass: 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
| ||
| ||