kiwigrid / k8s-sidecar

This is a docker container intended to run inside a kubernetes cluster to collect config maps with a specified label and store the included files in a local folder.
MIT License
612 stars 183 forks source link

Consider Switching to Chainguard's Python Image? #242

Closed dlorenc closed 1 month ago

dlorenc commented 1 year ago

Hey!

I noticed a few CVEs in the image published here, as well as a few issues and PRs to address them: https://github.com/kiwigrid/k8s-sidecar/issues/238 https://github.com/kiwigrid/k8s-sidecar/issues/215 https://github.com/kiwigrid/k8s-sidecar/pull/232

I took a pass at converting this to the Chainguard Python image in a fork: https://github.com/kiwigrid/k8s-sidecar/compare/master...dlorenc:k8s-sidecar:cgr?expand=1

The image is also available at ghcr.io/dlorenc/k8s-sidecar for testing.

Would you be interested in trying this out? If so I could clean this up and send a few PRs.

jekkel commented 1 year ago

Hi @dlorenc

looks interesting. Do you know the versioning and update strategy of those images? I would prefer immutable image tags but unfortunately our current base images rebuild often into the same "floating" tag. This way dependabot is not really able to detect updates (adding the sha to the tag breaks multi-arch builds via buildx I believe). If they reliably publish new versions for updated dependencies then this might be worth the switch already.

dlorenc commented 1 year ago

We can do either floating tags or immutable ones - what would your ideal tagging strategy look like here? I'm happy to help get that supported.

jekkel commented 1 year ago

As said: immutable tags for which dependabot can correctly infer updates (and CVEs) would be best.

dlorenc commented 1 year ago

So something date-time based? Or tied to the versions of the packages underneath somehow?

jekkel commented 1 year ago

I'd vote for semantic versioning, but those base images tend to be a baseline of multiple versions really, some of which are important for compatibility, some not. And I'm afraid there's no common way of aggregating semantic versions, is there?

dlorenc commented 1 year ago

Yeah that's kind of the general issue with tagging images. Every bump is somewhat semantic depending on how you look at it.

jekkel commented 1 year ago

So from my POV I'd prefer the following:

So considering python 3.11.x this would translate into something like chainguard-python3.11:a.b.c and every change but python major or minor bumps would be represented in the image version (semantically). Python major and minor changes would be part of the image name. It would be an alternative to move the python minor also out of the image name and translate it into image minor bumps (with an unrelated absolute number though).

Does this make any sense for you?

github-actions[bot] commented 1 month ago

This issue was closed because it has not had any activity in the last 120 days. Please reopen if you feel this is still valid.