FoundationDB / fdb-kubernetes-operator

A kubernetes operator for FoundationDB
Apache License 2.0
238 stars 81 forks source link

Supporting customization of tags in the built-in images #387

Closed brownleej closed 2 years ago

brownleej commented 3 years ago

The operator does not currently support customizing the tags on the foundationdb and foundationdb-kubernetes-operator image. This can be a difficult limitation in some scenarios:

Allowing arbitrary tags will cause problems when doing upgrades, since the operator needs to carefully manage the image versions to upgrade the sidecar and the main container at the appropriate stages.

This came up in #342, and we addressed the problem by adding stronger validations. I think we should take another look at it and see if there's a cleaner way to support some customization of tags.

brownleej commented 3 years ago

We could look at this problem as being similar to what we did for the sidecarVersions field, where we have suffices that are appended to the image on the basis of the version. We could generalize this somewhat to support both the sidecar container and the main container, and support arbitrary suffices, or maybe even arbitrary tags entirely, that are still scoped to a specific version of FDB.

brownleej commented 3 years ago

Re-opening this to follow up on the discussion in #587.

brownleej commented 3 years ago

Here's what I've been thinking in terms of how we can make this more flexible. We can create a new field called imageVersions that allows customizing docker images on a per version basis. This will be contain two fields, main and sidecar. Each of these fields will be a list of ImageConfig objects, which will have the following fields:

When we fill in the images for a built-in containers, we should apply all of the matching rules specified by the imageVersions settings, in the order in which they are listed. A rule will match if its version is blank or matches the FDB version the cluster is running.

This will allow us to support the following scenarios:

If the user specifies an image for the container, but no tag, we should construct the tag based on the rules above. If the user specifies an image with a tag, we should respect that image in full.

@johscheuer What do you think?