-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Understand the Task
Description
This is basically a follow-up for the discussion from #437. See there for further details.
We need to decide on how we get dynamic (= different from each cluster which are created from the same template) references to ClusterConfig resources.
The goal of this task is to have a discussion in which we decide on how to go forward here.
Option 1: Mutating Webhook
Comes with the usual webhook-related problems (complexity for setup and debugging, requires networking, etc.). Also, injecting fields into the spec causes problems with gitops.
Option 2: Templating in Scheduler templates
We allow some kind of templating in the scheduler config where the Cluster templates are defined. Comes with the usual drawbacks of templating: unintuitive, hard to debug, and (depending on the templating language) probably not yaml-compliant.
Option 3: Magic Prefixes
While foo refers to a ClusterConfig named foo, something like id:foo could refer to a ClusterConfig whose name is a hash made from foo and the Cluster's name, allowing static templates which still refer to different resources in the cluster.
Drawback is that we would need some helper method which is used by every controller that resolves these references or creates ClusterConfigs that should be targeted by it, and the connection is rather implicit.
Option 4: IPAM logic in Gardener ClusterProvider
We could avoid this topic (in fact, the whole PlatformService) completely if we moved the IPAM logic into the Gardener ClusterProvider. There are several reasons why I initially wanted to avoid this:
- The Gardener ClusterProvider is already very complex and this IPAM topic is also not trivial, so it would add another large, complex chunk to the repo which makes maintenance more difficult.
- Most environments support VPCs, so we would add a complex functionality to a provider which is only needed in very few situations. If the logic is in a separate PlatformService, we have a little bit more effort setting this up in these few situations, but a less complicated ClusterProvider in all other situations.
- We either need to introduce cloudprovider-specific code into the otherwise completely cloudprovider-agnostic ClusterProvider (and then the solution works only for this CloudProvider), or we need to work with reflection to inject the CIDR into the right place in the shoot manifest. The current implementation for ClusterConfig patches avoids this (still somewhat ugly, though) by converting the generated shoot manifest into json, using an external library to apply the json patches, and then converting the new json back into a shoot struct.
Any further valuable resources.
No response
What is required to accept the Task as done.
Done Criteria
- We decided on a way to solve this problem.