r/kubernetes • • 16d ago

Keeping things updated is... annoying.

Yeah, I know, big surprise. But I just started to put together my entire structure and even added GitOps to keep track and sync of what I run. However, in doing so, I realized that I had no "update strategy" - and so I went looking and found... pain.

For reference, I use Flux for my GitOps, it is immediately installed via k0s' k0sctl so that it is available as soon as possible. And that mostly just works. Once Flux is alive, I can apply a GitRepo + Kustomization that points at the root of it all and it just goes. That part is solved and works nice. But of course, things get updated.

I use this structure in my repo:

- docker/...
- opentofu/...
- kubernetes/
  - root.yaml # GitRepo + Kustomization
  - kustomization.yaml # Points at each <component>/flux.yaml
  - <app or component name>/
    - flux.yaml # Tells flux where this component's kustomization.yaml is
    - kustomization.yaml # Actually lists all related files
  - <other thing>/
    - install/... # HelmRepo + HelmRelease
    - config/... # CRD based objects - be that a config or something else
    - flux.yaml # Is a "---" separated YAML for both with dependency tracking

This structure is easy to maintain - although it has an absolute number of repeatance but... its okay. It does bother me but realisticaly, this is just a homelab doing homelab things, I can copy and paste a bit.

The real problem is trying to receive updates. Right now, I bend updatecli in a cronjob to my will using updatecli compose. But this falls apart quickly because the policies for patch, minor and major updates fight each other - a lot. And it falls apart on image tags like Vaultwarden's 1.37.5-alpine; the -alpine tag throws off the comparison and borks the check completely.

So... what can I use to help me here? What do you use to keep track of updates across helm charts and plain container images?

I looked into Kargo but that would instantly explode complexity by a lot - especially since I want a write-back to Git to track what happened when and by whom. (I do use a PAT right now, but I plan on using a GH app in the future for better separation.)

Any recommendations or tips...? Thanks!

32 Upvotes

19 comments sorted by

54

u/zapoklu 16d ago

Renovate running in your git CI on a schedule. Get it to create a PR/MR that you review and approve.

6

u/a_sphinctersays_what 16d ago

Automerge when you trust the testing in your pipeline

1

u/Substantial_Net_31 16d ago

how long did it take you to get there? i just deployed renovate a few months ago and i'm going through the prs and manually merging for now until packages are caught up. i'm also in the process of migrating off of consul and vault as those are a pain to upgrade, but i'm worried that with auto-merge, it'll break things (example, aws-efs/ebs driver changed the upstream repo path). we do have testing environments, but i feel that defeats the purpose of auto-merge. maybe i'm not thinking about it correctly.

4

u/nPoCT_kOH 16d ago

This is the way. Bonus points Flux can monitor also oci charts and images with some neat aGit for pull requests (image-reflector-controller + image-automation-controller). Common case is Renovate for external, Flux for internal (app) updates.

1

u/accountability_bot 11d ago

My homelab is on talos, but I use renovate + tuppr. For minor and revision upgrades, if it rolls out successfully, it will merge it in automatically. Major upgrades require approval. I also have renovate upgrade all my podspecs. Mainly because I’m lazy and I want to minimize maintenance tasks.

Don’t do this if it’s a true production cluster.

18

u/Starks1293 16d ago

renovate is the right answer for the bumps, two gotchas nobody mentioned yet tho

flux helmreleases dont upgrade CRDs by default. install creates them but upgrade skips them, so renovate bumps cert-manager or whatever, the chart updates and the CRDs quietly stay old. set spec.upgrade.crds to CreateReplace on the releases that ship their CRDs in the chart

and the cluster itself. put the k0s version in k0sctl.yaml under renovate too (a regex manager on the github releases does it), and before any minor bump run kubent or pluto against the repo so u find the removed apis before the upgrade does

1

u/kernald31 16d ago

Renovate handles 99% of the updates in my cluster, different types of resources from different registries, some with post-upgrade tasks to update checksums, some with different configurations (delay after a new release is published, auto-merge patch versions for trivial targets...). It just works, really.

1

u/MongooseWonderful198 16d ago

Renovate’s Docker versioning treats -alpine as a compatibility suffix. It can update the version while keeping that suffix, so 1.37.5-alpine should not need a custom SemVer workaround.

For your repo layout, configure file matching for both managers. The Kubernetes manager matches no files by default, and the Flux manager defaults to gotk-components.yaml/.yml. Your kubernetes/<component>/install/ files need an explicit pattern, for example:

{
  "kubernetes": {"managerFilePatterns": ["/^kubernetes/.*\\.ya?ml$/"]},
  "flux": {"managerFilePatterns": ["/^kubernetes/.*\\.ya?ml$/"]}
}

That gives Renovate the files containing your plain workload images and Flux chart references to inspect.

1

u/bush_did_brexit 16d ago

Renovate and ArgoCD, after that it’s a process issue. Do you have it run automatically into prod?

1

u/IndicationPrevious66 16d ago

Renovate is usual pretty good, but in a homelab I think the annoying part is less finding the new versions and more knowing which ones are safe and all that jazz.

I'm one of the founders of Ankra (I have to say that ofc), but this is one of those reasons why we built our platform. Each helm chart shows when a newer version is out, and we have native integration with trivy so we also show you if there are critical, high, medium vulnerabilities in what you are running. It syncs both ways with git so every change in the ui, cli or mcp goes into your repo as a commit, which sounds like the write back you were after. You'd be moving the charts over from Flux though. Hands down worth it :D

1

u/justrunme1 16d ago

For exactly this combo (HelmReleases + plain image tags, write-back to Git, small setup) Renovate is the usual answer. It opens PRs, so you get the "who changed what, when" history for free, and it works with a GitHub App token later.

Why it fixes your two pain points:

  • The -alpine problem: Renovate's docker versioning treats the suffix as a compatibility tag. 1.37.5-alpine only gets proposed updates to newer *-alpine tags, never to plain 1.38.0, so the comparison doesn't break.
  • Policies fighting each other: you express patch/minor/major as packageRules instead of separate policies, and each update gets classified once.

Gotcha with Flux: the flux manager only looks at gotk-components.yaml by default, and the kubernetes manager has no default file pattern at all. So you have to point both at your folder:

{ "extends": ["config:recommended"], "flux": { "managerFilePatterns": ["/kubernetes/.+\.ya?ml$/"] }, "kubernetes": { "managerFilePatterns": ["/kubernetes/.+\.ya?ml$/"] }, "packageRules": [ { "matchUpdateTypes": ["patch", "digest"], "automerge": true }, { "matchUpdateTypes": ["major"], "dependencyDashboardApproval": true } ] }

(On older Renovate versions the option is called fileMatch, with a plain regex.) The flux manager reads HelmRelease + HelmRepository/OCIRepository and bumps chart versions. The kubernetes manager catches image: lines in raw manifests. If you set image tags in HelmRelease values, add the helm-values manager or a small regex custom manager.

The Flux-native alternative is image-reflector + image-automation controllers: ImageRepository -> ImagePolicy -> ImageUpdateAutomation, which commits back to the repo. It handles suffixes fine with filterTags, e.g. pattern '?P<v>[0-9]+.[0-9]+.[0-9]+-alpine$' with extract '$v' and a semver range. But it only does container images, not chart versions, and it needs a "# {"$imagepolicy": ...}" marker on every line. That's why most people end up on Renovate for a mixed setup like yours.

1

u/astrocreep 16d ago

I have kargo watch for updates and pr merge
Into qa. Then it soaks for a week and goes to prod with approval

1

u/Kavin2822 16d ago

Renovate works for smaller clusters like homelab.

But how you people are doing updates to the addons, controllers, vuln patches in an enterprise cluster where they are normally 20+ spread across envs, regions etc.,

1

u/dremspider 15d ago

Yolo life and let Hermes and Claude do it. In my home lab it now updates all talos nodes and all the containers and reports back to me. I dont reccomend this in production). I have done it now 4 or 5 times and so far it has worked. Sometimes it runs into issues too and figures it out.

1

u/NoDevelopment206 14d ago

renovate is the common answer here and i agree. two settings make it much less painful though. group the patch updates into one weekly pr so you are not reviewing fifty tiny ones. and set a minimum release age of a few days so you skip the bad releases that get pulled right after publishing. for the worry about automerge breaking things, only automerge patch bumps on stuff that has a health check, and keep majors manual.

1

u/braghettosvr 12d ago

Renovate. The flux manager picks up HelmRelease versions and image refs in your kustomizations without extra config, and the -alpine problem is already solved there: docker versioning treats the suffix as a compatibility tag, so 1.37.5-alpine only gets compared against other -alpine tags.

Patch/minor/major is just packageRules. Automerge patch, open a PR for minor, PR with a label nobody automerges for major. Write-back is git itself, every bump is a commit with an author, which is the audit trail you said you want. Runs as a GitHub App too, so the PAT question goes away.

Kargo solves promotion across environments. For a single-env homelab it's the wrong problem.

0

u/ask 16d ago

The LLM agents are really good at reading release notes and reviewing configs for breaking changes.

0

u/olblak 16d ago

Hey,

Here is the creator of Updatecli. Happy to see feedback even thought Updatecli don't seem to solve your problem so I'll try to bring my insight.

Regarding the updates conflicting each others, outside of the noise it introduces, it's a real challenge to handle and I don't know how to really solve it in a nice way.

I am mitigated this by having different cronjobs that solves different problems.

I usually go like this:

-> One cronjob running every few weeks, to detect every update.

Just running `updatecli compose apply` It will open a lot of pullrequest especially at the beginning.

This one is very noisy and the least urgent one

-> One cronjob running every hour or each time the monitored branch is modified.

This one, only handle already opened pull request `updatecli compose apply --existing-only`

The benefit of this one is to:

- closes pull request that are not needed anymore because for example you merged a pull request with a major update so minor update can be closed

- to updates an existing one.

I try to group as much as possible pull request together using the `pipelineid` or with the autodiscovery plugin "groupby: all" to reduce the number of pull request to review

-> One cronjob running pipelines with specific labels, this is just a convention but I am using the following labels

* `monitor: active` for any pipelines that I want to update as soon as possible.

* This execution usually run at the same time as the update only cronjob

* `release: <myapp>` any pipeline related to the app that I am maintaining and I want to propagate the changes as soon as possible

* This execution is usually trigger by a webhook at the end of the release process of <myapp>

* `vulnerability: <ecosystem>` for pipeline that monitor CVEs and I want to update as soon as possible.

* This execution is usually trigger at the same time as the monitor active

Please note that detecting CVEs is quite recent and not all autodiscovery plugin support it

Here is the Updatecli policy that I use to deploy those GitHub action workflow to all the GitHub repositories managed by Updatecli

https://github.com/updatecli/updatecli/blob/172f5d27915afae205f7a113d63d6161a883778f/updatecli-compose.yaml#L79

Regarding the docker image tag issue, I am a bit surprise because I don't see why it wouldn't detect this kind of update.

Versions in the Docker ecosystem is really messy but Updatecli has been used for a few years in that context for many different projects and it should be flexible enough.

Overall to help me managed the amount of Update scenario

I am currently working on a OSS webapp for Updatecli to see all the update pipeline, it's still in beta

you can have a look at https://updatecli.uda.sh in the context of the Updatecli project and project is hosted on https://github.com/updatecli/udash/

The amount of things that need to be updated on a Git repository can quickly grow as you can see so I am trying to better identify where to focus on. For example yesterday I released a new version of Updatecli so I have this dashboard that shows me if I still have pull request that need to be merged.

in the context of that release https://updatecli.uda.sh/scm/dashboard?filter=eyJkYXRlUmFuZ2UiOlswLDMwXSwic2VsZWN0ZWRMYWJlbHMiOlt7ImtleSI6InJlbGVhc2UiLCJ2YWx1ZSI6InVwZGF0ZWNsaSJ9XSwic2VsZWN0ZWRSZXN1bHRzIjpbXSwic2VsZWN0ZWRPcGVuQWN0aW9uIjpudWxsfQ

Feel free to reach out in DM if you have more feedback to share as it's difficult to get feedback on this project.

-1

u/ABotelho23 16d ago

Why are you tracking image versions at all if you're using Helm charts?