Skip to content
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

Need a way to notify contoller-manager from each controller #387

Closed
taoj-action opened this issue Apr 5, 2019 · 2 comments
Closed

Need a way to notify contoller-manager from each controller #387

taoj-action opened this issue Apr 5, 2019 · 2 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@taoj-action
Copy link

I am trying the figure a way for doing health check (liveness and readiness) for controller manager created using either kubebuilder or operator-sdk. The health check result should be determined by health check result of each controller. Therefore, there should be a way to notify manager from controller by adding a function inside manager interface. (basically, Observer pattern)
https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/manager/manager.go#L56
So, each controller can call mgr.Update() to notify manager.

The other approach is to use channel but currently only stop channel is available.
https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/manager/internal.go#L227

@DirectXMan12
Copy link
Contributor

/kind feature

We do have a bug to track health and liveness support, it was just not quite titled correctly. I'm going to close this as a duplicate. Please weigh in on the other bug: #297

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 8, 2019
@szykes
Copy link

szykes commented Aug 31, 2023

@DirectXMan12 I ask this just to make sure. Does "Closed" status of this ticket mean the following code snippet will not respond, when any problems happen within the controller? Any problem can be a hanging reconciliation, an internal issue in kubebuilder framework, etc.

    if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
        setupLog.Error(err, "unable to set up health check")
        os.Exit(1)
    }

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.
Projects
None yet
Development

No branches or pull requests

4 participants