googleforgames / agones

Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes
https://agones.dev
Apache License 2.0
6.12k stars 818 forks source link

Add OpenAPI x-kubernetes-patch keys for patching CRDs #3112

Open clrxbl opened 1 year ago

clrxbl commented 1 year ago

Is your feature request related to a problem? Please describe. I am using Kustomize to patch Agones Fleets. If I attempt to do this right now without a custom OpenAPI schema, it will simply replace what I'm attempting to patch instead of merging.

Describe the solution you'd like Add x-kubernetes-patch keys to allow merging e.g. containers, initContainers and more.

Describe alternatives you've considered I can get this working locally by exporting the OpenAPI schema and adding the keys myself.

Additional context N/A

vytskalt commented 1 year ago

I've been looking into this and looks like the keys are specifically being removed: https://github.com/googleforgames/agones/blob/9e4400b213e970db7021ac7f7c930e63fb7b8107/build/scripts/k8s-export-openapi/main.go#L221-L228 Why is this the case?

markmandel commented 1 year ago

I'm going back through history (since this was done a while ago), but as far as I can tell, those properties are not supported on CRDs, so we strip them off sub-resources, such as PodTemplateSpec.

Happy to be proven wrong however!

github-actions[bot] commented 6 months ago

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '

markmandel commented 6 months ago

Just checking in to see if there is more we can do here, or if my comment above about non-support on CRDs makes this a non-starter?

clrxbl commented 6 months ago

Just checking in to see if there is more we can do here, or if my comment above about non-support on CRDs makes this a non-starter?

I've been using patch merge keys for the past year for the past year or so without any issues on GameServer CRDs with Kustomize. I just had to end up exporting CRDs, manually modifying it to add the keys and passing it along to Kustomize to make it work.

markmandel commented 6 months ago

Sounds like it's worth a review!

Happy to also accept PRs with the changes to our tools and accompanying exports.

github-actions[bot] commented 5 months ago

'This issue is marked as Stale due to inactivity for more than 30 days. To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions '

markmandel commented 5 months ago

Moving to awaiting-maintainer since I do want to see this tackled at some point.