Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Enable the status subresource for k8s 1.12 #809

Closed
hasbro17 opened this issue Dec 3, 2018 · 2 comments · Fixed by #787
Closed

Enable the status subresource for k8s 1.12 #809

hasbro17 opened this issue Dec 3, 2018 · 2 comments · Fixed by #787
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@hasbro17
Copy link
Contributor

hasbro17 commented Dec 3, 2018

Feature Request

The status subresource for CRDs is beta and enabled by default for k8s 1.12 clusters
https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#subresources

Once the SDK updates to k8s 1.12 it should support enabling the status subresource for CRDs by default when generating the CRD yaml manifest.
See for more details: https://blog.openshift.com/kubernetes-custom-resources-grow-up-in-v1-10/

Along with that the examples using the client should be updated to use the status client c.Status().Update() to only update the status when needed.
https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/interfaces.go#L88

With the status subresource enabled controllers can update the status, and ignore any events that don't have changes to metadata.Generation (only updates when spec changes) by filtering them out via predicates.

@hasbro17 hasbro17 added kind/feature Categorizes issue or PR as related to a new feature. docs labels Dec 3, 2018
@cmoulliard
Copy link

it should support enabling the status subresource

Will operator-sdk support it using a comment included part of the API Type ?

@hasbro17
Copy link
Contributor Author

hasbro17 commented Dec 5, 2018

@cmoulliard It will be enabled by default for all CRD manifests that the SDK generates. That seems to fit in with the controller pattern of how status is meant to be updated.
Users can update the CRD manifest to turn it off if they don't want to use it.

Also it's already beta in k8s 1.11 so we don't need to wait for the update to k8s 1.12.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
2 participants