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

SCC-pinning for openshift workloads #754

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

kramaranya
Copy link
Contributor

@kramaranya kramaranya commented Jul 30, 2024

This PR explicitly sets the required SCC to be used to admit pods. The SCC chosen is the one that the pods are already getting admitted with, which means that this brings no change to the SCC used.

In some cases, custom SCCs can have higher priority than default SCCs, which means that they will be chosen over the default ones. This can lead to unexpected results; in order to protect openshift workloads from this, we must explicitly pin the required SCC to all our workloads in order to make sure that the expected one will be used.

Copy link

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@zeeke
Copy link
Member

zeeke commented Jul 30, 2024

These changes are about setting a SecurityContextContraint for the operator's workload, in order to avoid getting assigned one by a custom priority. See [1] and [2].
Also, having the openshift.io/required-scc annotation in a non-Openshift cluster should be harmless, hence no need to add { if .IsOpenshift } statements.

@kramaranya can you confirm my statement? Is there any other information that can be useful for reviewing this?

[1] https://docs.openshift.com/container-platform/4.16/authentication/managing-security-context-constraints.html#scc-prioritization_configuring-internal-oauth
[2] https://docs.openshift.com/container-platform/4.16/authentication/managing-security-context-constraints.html#default-sccs_configuring-internal-oauth

@coveralls
Copy link

coveralls commented Jul 30, 2024

Pull Request Test Coverage Report for Build 10317864792

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 45.189%

Totals Coverage Status
Change from base Build 10305741803: 0.0%
Covered Lines: 6532
Relevant Lines: 14455

💛 - Coveralls

@kramaranya
Copy link
Contributor Author

@zeeke you are absolutely right, thanks for gathering this information.

Here is a jira AUTH-482, which might be useful for reviewing this. I have also updated a description of pr.

Copy link
Collaborator

@SchSeba SchSeba left a comment

Choose a reason for hiding this comment

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

I think we also need this on the operator itself so please add it in the right place of the operator yamls

Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

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

Only one comment from my side, then LGTM.

@adrianchiris , @ykulazhenkov can you take a look at this? These annotations should not harm non-OpenShift deployments.

deploy/operator.yaml Show resolved Hide resolved
Copy link
Collaborator

@ykulazhenkov ykulazhenkov left a comment

Choose a reason for hiding this comment

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

LGTM

@zeeke zeeke merged commit 2dec53f into k8snetworkplumbingwg:master Aug 9, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants