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

Add liveness/startup probe to SPOD #430

Merged
merged 1 commit into from
May 11, 2021

Conversation

saschagrunert
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

We now add a liveness probe for giving the SPOD more time on startup to
become ready. Every controller should at least run one Reconile to be
marked as ready.

We now also add a new interface Controller
(internal/pkg/controller/controller.go), which has to be fulfilled by
every SPOD controller. This allows to simplify the implementation in
main.

Which issue(s) this PR fixes:

None

Does this PR have test?

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

Added liveness and startup probe to operator daemon set to streamline the operator stratup.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 30, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 30, 2021
@saschagrunert saschagrunert force-pushed the liveness-probe branch 5 times, most recently from 53651fe to b220a16 Compare April 30, 2021 10:45
@jhrozek
Copy link
Contributor

jhrozek commented Apr 30, 2021

First, I really like the new shared Controller interface, that's a really nice refactor.

About the probes, maybe a silly question, but I'm very good at asking those -- aren't the Reconcile loops reactive and invoked only when the watcher hits something? Meaning, would the loop go through at least once if there are no selinux/seccomp profiles installed by default or if all are removed by the admin?

@saschagrunert
Copy link
Member Author

First, I really like the new shared Controller interface, that's a really nice refactor.

Thank you! 🙏

About the probes, maybe a silly question, but I'm very good at asking those -- aren't the Reconcile loops reactive and invoked only when the watcher hits something? Meaning, would the loop go through at least once if there are no selinux/seccomp profiles installed by default or if all are removed by the admin?

Indeed the reconcile will not be hit if no objects to react on are available. That's exactly the reason why I cannot tell right now when the recording reconciler is ready. For seccomp and selinux profiles I just assume that we will definitely ship some default ones, which can be then used as indicator for readiness.

The other way around, do you have anything in mind how we could indicate readiness in a better way?

@codecov-commenter
Copy link

codecov-commenter commented May 3, 2021

Codecov Report

Merging #430 (8dc95bf) into master (30f83f7) will increase coverage by 0.31%.
The diff coverage is 70.00%.

@@            Coverage Diff             @@
##           master     #430      +/-   ##
==========================================
+ Coverage   38.58%   38.90%   +0.31%     
==========================================
  Files          22       23       +1     
  Lines         990     1000      +10     
==========================================
+ Hits          382      389       +7     
- Misses        593      596       +3     
  Partials       15       15              

@jhrozek
Copy link
Contributor

jhrozek commented May 3, 2021 via email

@saschagrunert
Copy link
Member Author

Let's see if I can get the e2e tests happy.

@saschagrunert
Copy link
Member Author

/retest

1 similar comment
@saschagrunert
Copy link
Member Author

/retest

@saschagrunert saschagrunert changed the title Add liveness/startup probe to SPOD WIP: Add liveness/startup probe to SPOD May 5, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 5, 2021
@saschagrunert
Copy link
Member Author

Decided to carve-out the controller logic into a separate PR (#437) and will rebase this one later.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2021
@saschagrunert saschagrunert changed the title WIP: Add liveness/startup probe to SPOD Add liveness/startup probe to SPOD May 6, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 6, 2021
@saschagrunert
Copy link
Member Author

Rebased on top of the latest master.

@saschagrunert saschagrunert changed the title Add liveness/startup probe to SPOD WIP: Add liveness/startup probe to SPOD May 7, 2021
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 7, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2021
We now add a liveness probe for giving the SPOD more time on startup to
become ready. Every controller should at least run one `Reconile` to be
marked as ready.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@saschagrunert saschagrunert changed the title WIP: Add liveness/startup probe to SPOD Add liveness/startup probe to SPOD May 7, 2021
@k8s-ci-robot k8s-ci-robot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 7, 2021
@saschagrunert
Copy link
Member Author

Ready for review ✔️

@saschagrunert
Copy link
Member Author

@JAORMX @jhrozek please take a look.

Copy link
Contributor

@JAORMX JAORMX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

This is looking great! Since this only addresses the Seccomp controller, we should track as issues the controllers that are missing so they get addressed. We're hoping to onboard someone to the SPO soon and those would be some great introductory tasks.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 11, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JAORMX, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@saschagrunert
Copy link
Member Author

…we should track as issues the controllers that are missing so they get addressed.

Sounds good, opened #442 and #443

@k8s-ci-robot k8s-ci-robot merged commit 342a728 into kubernetes-sigs:master May 11, 2021
@saschagrunert saschagrunert deleted the liveness-probe branch May 11, 2021 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants