hack/update: add automated Traefik addon update script and workflow - #23435
hack/update: add automated Traefik addon update script and workflow#23435Roslaan001 wants to merge 1 commit into
Conversation
|
Hi @Roslaan001. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Roslaan001 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Can one of the admins verify this patch? |
|
@nirs, the script and workflow to auto-update Traefik version, please review. |
nirs
left a comment
There was a problem hiding this comment.
The update script use the wrong version format:
% make update-traefik-version
cd hack && go run update/traefik_version/traefik_version.go
I0804 16:22:09.840401 58262 update.go:90] The Plan:
{
"pkg/minikube/assets/addons.go": {
"Content": null,
"Replace": {
"Version:\\s*\".*\", // traefik-version": "Version: \"v41.1.1\", // traefik-version"
}
}
}
I0804 16:22:09.844531 58262 update.go:97] Local repo update skipped: nothing changed
Testing traefik addon:
% minikube addons enable traefik --logtostderr --v=8
...
I0804 16:25:16.653980 58437 ssh_runner.go:191] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig helm upgrade --install traefik oci://ghcr.io/traefik/helm/traefik --create-namespace --namespace kube-system --version v41.1.1 --set api.insecure=true --set ingressClass.isDefaultClass=true --set ports.web.hostPort=80 --set ports.websecure.hostPort=443 --set ports.traefik.expose.default=true --set service.labels.kubernetes\.io/minikube-addons-endpoint=traefik
I0804 16:25:16.687278 58437 command_runner.go:137] > Release "traefik" does not exist. Installing it now.
I0804 16:25:17.210578 58437 command_runner.go:137] ! Error: failed to perform "FetchReference" on source: ghcr.io/traefik/helm/traefik:v41.1.1: not found
...
We have existing bug - if the callback fails - we continue to the next callback instead fo failing quickly.
The command hangs for 6 minutes. The error includes the errors from the callback but we could report the error quickly without waiting 6 minutes for the pods.
% minikube addons enable traefik
❗ traefik is a 3rd party addon and is not maintained or verified by minikube maintainers, enable at your own risk.
💡 traefik is maintained by 3rd party (Traefik Labs) for any concerns contact traefik on GitHub.
🔎 Verifying traefik addon...
❌ Exiting due to MK_ADDON_ENABLE: enable failed: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig helm upgrade --install traefik oci://ghcr.io/traefik/helm/traefik --create-namespace --namespace kube-system --version v41.1.1 --set api.insecure=true --set ingressClass.isDefaultClass=true --set ports.web.hostPort=80 --set ports.websecure.hostPort=443 --set ports.traefik.expose.default=true --set service.labels.kubernetes\.io/minikube-addons-endpoint=traefik: Process exited with status 1
stdout:
Release "traefik" does not exist. Installing it now.
stderr:
Error: failed to perform "FetchReference" on source: ghcr.io/traefik/helm/traefik:v41.1.1: not found
waiting for app.kubernetes.io/name=traefik pods: context deadline exceeded]
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ 😿 If the above advice does not help, please let us know: │
│ 👉 https://github.com/kubernetes/minikube/issues/new/choose │
│ │
│ Please run `minikube logs --file=logs.txt` and attach logs.txt to the GitHub issue. │
│ Please also attach the following file to the GitHub issue: │
│ - /var/folders/v1/lcvpk6v567x43cfsjqg_97t40000gn/T/minikube_addons_67b07fd43168ba62c307ce45b9afd1e0135c3010_0.log │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
You did not test this change properly before creating the PR and asking for review.
| # The following is to support multiline with GITHUB_OUTPUT, see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings | ||
| echo "changes<<EOF" >> "$GITHUB_OUTPUT" | ||
| echo "$(git status --porcelain)" >> "$GITHUB_OUTPUT" | ||
| echo "EOF" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
This is very complicated - I guess you copied it form other updates, but we cannot continue duplicating complicated code like this. Why this is not a single call to the update program?
There was a problem hiding this comment.
@nirs, regarding this, there is no need to update those other workflows, right?
There was a problem hiding this comment.
No, we want to minimal automating the update for traefik. We can open issues for changing the update framework.
|
I add an issue for the error handling when addon callback fail: #23442 |
I will attend to your comments and see to the issue too. I actually tested the codes; also, like you said, I copied the updates from other code because I thought that was the standard- that's what brought about the weekly updates, Ubuntu 22.04, etc but I'll see to all of that now |
20a86c9 to
265b0d7
Compare
|
@nirs , I have addressed the comments. 1. Fixed Helm Chart Version Format
2. Optimised Release Fetching & Added JSON Output
3. Modernized GitHub Actions Workflow
$ make update-traefik-version
cd hack && go run update/traefik_version/traefik_version.go
{"old_version":"41.1.1","new_version":"41.1.1"}
$ timestamp out/minikube addons enable traefik --logtostderr --v=8
[ 0.000] out/minikube addons enable traefik --logtostderr --v=8
[ 0.229] I0804 16:24:10.729166 693228 out.go:361] Setting OutFile to fd 1 ...
[ 0.229] I0804 16:24:10.729442 693228 out.go:414] isatty.IsTerminal(1) = false
[ 0.229] I0804 16:24:10.729451 693228 out.go:375] Setting ErrFile to fd 2...
[ 0.229] I0804 16:24:10.729459 693228 out.go:414] isatty.IsTerminal(2) = false
[ 0.229] I0804 16:24:10.730576 693228 root.go:332] Updating PATH: /home/roslaan001/.minikube/bin
[ 0.230] W0804 16:24:10.731388 693228 root.go:308] Error reading config file at /home/roslaan001/.minikube/config/config.json: open /home/roslaan001/.minikube/config/config.json: no such file or directory
[ 0.233] I0804 16:24:10.734016 693228 mustload.go:66] Loading cluster: minikube
[ 0.235] I0804 16:24:10.736499 693228 config.go:187] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.36.2
[ 0.235] I0804 16:24:10.736572 693228 addons.go:636] checking whether the cluster is paused
[ 0.236] I0804 16:24:10.736712 693228 config.go:187] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.36.2
[ 0.236] I0804 16:24:10.737258 693228 host.go:67] Checking if "minikube" exists ...
[ 0.237] I0804 16:24:10.738419 693228 cli_runner.go:164] Run: docker container inspect minikube --format={{.State.Status}}
[ 0.360] I0804 16:24:10.861568 693228 ssh_runner.go:191] Run: systemctl --version
[ 0.361] I0804 16:24:10.861655 693228 cli_runner.go:164] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube
[ 0.380] I0804 16:24:10.881223 693228 sshutil.go:53] new ssh client: &{IP:127.0.0.1 Port:32768 SSHKeyPath:/home/roslaan001/.minikube/machines/minikube/id_rsa Username:docker}
[ 0.561] I0804 16:24:11.062445 693228 command_runner.go:137] > systemd 252 (252.39-1~deb12u2)
[ 0.561] I0804 16:24:11.062530 693228 command_runner.go:137] > +PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified
[ 0.562] I0804 16:24:11.063036 693228 ssh_runner.go:191] Run: docker ps --filter status=paused --filter=name=k8s_.*_(kube-system)_ --format={{.ID}}
[ 0.660] ! traefik is a 3rd party addon and is not maintained or verified by minikube maintainers, enable at your own risk.
[ 0.660] * traefik is maintained by 3rd party (Traefik Labs) for any concerns contact traefik on GitHub.
[ 0.660] I0804 16:24:11.161195 693228 out.go:180] ! traefik is a 3rd party addon and is not maintained or verified by minikube maintainers, enable at your own risk.
[ 0.660] I0804 16:24:11.161240 693228 out.go:180] * traefik is maintained by 3rd party (Traefik Labs) for any concerns contact traefik on GitHub.
[ 0.660] I0804 16:24:11.161418 693228 config.go:187] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.36.2
[ 0.660] I0804 16:24:11.161437 693228 addons.go:71] Setting traefik=true in profile "minikube"
[ 0.660] I0804 16:24:11.161445 693228 addons.go:247] Setting addon traefik=true in "minikube"
[ 0.660] W0804 16:24:11.161452 693228 addons.go:256] addon traefik should already be in state true
[ 0.660] I0804 16:24:11.161471 693228 host.go:67] Checking if "minikube" exists ...
[ 0.661] I0804 16:24:11.162136 693228 cli_runner.go:164] Run: docker container inspect minikube --format={{.State.Status}}
[ 0.684] I0804 16:24:11.184711 693228 ssh_runner.go:191] Run: /usr/bin/helm version --template {{.Version}}
[ 0.684] I0804 16:24:11.184856 693228 cli_runner.go:164] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube
[ 0.704] I0804 16:24:11.205077 693228 sshutil.go:53] new ssh client: &{IP:127.0.0.1 Port:32768 SSHKeyPath:/home/roslaan001/.minikube/machines/minikube/id_rsa Username:docker}
[ 1.001] I0804 16:24:11.502200 693228 command_runner.go:146] > v4.2.3
[ 1.001] I0804 16:24:11.502242 693228 addons.go:470] using helm 4.2.3
[ 1.002] I0804 16:24:11.503465 693228 ssh_runner.go:191] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig helm upgrade --install traefik oci://ghcr.io/traefik/helm/traefik --create-namespace --namespace kube-system --set api.insecure=true --set ingressClass.isDefaultClass=true --set ports.web.hostPort=80 --set ports.websecure.hostPort=443 --set ports.traefik.expose.default=true --set service.labels.kubernetes\.io/minikube-addons-endpoint=traefik
[ 4.545] I0804 16:24:15.046320 693228 command_runner.go:137] > Pulled: ghcr.io/traefik/helm/traefik:41.1.1
[ 4.545] I0804 16:24:15.046367 693228 command_runner.go:137] > Digest: sha256:1542ea793aa8208435286f1219380fe1775dc8e62d5f1dcb3477d6862296d215
[ 5.647] I0804 16:24:16.147656 693228 command_runner.go:137] > Release "traefik" has been upgraded. Happy Helming!
[ 5.647] I0804 16:24:16.147699 693228 command_runner.go:137] > NAME: traefik
[ 5.647] I0804 16:24:16.147707 693228 command_runner.go:137] > LAST DEPLOYED: Tue Aug 4 15:24:15 2026
[ 5.647] I0804 16:24:16.147712 693228 command_runner.go:137] > NAMESPACE: kube-system
[ 5.647] I0804 16:24:16.147718 693228 command_runner.go:137] > STATUS: deployed
[ 5.647] I0804 16:24:16.147722 693228 command_runner.go:137] > REVISION: 3
[ 5.647] I0804 16:24:16.147728 693228 command_runner.go:137] > DESCRIPTION: Upgrade complete
[ 5.647] I0804 16:24:16.147751 693228 command_runner.go:137] > TEST SUITE: None
[ 5.647] I0804 16:24:16.147754 693228 command_runner.go:137] > NOTES:
[ 5.647] I0804 16:24:16.147766 693228 command_runner.go:137] > traefik with docker.io/traefik:v3.7.9 has been deployed successfully on kube-system namespace!
[ 5.656] I0804 16:24:16.157071 693228 ssh_runner.go:230] Completed: sudo KUBECONFIG=/var/lib/minikube/kubeconfig helm upgrade --install traefik oci://ghcr.io/traefik/helm/traefik --create-namespace --namespace kube-system --set api.insecure=true --set ingressClass.isDefaultClass=true --set ports.web.hostPort=80 --set ports.websecure.hostPort=443 --set ports.traefik.expose.default=true --set service.labels.kubernetes\.io/minikube-addons-endpoint=traefik: (4.653563964s)
[ 5.656] I0804 16:24:16.157115 693228 addons.go:509] Verifying addon traefik=true in "minikube"
[ 5.656] I0804 16:24:16.157193 693228 out.go:180] * Verifying traefik addon...
[ 5.656] * Verifying traefik addon...
[ 5.659] I0804 16:24:16.159821 693228 loader.go:407] Config loaded from file: /home/roslaan001/.kube/config
[ 5.661] I0804 16:24:16.161588 693228 kapi.go:59] client config for minikube: &rest.Config{Host:"https://192.168.49.2:8443", APIPath:"", ContentConfig:rest.ContentConfig{AcceptContentTypes:"", ContentType:"", GroupVersion:(*schema.GroupVersion)(nil), NegotiatedSerializer:runtime.NegotiatedSerializer(nil)}, Username:"", Password:"", BearerToken:"", BearerTokenFile:"", Impersonate:rest.ImpersonationConfig{UserName:"", UID:"", Groups:[]string(nil), Extra:map[string][]string(nil)}, AuthProvider:<nil>, AuthConfigPersister:rest.AuthProviderConfigPersister(nil), ExecProvider:<nil>, TLSClientConfig:rest.sanitizedTLSClientConfig{Insecure:false, ServerName:"", CertFile:"/home/roslaan001/.minikube/profiles/minikube/client.crt", KeyFile:"/home/roslaan001/.minikube/profiles/minikube/client.key", CAFile:"/home/roslaan001/.minikube/ca.crt", CertData:[]uint8(nil), KeyData:[]uint8(nil), CAData:[]uint8(nil), NextProtos:[]string(nil)}, UserAgent:"", DisableCompression:false, Transport:http.RoundTripper(nil), WrapTransport:(transport.WrapperFunc)(0x289f300), QPS:0, Burst:0, RateLimiter:flowcontrol.RateLimiter(nil), WarningHandler:rest.WarningHandler(nil), WarningHandlerWithContext:rest.WarningHandlerWithContext(nil), Timeout:0, Dial:(func(context.Context, string, string) (net.Conn, error))(nil), Proxy:(func(*http.Request) (*url.URL, error))(nil)}
[ 5.661] I0804 16:24:16.162095 693228 envvar.go:195] "Feature gate default state" feature="ClientsPreferCBOR" enabled=false
[ 5.661] I0804 16:24:16.162110 693228 envvar.go:195] "Feature gate default state" feature="ClientsAllowCBOR" enabled=false
[ 5.661] I0804 16:24:16.162119 693228 envvar.go:195] "Feature gate default state" feature="InOrderInformers" enabled=true
[ 5.661] I0804 16:24:16.162126 693228 envvar.go:195] "Feature gate default state" feature="InformerResourceVersion" enabled=true
[ 5.661] I0804 16:24:16.162132 693228 envvar.go:195] "Feature gate default state" feature="AtomicFIFO" enabled=true
[ 5.661] I0804 16:24:16.162138 693228 envvar.go:195] "Feature gate default state" feature="InOrderInformersBatchProcess" enabled=true
[ 5.661] I0804 16:24:16.162143 693228 envvar.go:195] "Feature gate default state" feature="UnlockWhileProcessingFIFO" enabled=true
[ 5.661] I0804 16:24:16.162148 693228 envvar.go:195] "Feature gate default state" feature="WatchListClient" enabled=true
[ 5.661] I0804 16:24:16.162153 693228 envvar.go:195] "Feature gate default state" feature="ClientsAllowCARotation" enabled=true
[ 5.661] I0804 16:24:16.162158 693228 envvar.go:195] "Feature gate default state" feature="ClientsAllowTLSCacheGC" enabled=true
[ 5.662] I0804 16:24:16.163335 693228 cert_rotation.go:141] "Starting client certificate rotation controller" logger="tls-transport-cache"
[ 5.668] I0804 16:24:16.169468 693228 kapi.go:75] Waiting for pod with label "app.kubernetes.io/name=traefik" in ns "kube-system" ...
[ 5.670] I0804 16:24:16.171497 693228 type.go:183] "Request Body" body=""
[ 5.671] I0804 16:24:16.171798 693228 round_trippers.go:527] "Request" verb="GET" url="https://192.168.49.2:8443/api/v1/namespaces/kube-system/pods?labelSelector=app.kubernetes.io%2Fname%3Dtraefik" headers=<
[ 5.671] Accept: application/vnd.kubernetes.protobuf,application/json
[ 5.671] User-Agent: minikube/v0.0.0 (linux/amd64) kubernetes/$Format
[ 5.671] >
[ 5.681] I0804 16:24:16.182201 693228 round_trippers.go:632] "Response" status="200 OK" headers=<
[ 5.681] Audit-Id: 86567614-2e5e-4500-aab0-2f7889969d4e
[ 5.681] Cache-Control: no-cache, private
[ 5.681] Content-Type: application/vnd.kubernetes.protobuf
[ 5.681] Date: Tue, 04 Aug 2026 15:24:16 GMT
[ 5.681] X-Kubernetes-Pf-Flowschema-Uid: 1e71380a-4a27-4508-b305-7180a07b35e0
[ 5.681] X-Kubernetes-Pf-Prioritylevel-Uid: e71b8f11-d42d-41d7-96b2-a04602c7d3f1
[ 5.681] > milliseconds=10
[ 5.681] I0804 16:24:16.182480 693228 type.go:183] "Response Body" body=<
[ 5.681] 00000000 6b 38 73 00 0a 0d 0a 02 76 31 12 07 50 6f 64 4c |k8s.....v1..PodL|
[ 5.681] 00000010 69 73 74 12 a1 30 0a 0b 0a 00 12 05 37 37 31 35 |ist..0......7715|
[ 5.681] 00000020 30 1a 00 12 91 30 0a 91 1f 0a 18 74 72 61 65 66 |0....0.....traef|
[ 5.681] 00000030 69 6b 2d 35 35 64 64 39 36 35 62 66 39 2d 72 70 |ik-55dd965bf9-rp|
[ 5.681] 00000040 62 71 72 12 13 74 72 61 65 66 69 6b 2d 35 35 64 |bqr..traefik-55d|
[ 5.681] 00000050 64 39 36 35 62 66 39 2d 1a 0b 6b 75 62 65 2d 73 |d965bf9-..kube-s|
[ 5.681] 00000060 79 73 74 65 6d 22 00 2a 24 30 32 30 30 31 66 63 |ystem".*$02001fc|
[ 5.681] 00000070 62 2d 36 37 66 38 2d 34 39 66 63 2d 38 34 36 64 |b-67f8-49fc-846d|
[ 5.681] 00000080 2d 38 38 39 32 37 33 64 65 39 37 64 30 32 05 37 |-889273de97d02.7|
[ 5.681] 00000090 34 30 31 33 38 01 42 08 08 ee ec c7 d3 06 10 00 |40138.B.........|
[ 5.681] 000000a0 5a 31 0a 1a 61 70 70 2e 6b 75 62 65 72 6e 65 74 |Z1..app.kubernet|
[ 5.681] 000000b0 65 73 2e 69 6f 2f 69 6e 73 74 61 6e 63 65 12 13 |es.io/instance..|
[ 5.681] 000000c0 74 72 61 65 66 69 6b 2d 6b 75 62 65 2d 73 79 73 |traefik-kube-sy [truncated 29623 chars]
[ 5.681] >
[ 5.684] I0804 16:24:16.185203 693228 kapi.go:86] Found 1 Pods for label selector app.kubernetes.io/name=traefik
[ 5.684] I0804 16:24:16.185227 693228 kapi.go:107] duration metric: took 15.788219ms to wait for app.kubernetes.io/name=traefik ...
[ 5.684] I0804 16:24:16.185275 693228 out.go:180] * To open the Traefik dashboard:
[ 5.684]
[ 5.684] minikube addons open traefik
[ 5.684]
[ 5.684] For more information see https://minikube.sigs.k8s.io/docs/handbook/addons/traefik
[ 5.684]
[ 5.684] I0804 16:24:16.185289 693228 addons.go:210] Writing out "minikube" config to set traefik=true...
[ 5.684] * To open the Traefik dashboard:
[ 5.684]
[ 5.684] minikube addons open traefik
[ 5.684]
[ 5.684] For more information see https://minikube.sigs.k8s.io/docs/handbook/addons/traefik
[ 5.684]
[ 5.684] * The 'traefik' addon is enabled
[ 5.684] I0804 16:24:16.185499 693228 out.go:180] * The 'traefik' addon is enabled
|
Adds automated dependency updating for the Traefik addon to align with minikube's automated addon update architecture.
Key changes:
hack/update/traefik_version/traefik_version.go: Queries GitHub releases (traefik/traefik-helm-chart) for new chart releases and updatespkg/minikube/assets/addons.go.hack/update/get_version/get_version.go: Addedtraefikentry to allow version checking viaDEP=traefik make get-dependency-version.Makefile: Addedupdate-traefik-versionbuild target..github/workflows/update-traefik-version.yml: Scheduled GitHub Actions workflow (weekly on Saturdays) to runmake update-traefik-versionand submit auto-update PRs.pkg/addons/helm.go: Addedchart.Versionsupport (--version) toinstallHelmChart.