Skip to content

Enhance the controller skaffolded in order to support additional patterns #1349

New issue

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

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

Already on GitHub? Sign in to your account

Closed
cmoulliard opened this issue Apr 25, 2019 · 8 comments
Closed
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@cmoulliard
Copy link

Feature Request

Is your feature request related to a problem? Please describe.

One of the most difficult thing due to the event based architecture of k8s and async creation of the different kubernetes resources, is to figure out properly if the children resources created by the Controller when a CR is reconciled are created AND have by the example the status "Running". Such information is mandatory if we would like to report to the user responsible to create a Custom Resource if the application has been deployed sucessfully.

Describe the solution you'd like

I would like to suggest that the controller generated during the skaffolding process includes also the code able to fetch all the children resources populated (e.g pod, replicaSet) and update the status of the CR to by example "installed" if all the children resources status are "Running". Ideally, the children resources which are owned by the CR should be recuperated using an utility function such as fetchAllOwnedResources.

Question : Should we perform this logic within the reconcile function of the CR OR using another controller ?

@lilic
Copy link
Member

lilic commented Apr 26, 2019

So you want the Status support to be added?

@lilic lilic added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 26, 2019
@cmoulliard
Copy link
Author

So you want the Status support to be added?

Yes as I think that this is key feature needed in order to report to the end use using (oc get or kubectl get) if the CR is functionally operational. A CR is a contract between a user and a kubernetes controller in order to install k8s resources and they expect to be informed if the resources have been deployed/updated/removed and if the platform is now ready (= running) in order to continue what they have to do.

@lilic
Copy link
Member

lilic commented Apr 26, 2019

Yes, we have plans to add support and helpers for the Status field. Not sure if we have another github issue for this @joelanford?

@joelanford
Copy link
Member

We have #1143, which is a work in progress. Its scope is only to define types and helpers to make it easier for operator developers to create/modify/remove conditions in status.conditions.

I'm not sure there's a straightforward way for the SDK to implement a fetchAllOwnedResources utility because I don't think there's an OwnerRefSelector option for listing resources. To get similar functionality, I think you'd have to set labels on the resources created by your CR, and then use a label selector to query for them later.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 25, 2019
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 24, 2019
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci-robot
Copy link

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants