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 explicit securityContexts to the controller #1868

Conversation

chrischdi
Copy link
Member

@chrischdi chrischdi commented Apr 6, 2023

What this PR does / why we need it:

This does not really change the configuration, it just makes it explicit and enforce the defaults, except for the seccompPolicy which changes from Unconfined to RuntimeDefault. Syscalls filtered by RuntimeDefault policy are 95% namespaced and require capabilities (which we drop) in the first place, so no practical change there either.

This allows to be compatible to the restricted pod security admission profile.

This is a recommendation in the CAPI v1.3->1.4 upgrade guide.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Prior art:

Note: this requires the v1.4 branch of CAPI for usage with tilt, because the Tiltfile then removes the securityContext for allowing it to succeed.

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

Explicitly set securityContexts in the manifests to comply with the restricted pod security admission profile.

This does not really change the configuration, it just makes it explicit and enforce
the defaults, except for the seccompPolicy which changes from Unconfined to RuntimeDefault.
Syscalls filtered by RuntimeDefault policy are 95% namespaced and require capabilities
(which we drop) in the first place, so no practical change there either.

This allows to be compatible to the restricted pod security admission profile.

This is a recommendation in the CAPI v1.3->1.4 upgrade guide.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 6, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 6, 2023
@k8s-ci-robot
Copy link
Contributor

@chrischdi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-vsphere-verify-crds f46be9a link false /test pull-cluster-api-provider-vsphere-verify-crds

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@chrischdi
Copy link
Member Author

@chrischdi: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-vsphere-verify-crds f46be9a link false /test pull-cluster-api-provider-vsphere-verify-crds
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

I don't know why this creates a diff for the CRD's 🤔 must be an unrelated change.

@srm09
Copy link
Contributor

srm09 commented Apr 6, 2023

The verify-crds jobs has been flaking out since the usage of controller gen in CAPV Makefile provides multiple paths fields when running the command, which causes the output to be non deterministic. This is being tracked in #1757

@srm09
Copy link
Contributor

srm09 commented Apr 6, 2023

@chrischdi to understand more about this one, does it mean that the latest version of the CAPV might not work with previous CAPI version, say v1.3.x post this change?

@chrischdi
Copy link
Member Author

@chrischdi to understand more about this one, does it mean that the latest version of the CAPV might not work with previous CAPI version, say v1.3.x post this change?

When this would get merged, running capv with tilt requires this change: kubernetes-sigs/cluster-api#7846
This change in tilt-prepare removes the securityContext, because it requires more privileges when running with dlv or for doing tilt stuff.

Generally: running with capi v1.3 is no issue at all, just when capv gets run with tilt :-)

@chrischdi
Copy link
Member Author

Ping @srm09 :-) if you find some time

@srm09
Copy link
Contributor

srm09 commented Apr 24, 2023

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: srm09

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2023
@k8s-ci-robot k8s-ci-robot merged commit faf5e92 into kubernetes-sigs:main Apr 24, 2023
@chrischdi chrischdi deleted the prepare-securitycontext-for-restricted-psa branch April 24, 2023 21:19
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants