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

export default SecurityContextConstraints for OCP clusters #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

weirdwiz
Copy link
Contributor

Describe what this PR does

This PR exports the SecurityContextConstraints for admins deploying the ceph-csi-operators in OCP clusters

Is there anything that requires special attention

Do you have any questions?

Is the change backward compatible?

Are there concerns around backward compatibility?

Provide any external context for the change, if any.

For example:

  • Kubernetes links that explain why the change is required
  • Ceph-CSI spec related changes/catch-up that necessitates this patch
  • golang related practices that necessitates this change

Related issues

Mention any github issues relevant to this PR. Adding below line
will help to auto close the issue once the PR is merged.

Fixes: #issue_number

Future concerns

List items that are not part of the PR and do not impact it's
functionality, but are work items that can be taken up subsequently.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow
    guidelines in the developer
    guide
    .
  • Reviewed the developer guide on Submitting a Pull
    Request
  • Pending release
    notes

    updated with breaking and/or notable changes for the next major release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

api/go.mod Outdated Show resolved Hide resolved
api/ocp/scc.go Outdated

// NewSecurityContextConstraints exports a default configuration of the
// Security Context Constraints to deploy ceph-csi-operator in an OCP cluster
func NewSecurityContextConstraints(namespace string, name string) *secv1.SecurityContextConstraints {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need to scc.yaml in config folder which is required for upstream users and we can use it as template here and make it customizable with serviceaccount name and namespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

add scc.yaml as a template, initially followed that route. but importing it threw some errors, so pivoted to generating the yaml from go code.
but there was some issue with me pushing the package, that resulted the issue. pivoted back to the template

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are some improvement required, lets talk about it in today's standup

api/go.mod Outdated Show resolved Hide resolved
api/ocp/scc.go Show resolved Hide resolved
@weirdwiz weirdwiz force-pushed the api-module branch 3 times, most recently from 3657a34 to 2aead8e Compare August 1, 2024 11:28
api/ocp/scc.yaml Outdated
Comment on lines 27 to 31
- system:serviceaccount:{{.Namespace}}:csi-rbd-ctrlplugin-sa
- system:serviceaccount:{{.Namespace}}:csi-cephfs-ctrlplugin-sa
- system:serviceaccount:{{.Namespace}}:csi-nfs-ctrlplugin-sa
- system:serviceaccount:{{.Namespace}}:csi-rbd-nodeplugin-sa
- system:serviceaccount:{{.Namespace}}:csi-cephfs-nodeplugin-sa
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having a template here doesnt help upstream Rook users. we need complete yaml where Rook or user can use it directly

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

@nb-ohad
Copy link
Collaborator

nb-ohad commented Aug 1, 2024

@weirdwiz This PR is trying to attack multiple things at once:

  • Make the API folder its own package
  • Add SCC template

Please separate into two different PRs

api/ocp/scc.go Outdated Show resolved Hide resolved
Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
this commit exports SecurityContextConstraints to let the user deploy
the ceph-csi-operator in OCP clusters

Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
api/ocp/scc.go Show resolved Hide resolved
@nb-ohad
Copy link
Collaborator

nb-ohad commented Aug 8, 2024

@weirdwiz Can you please rebase this and get rid of the first commit? (which is already addressed on a different PR that got merged)

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Sep 5, 2024

@weirdwiz ping

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants