You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order for Kustomize to patch CRDs properly, we need to publish openAPI schema containing the following metadata in the ScaledJob CRD definitions.
x-kubernetes-patch-merge-key
x-kubernetes-patch-strategy
Use-Case
We have been running ScaledObjects for about 3 years now and recently we've been considering switching to ScaledJobs for some use cases.
We use Kustomize extensively with a multi-level layering system, even with a centralized shared repository with the base objects.
While experimenting with implementing it into our setup I noticed that patching ScaledJobs (we add default environment variables for monitoring purposes by default, while we add more environment variables on a service level. Or patching things like an entrypoint on the service level) was not doing a strategic merge.
So I went on a hunt and quickly realized that strategic merges need to be supported by the CRD. We prefer using strategic merge patches over JSON patch for readability and ease of use.
To solve this issue we would have 3 options:
Switch to a JSON patch for ScaledJobs which would make it a readability hell
Generate our own (full) OpenAPI schema, run the necessary patches for supporting strategic merges, and use the openapi.path to specify the correct OpenAPI schema to customize.
The problem with this method is that it overwrites the existing known OpenAPI schema, losing other options for strategic merge. An issue to support merging OpenAPI schema definitions has been open for 2 years now.
To help with that issue, we could use this project to generate and patch the OpenAPI schema based on our own cluster and use that file as input. Obviously this adds more maintenance in the case you want to upgrade components, API's or clusters as you would need to maintain that list as best as possible.
Ask the operator developers to add those merge keys to the CRD's in the correct locations to support StrategicMerge. This is something that for example argo-rollouts implemented
Is this a feature you are interested in implementing yourself?
Maybe
Anything else?
Happy to make my first contribution but I hardly have any experience in golang. But I noticed there is some JSON patching going on which I'm well familiar with but it depends on how we would see this being implemented.
The text was updated successfully, but these errors were encountered:
Proposal
In order for Kustomize to patch CRDs properly, we need to publish openAPI schema containing the following metadata in the ScaledJob CRD definitions.
Use-Case
We have been running ScaledObjects for about 3 years now and recently we've been considering switching to ScaledJobs for some use cases.
We use Kustomize extensively with a multi-level layering system, even with a centralized shared repository with the base objects.
While experimenting with implementing it into our setup I noticed that patching ScaledJobs (we add default environment variables for monitoring purposes by default, while we add more environment variables on a service level. Or patching things like an entrypoint on the service level) was not doing a strategic merge.
So I went on a hunt and quickly realized that strategic merges need to be supported by the CRD. We prefer using strategic merge patches over JSON patch for readability and ease of use.
To solve this issue we would have 3 options:
openapi.path
to specify the correct OpenAPI schema to customize.Is this a feature you are interested in implementing yourself?
Maybe
Anything else?
Happy to make my first contribution but I hardly have any experience in golang. But I noticed there is some JSON patching going on which I'm well familiar with but it depends on how we would see this being implemented.
The text was updated successfully, but these errors were encountered: