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 CRD for SPOD deployment configuration #336

Merged
merged 3 commits into from Mar 3, 2021

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Mar 3, 2021

What type of PR is this?

/kind feature
/kind design
/kind api-change

What this PR does / why we need it:

This adds a CRD called SecurityProfilesOperatorDaemon (short is spod),
which will both configure the SPOD daemon and reflect its status in the
cluster.

The Custom Resource looks very similar to the ConfigMap we used to have, but it
has the advantage that the fields are actually validated by the CRD itself, as
well as two status fields:

  • State: A single word description of the status of the spod instance

  • Conditions: A standard set of conditions which indicate observations about
    the deployment. These help us interact with the deployment using kubectl.

This also enables the deployment of as many SPO daemons as needed. Where,
an instance of a SPOD object matches an instance of the DaemonSet. This is
because the DaemonSet now is created with the same name as the SPOD
object. Thus, one can simply create a new DaemonSet by creating a SPOD
object with a different name.

Which issue(s) this PR fixes:

Fixes #327

Does this PR have test?

N/A.

Does this PR introduce a user-facing change?

The DaemonSet configuration is now handled by a Custom Resource called
SecurityProfilesOperatorDaemon.

@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. kind/design Categorizes issue or PR as related to design. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Mar 3, 2021
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 3, 2021
@JAORMX JAORMX force-pushed the spod-crd branch 2 times, most recently from 322179e to f7fc890 Compare March 3, 2021 09:02
@codecov-io
Copy link

codecov-io commented Mar 3, 2021

Codecov Report

Merging #336 (13ab169) into master (9514b79) will decrease coverage by 0.83%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
- Coverage   28.17%   27.34%   -0.84%     
==========================================
  Files           9        9              
  Lines         653      673      +20     
==========================================
  Hits          184      184              
- Misses        450      470      +20     
  Partials       19       19              
Flag Coverage Δ
unittests 27.34% <0.00%> (-0.84%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/pkg/manager/spod/setup.go 53.84% <0.00%> (+17.94%) ⬆️
internal/pkg/manager/spod/spod_controller.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9514b79...13ab169. Read the comment docs.

@JAORMX JAORMX closed this Mar 3, 2021
@JAORMX JAORMX reopened this Mar 3, 2021
@JAORMX JAORMX closed this Mar 3, 2021
@JAORMX JAORMX reopened this Mar 3, 2021
@JAORMX JAORMX closed this Mar 3, 2021
@JAORMX JAORMX reopened this Mar 3, 2021
This adds a CRD called SecurityProfilesOperatorDaemon (short is spod),
which will both configure the SPOD daemon and reflect its status in the
cluster.

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
Objects not being found are not necessarily a bad thing when deleting
several resources: e.g. when tearing down the operator, the CRDs get
deleted first, later on it might fail trying to delete an instance of a
custom resource.

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM, just a nitty nit.

api/spod/v1alpha1/groupversion_info.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 3, 2021
Co-authored-by: Sascha Grunert <sgrunert@redhat.com>
@JAORMX
Copy link
Contributor Author

JAORMX commented Mar 3, 2021

@saschagrunert took in your suggestion. Thanks!

Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JAORMX, pjbgf, 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:
  • OWNERS [pjbgf,saschagrunert]

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

@k8s-ci-robot k8s-ci-robot merged commit 65ad696 into kubernetes-sigs:master Mar 3, 2021
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/design Categorizes issue or PR as related to design. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make security-profiles-operator daemonset configurable
5 participants