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

cleanup: remove extra permission in templates #2518

Merged
merged 13 commits into from Sep 22, 2021

Conversation

Madhu-1
Copy link
Collaborator

@Madhu-1 Madhu-1 commented Sep 17, 2021

This PR removes all the extra permissions provided for CephFS, RBD, and snapshot templates and also it removes extra PSP permission and helps us to keep the minimal permission required for cephcsi to work.

Signed-off-by: Madhu Rajanna madhupr007@gmail.com

@mergify mergify bot added the cleanup label Sep 17, 2021
@Madhu-1 Madhu-1 added the component/deployment Helm chart, kubernetes templates and configuration Issues/PRs label Sep 17, 2021
@Madhu-1 Madhu-1 marked this pull request as draft September 17, 2021 10:17
@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Sep 20, 2021

/retest all

@Madhu-1 Madhu-1 marked this pull request as ready for review September 20, 2021 06:01
privileged: true
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Madhu-1 just wanted to mention one thing here, eventhough we mention kube as a known to work CO, I am wondering does this have any effect on OCP . Because the previlege and caps are treated with bit different way in OCP. so if at all we can do a quick test of this PR against OCP that would be good. I dont have solid confirmation that, this will break or work , so sharing my thought .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as this is a provisioner pod we don't need this to be privileged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have tested this with OCP 4.8 everything was working fine when the provisioner pod is not privileged.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cool, if you have tested it against one of the OCP versions, we are good . 👍

- "secret"
- "downwardAPI"
- "projected"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Madhu-1 is it failing without projected ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tested with multiple kubernetes versions, Yes it's failing without projected and secrets

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm :(, I dont see a reason to have a projected volumes here, however if its failing without that , lets live with it .. thanks for the clarification.

@humblec
Copy link
Collaborator

humblec commented Sep 20, 2021

Mostly looks good, just waiting for a confirmation on projected volume conf in snapshot PSP. 👍

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Sep 20, 2021

/retest all

Mostly looks good, just waiting for a confirmation on projected volume conf in snapshot PSP.

Yes without project and secret most of the deployment fails in different kubernetes versions #2518 (comment)

@Madhu-1 Madhu-1 requested review from humblec and a team September 20, 2021 09:24
@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Sep 21, 2021

/retest ci/centos/upgrade-tests-rbd

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Sep 21, 2021

/retest ci/centos/mini-e2e-helm/k8s-1.22

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Sep 21, 2021

/retest ci/centos/mini-e2e/k8s-1.20

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented Sep 21, 2021

Sep 21 09:44:47.639: failed to write IO, err: command terminated with exit code 2, stdErr: /bin/sh: 1: cannot create /var/lib/www/html/test: Read-only file system

ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- https://github.com/ceph/ceph-csi +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://github.com/ceph/ceph-csi/': Failed to connect to github.com port 443: Connection timed out
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)

git fetch --tags --force --progress -- https://github.com/ceph/ceph-csi +refs/heads/:refs/remotes/origin/ # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- https://github.com/ceph/ceph-csi +refs/heads/:refs/remotes/origin/" returned status code 128:
stdout:
stderr: fatal: unable to access 'https://github.com/ceph/ceph-csi/': Failed to connect to github.com port 443: Connection timed out

we dont need securityContext for the cephfs provisioner
pod as its not doing any special operations like mounts,
selinux etc.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
we dont need securityContext for the cephfs provisioner
pod as its not doing any special operations.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
we dont need securityContext for the rbd provisioner
pod as its not doing any special operations like map
,unmap selinux etc.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
rbd deployment doesnot need extra permission like
privileged,Capabilities and remove unwanted volumes.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
removed extra volume permissions from the rbd
nodeplugin PSP.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
cephfs deployment doesnot need extra permission like
privileged,Capabilities and remove unwanted volumes.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
removed extra volume permissions from the cephfs
nodeplugin PSP.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
cephfs deployment doesnot need extra permission like
privileged,Capabilities and reduce unwanted volumes.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
removed extra volume permissions from the cephfs
nodeplugin PSP.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
rbd deployment doesnot need extra permission like
privileged and extra volumes etc.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
removed extra volume permissions from the rbd
nodeplugin PSP

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
we dont need securityContext for the cephfs provisioner
pod as its not doing any special operations like mount,
selinux operations etc .

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
removed extra PSP permissions added for the
snapshot controller deployment

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@Madhu-1 Madhu-1 closed this Sep 22, 2021
@Madhu-1 Madhu-1 reopened this Sep 22, 2021
@mergify mergify bot merged commit 981835a into ceph:devel Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup component/deployment Helm chart, kubernetes templates and configuration Issues/PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants