k3s: Enable traefik dashboard - helm-install-traefik pod fails with "Error: unknown flag: --purge"
Version:
k3s version v1.17.0+k3s.1 (0f644650)
Server install command: curl -sfL https://get.k3s.io | K3S_TOKEN=abc123 sh -s - server --cluster-init
Agent install command: curl -sfL https://get.k3s.io | K3S_TOKEN=abc123 K3S_URL=https://server:6443/ sh -s -
Describe the bug
On my server I modified /var/lib/rancher/k3s/server/manifests/traefik.yaml adding dashboard.enabled = true. After saving, the change seems to get picked up and I see the traefik install pod start, but it fails and gets stuck in a crash loop.
To Reproduce
Modify /var/lib/rancher/k3s/server/manifests/traefik.yaml to try and enable the dashboard
Expected behavior Traefik Dashboard - I’m not 100% sure my procedure here is right. I find several blog posts talking about enabling traefik dashboard in k3s but this seemed like the easiest option.
Actual behavior Crashloop, pod log:
2020-01-21T12:11:34.98497809-06:00 stderr F CHART=$(sed -e "s/%{KUBERNETES_API}%/${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/g" <<< "${CHART}")
2020-01-21T12:11:34.987297604-06:00 stderr F set +v -x
2020-01-21T12:11:34.98736353-06:00 stderr F + cp /var/run/secrets/kubernetes.io/serviceaccount/ca.crt /usr/local/share/ca-certificates/
2020-01-21T12:11:34.988936567-06:00 stderr F + update-ca-certificates
2020-01-21T12:11:35.018340191-06:00 stderr F WARNING: ca-certificates.crt does not contain exactly one certificate or CRL: skipping
2020-01-21T12:11:35.037636413-06:00 stderr F + + tiller export --listen=127.0.0.1:44134 HELM_HOST=127.0.0.1:44134--storage=secret
2020-01-21T12:11:35.037673091-06:00 stderr F
2020-01-21T12:11:35.037681251-06:00 stderr F + HELM_HOST=127.0.0.1:44134
2020-01-21T12:11:35.037687228-06:00 stderr F + helm_v2 init --skip-refresh --client-only
2020-01-21T12:11:35.121554954-06:00 stderr F [main] 2020/01/21 18:11:35 Starting Tiller v2.12.3 (tls=false)
2020-01-21T12:11:35.121726446-06:00 stderr F [main] 2020/01/21 18:11:35 GRPC listening on 127.0.0.1:44134
2020-01-21T12:11:35.121816536-06:00 stderr F [main] 2020/01/21 18:11:35 Probes listening on :44135
2020-01-21T12:11:35.121909529-06:00 stderr F [main] 2020/01/21 18:11:35 Storage driver is Secret
2020-01-21T12:11:35.12200519-06:00 stderr F [main] 2020/01/21 18:11:35 Max history per release is 0
2020-01-21T12:11:35.131376676-06:00 stdout F Creating /root/.helm
2020-01-21T12:11:35.131474012-06:00 stdout F Creating /root/.helm/repository
2020-01-21T12:11:35.131535049-06:00 stdout F Creating /root/.helm/repository/cache
2020-01-21T12:11:35.131604154-06:00 stdout F Creating /root/.helm/repository/local
2020-01-21T12:11:35.131659886-06:00 stdout F Creating /root/.helm/plugins
2020-01-21T12:11:35.131738067-06:00 stdout F Creating /root/.helm/starters
2020-01-21T12:11:35.131784603-06:00 stdout F Creating /root/.helm/cache/archive
2020-01-21T12:11:35.131892813-06:00 stdout F Creating /root/.helm/repository/repositories.yaml
2020-01-21T12:11:35.131906147-06:00 stdout F Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
2020-01-21T12:11:35.131993983-06:00 stdout F Adding local repo with URL: http://127.0.0.1:8879/charts
2020-01-21T12:11:35.133100698-06:00 stdout F $HELM_HOME has been configured at /root/.helm.
2020-01-21T12:11:35.133122309-06:00 stdout F Not installing Tiller due to 'client-only' flag having been set
2020-01-21T12:11:35.133129971-06:00 stdout F Happy Helming!
2020-01-21T12:11:35.13528301-06:00 stderr F ++ helm_v2 ls --all '^traefik$' --output json
2020-01-21T12:11:35.135508412-06:00 stderr F ++ jq -r '.Releases | length'
2020-01-21T12:11:35.219538766-06:00 stderr F [storage] 2020/01/21 18:11:35 listing all releases with filter
2020-01-21T12:11:35.300276818-06:00 stderr F + EXIST=
2020-01-21T12:11:35.300352736-06:00 stderr F + '[' '' == 1 ']'
2020-01-21T12:11:35.300436873-06:00 stderr F + '[' '' == v2 ']'
2020-01-21T12:11:35.300513923-06:00 stderr F + helm_repo_init
2020-01-21T12:11:35.30069198-06:00 stderr F + grep -q -e 'https\?://'
2020-01-21T12:11:35.302207441-06:00 stderr F + echo 'chart path is a url, skipping repo update'
2020-01-21T12:11:35.302256859-06:00 stdout F chart path is a url, skipping repo update
2020-01-21T12:11:35.302262238-06:00 stderr F + helm_v3 repo remove stable
2020-01-21T12:11:35.371111262-06:00 stderr F Error: no repositories configured
2020-01-21T12:11:35.372877998-06:00 stderr F + true
2020-01-21T12:11:35.372918017-06:00 stderr F + return
2020-01-21T12:11:35.373007592-06:00 stderr F + helm_update install --set-string kubernetes.ingressEndpoint.useDefaultPublishedService=true --set-string metrics.prometheus.enabled=true --set-string rbac.enabled=true --set-string ssl.enabled=true
2020-01-21T12:11:35.373122624-06:00 stderr F + '[' helm_v3 == helm_v3 ']'
2020-01-21T12:11:35.373746776-06:00 stderr F ++ helm_v3 ls --all -f '^traefik$' --output json
2020-01-21T12:11:35.373961792-06:00 stderr F ++ jq -r '"\(.[0].app_version),\(.[0].status)"'
2020-01-21T12:11:35.374192578-06:00 stderr F ++ tr '[:upper:]' '[:lower:]'
2020-01-21T12:11:35.567083121-06:00 stderr F + LINE=1.7.19,failed
2020-01-21T12:11:35.567718274-06:00 stderr F ++ echo 1.7.19,failed
2020-01-21T12:11:35.567878271-06:00 stderr F ++ cut -f1 -d,
2020-01-21T12:11:35.568939264-06:00 stderr F + INSTALLED_VERSION=1.7.19
2020-01-21T12:11:35.569532961-06:00 stderr F ++ echo 1.7.19,failed
2020-01-21T12:11:35.569741132-06:00 stderr F ++ cut -f2 -d,
2020-01-21T12:11:35.570669853-06:00 stderr F + STATUS=failed
2020-01-21T12:11:35.570697496-06:00 stderr F + '[' -e /config/values.yaml ']'
2020-01-21T12:11:35.570774756-06:00 stderr F + '[' install = delete ']'
2020-01-21T12:11:35.57080816-06:00 stderr F + '[' -z 1.7.19 ']'
2020-01-21T12:11:35.570858876-06:00 stderr F + '[' -z '' ']'
2020-01-21T12:11:35.570885467-06:00 stderr F + '[' failed = deployed ']'
2020-01-21T12:11:35.57090561-06:00 stderr F + '[' failed = failed ']'
2020-01-21T12:11:35.570952853-06:00 stderr F + '[' helm_v3 == 'helm_v3]'
2020-01-21T12:11:35.570979572-06:00 stderr F /usr/bin/entry: line 43: [: missing `]'
2020-01-21T12:11:35.57106419-06:00 stderr F + helm_v3 install --set-string kubernetes.ingressEndpoint.useDefaultPublishedService=true --set-string metrics.prometheus.enabled=true --set-string rbac.enabled=true --set-string ssl.enabled=true --purge traefik
2020-01-21T12:11:35.643826637-06:00 stderr F Error: unknown flag: --purge
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (7 by maintainers)
I’ve verified that simply editing
/var/lib/rancher/k3s/server/manifests/traefik.yamlworks in k3sv1.17.2+k3s1. I added the following:The change gets deployed and ingress through
traefik.me.somewhereshows me the traefik dashboard. Super easy, very cool!@kalgecin I found that I had to do this remove/cleanup/replace dance with the manifest whenever I ran into an issue with a Helm chart using the built-in controller.
The integrated deploy and helm controllers are great for bootstrapping the cluster, but there are some issues like this one, and the fact that it overwrites the templates on restart, and the poor logging… that make it really difficult to use them for extensive customization.
yeah, I’ve taken to disabling all the built-in templates and just copying stuff into the manifests folder when I want it deployed. For Helm charts I just use
helm templateto render it locally and then copy the generated yaml over.can be fixed by removing traefik.yaml from the manifests folder, removing the traefik resources and putting the yaml back,
so it seems it’s not issue with the manifest or their deployment, it’s the updating them that fails
@ozeta All you need to do is edit the manifest file, the deploy controller picks up the changes automatically. If there are any errors in the manifest, you should see something marginally useful in the k3s logs. If there’s an error in the actual Helm output, that goes into a job container that’s harder to get at.