0

If k3s installs traefik and flags it as a helm chart, can it be updated through helm? When I run the commands below,

helm repo add traefik https://traefik.github.io/charts
helm repo update
helm upgrade traefik traefik/traefik -n kube-system

I get the following

Error: UPGRADE FAILED: resource mapping not found for name: "traefik-dashboard" namespace: "kube-system" from "": no matches for kind "IngressRoute" in version "traefik.io/v1alpha1" ensure CRDs are installed first

1
  • Note that K3s uses Helm Controller for deploying the built in Helm charts. You can tweak existing installed charts using the HelmChartConfig CRD. docs.k3s.io/…
    – AAD
    Commented Aug 14, 2023 at 8:28

2 Answers 2

1

Install new CRDs and RBAC for Kube v1.16+

Yes, but because of the CRDs in Helm are managed by Rancher and not Traefik, and they were changed upstream,

The apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in Kubernetes v1.16+ and will be removed in v1.22+. For Kubernetes v1.16+, please use the Traefik apiextensions.k8s.io/v1 CRDs instead.

You must install the new CRDs and RBAC's.

# Install Traefik Resource Definitions:
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml

# Install RBAC for Traefik:
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v2.10/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml

Upgrade Traefik

Then you can install the Traefik repos and upgrade Traefik,

helm repo add traefik https://traefik.github.io/charts
helm repo update
helm upgrade traefik traefik/traefik -n kube-system

Now you should see that the upgrade was complete,

❯ helm history traefik -n kube-system
REVISION    UPDATED                     STATUS      CHART                   APP VERSION DESCRIPTION     
1           Sun Aug 13 18:45:21 2023    superseded  traefik-21.2.1+up21.2.0 v2.9.10     Install complete
2           Sun Aug 13 13:48:07 2023    deployed    traefik-24.0.0          v2.10.4     Upgrade complete

Remove deprecated CRDs

Now you can optionally remove the traefik-crd that Rancher provides, but because the crd's are versioned, you can just keep it too.

helm delete -n kube-system traefik-crd
0

remove old

We can uninstall traefik using helm

helm uninstall traefik -n kube-system

add new

then install the latest version

helm repo add traefik https://traefik.github.io/charts

helm repo update

helm install traefik traefik/traefik -n kube-system

If updating needed, we can do it with helm values

### save the values
helm show values traefik/traefik > value.yaml

### update and save
vim value.yaml

### apply 
helm upgrade traefik  traefik/traefik -f value.yaml -n kube-system

check

helm list -n kube-system
NAME        NAMESPACE   REVISION    UPDATED                                     STATUS      CHART                       APP VERSION
traefik     kube-system 3           2024-08-08 09:17:45.673772087 +0330 +0330   deployed    traefik-30.0.2              v3.1.0     
traefik-crd kube-system 1           2024-08-07 16:32:37.804433746 +0000 UTC     deployed    traefik-crd-25.0.3+up25.0.0 v2.10.5 

and

helm history  traefik -n kube-system 
REVISION    UPDATED                     STATUS      CHART           APP VERSION DESCRIPTION     
1           Wed Aug  7 23:04:25 2024    superseded  traefik-30.0.2  v3.1.0      Install complete
2           Thu Aug  8 09:15:08 2024    superseded  traefik-30.0.2  v3.1.0      Upgrade complete
3           Thu Aug  8 09:17:45 2024    deployed    traefik-30.0.2  v3.1.0      Upgrade complete

an issue you man face helm upgrade traefik dual-stack ipv6 is removed for traefik service #10683

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.