Feature: Native SSA Support
Tasks:
- [x] client.Apply: https://github.com/kubernetes-sigs/controller-runtime/issues/347
- [x] https://github.com/kubernetes-sigs/controller-runtime/pull/3253
- [x] k/k: interface for ApplyConfigurations: https://github.com/kubernetes/kubernetes/issues/118138
- [x] Support for Unstructured
- [x] fake client support for SSA: https://github.com/kubernetes-sigs/controller-runtime/issues/2341
- [x] https://github.com/kubernetes-sigs/controller-runtime/pull/2981
- [x] k/k: extend tracker: https://github.com/kubernetes/kubernetes/pull/132004
- [ ] SubResource Apply: https://github.com/kubernetes-sigs/controller-runtime/pull/3321
- [x] Real client
- [x] Deprecate client.Apply again (see: https://github.com/kubernetes-sigs/controller-runtime/pull/3307)
- [ ] Fake client
- [ ] Non-Status subresources
- [x] Real client
Tasks controller-tools:
- [x] Generation of ApplyConfigurations: https://github.com/kubernetes-sigs/controller-tools/pull/818
- [ ] Generation of Extract functions (details: https://github.com/kubernetes-sigs/controller-runtime/issues/3183#issuecomment-2782827772)
cc @alvaroaleman @vincepri
cc @JoelSpeed
@sbueringer Could you describe what's the gap with SSA in controller-runtime? I was under the impression SSA is already supported with Client.Patch(ctx, obj, client.Apply)
@sbueringer Could you describe what's the gap with SSA in controller-runtime? I was under the impression SSA is already supported with Client.Patch(ctx, obj, client.Apply)
Yep that works, but we want it to be a first-class citizen. Please see the initial issue for a list of missing things.
@sbueringer Could you describe what's the gap with SSA in controller-runtime? I was under the impression SSA is already supported with Client.Patch(ctx, obj, client.Apply)
Yep that works, but we want it to be a first-class citizen. Please see the initial issue for a list of missing things.
I think I ran into a bug with SSA: https://github.com/kubernetes-sigs/controller-runtime/issues/347#issuecomment-2776561905
Let me know if this is related to the issue being fixed.
One gap that we have is the extraction functions for the ApplyConfigurations, which require openapi.json to be able to generate.
The first step of which is to use kube-openapi to generate the openapi definitions as generated Go code.
This code is then imported into models-schema which then generated an openapi.json file, much like you could retrieve from a Kube API server.
This openapi.json is then fed into the OpenAPISchemaFilePath argument to the applyconfiguration gen, which allows it to generate the extraction functions.
I'd be interested to see if there was a way that we could combine the first two stages so that we don't have to output the intermediate generated go code, and could put the openapi.json file in a known location or even a temp location for creating the extract functions
The first step of which is to use kube-openapi to generate the openapi definitions as generated Go code.
This code is then imported into models-schema which then generated an openapi.json file, much like you could retrieve from a Kube API server.
This openapi.json is then fed into the OpenAPISchemaFilePath argument to the applyconfiguration gen, which allows it to generate the extraction functions.
@mrIncompetent pointed out that since we alerady have code for openapi generation in controller-tools as we generade the CRD schema, we might be able to re-use that for the first two steps in place of kube-openapi and models-schema.
Hi, thanks a lot for this effort!
Is it also planned to provide Apply on SubResourceWriter? Or any advice what we should do with something like clnt.Status().Patch(ctx, obj, client.Apply)? My understanding is that we can't replace it with a clnt.Apply supplying an unstructured object like below because it can't write a subresource.
"Object": {
"apiVersion": "foo/v1alpha1",
"kind": "Bar",
"metadata": {
"name": "baz",
"namespace": "default"
},
"status": {
// ...
}
}
Is it also planned to provide Apply on SubResourceWriter?
Yeah, this is a known missing piece, I've added it to the top level description.