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

helm chart: add container security context #3322

Closed
wants to merge 3 commits into from

Conversation

viktoriaas
Copy link

This change adds container security context to admission, controller, scheduler Deployments and scheduler Job. Container security context is necessary in some restricted environments, e.g. in environment that employs Restricted Pod Security Standard as default.

@volcano-sh-bot
Copy link
Contributor

Welcome @viktoriaas!

It looks like this is your first PR to volcano-sh/volcano 馃帀.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 19, 2024
@viktoriaas
Copy link
Author

/assign @william-wang

@Monokaix
Copy link
Member

Hi, please also update README Configuration field and use git commit -s to sign off your commit.

@viktoriaas
Copy link
Author

@Monokaix hi, I updated README and signed off the commits.

@Monokaix
Copy link
Member

@Monokaix hi, I updated README and signed off the commits.

Please also rebase master and submit one clean pr with git squash : )

@viktoriaas viktoriaas closed this Feb 19, 2024
@volcano-sh-bot volcano-sh-bot added retest-not-required-docs-only approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 19, 2024
@Monokaix
Copy link
Member

/reopen

@volcano-sh-bot
Copy link
Contributor

@Monokaix: Reopened this PR.

In response to this:

/reopen

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.

@volcano-sh-bot volcano-sh-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed retest-not-required-docs-only approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 19, 2024
@viktoriaas
Copy link
Author

@Monokaix Hi, I tried to create one clean commit but ended up messing up my forked repo and somehow closing this issue 😅 I thought I would end up with one clean commit but there one merge I can't get rid of. I'm sorry for the mess, please let me know if it's okay this way or I should fix the merge. Thanks!

@Monokaix
Copy link
Member

@Monokaix Hi, I tried to create one clean commit but ended up messing up my forked repo and somehow closing this issue 😅 I thought I would end up with one clean commit but there one merge I can't get rid of. I'm sorry for the mess, please let me know if it's okay this way or I should fix the merge. Thanks!

You can checkout a new local branch based on master and then cherry-pick your commit to it and force push your repo to remove the merge commit.

@viktoriaas viktoriaas closed this Feb 20, 2024
@volcano-sh-bot volcano-sh-bot added retest-not-required-docs-only approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 20, 2024
@Monokaix
Copy link
Member

/reopen

@volcano-sh-bot
Copy link
Contributor

@Monokaix: Failed to re-open PR: state cannot be changed. There are no new commits on the viktoriaas:master branch.

In response to this:

/reopen

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.

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign william-wang
You can assign the PR to them by writing /assign @william-wang in a comment when ready.

The full list of commands accepted by this bot can be found 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

@volcano-sh-bot volcano-sh-bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 20, 2024
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign william-wang
You can assign the PR to them by writing /assign @william-wang in a comment when ready.

The full list of commands accepted by this bot can be found 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

@volcano-sh-bot volcano-sh-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 20, 2024
@viktoriaas
Copy link
Author

@Monokaix finally one clean commit! Thanks for the patience!

@@ -150,4 +151,8 @@ spec:
- -v=4
- 2>&1
imagePullPolicy: {{ .Values.basic.image_pull_policy }}
{{- if $controller_container_sc }}
securityContext:
{{- toYaml $controller_container_sc | nindent 14 }}
Copy link
Member

Choose a reason for hiding this comment

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

Why nindent is 14 here but other places are 12?

Copy link
Author

Choose a reason for hiding this comment

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

I followed the setting from resources field of the container, to be consistent. In other deployments, resources has nindent 12 as well, just in this one 14

Copy link
Member

Choose a reason for hiding this comment

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

But nindent of all deployments should be 12 or 14, we should check that by helm template to get a correct value, right?

Copy link
Author

Choose a reason for hiding this comment

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

I tested with helm template and resulting YAMLs are produced correctly and can be applied. For functionality, it doesn't matter if indents are the same across the deployments nor it matters if the indents are the same inside one YAML file as long as indents are used consistently at the same level inside one logical section - e.g. all items of map/list are are indented the same.

The controller deployment already featured 14 so I left it that way but of course, can be changed to 12 to align with the rest of the deployments. I can change that, if desired (but it will be one more commit I guess)

Copy link
Member

Choose a reason for hiding this comment

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

You can change it to 12 in this commit: )

this change adds container security context support which might be
required in some restricted environments

Signed-off-by: viktoriaas <viktoria.spisakovaa@gmail.com>
@Monokaix
Copy link
Member

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2024
@Monokaix
Copy link
Member

Monokaix commented Mar 8, 2024

Hi, please use make update-development-yaml and add code changes to make CI happy.

@volcano-sh-bot volcano-sh-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 12, 2024
@volcano-sh-bot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

Signed-off-by: viktoriaas <viktoria.spisakovaa@gmail.com>
@volcano-sh-bot volcano-sh-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 12, 2024
@viktoriaas
Copy link
Author

Hi @Monokaix , I synced my branch with upstream and then used make update-development-yaml. Hope it's okay!

@@ -0,0 +1,220 @@
apiVersion: apiextensions.k8s.io/v1
Copy link
Member

Choose a reason for hiding this comment

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

Why those are added?

Copy link
Author

Choose a reason for hiding this comment

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

I only performed make update-development-yaml but I haven't noticed go version set to 1.20 in go.mod. I built today again but with go 1.20 and the result looks much better. Would you mind having a look on a separate branch in my forked volcano repo with the changes? If that's better, I can rather open a new PR from that branch (and this one can be closed) or merge that branch to master.

Copy link
Member

Choose a reason for hiding this comment

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

It's OK: )

Copy link
Author

Choose a reason for hiding this comment

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

so should I merge that new branch to the master? 😄

Copy link
Member

Choose a reason for hiding this comment

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

If you are not familiar with git, you can open a new pr with a new commit and close this one.

@@ -1,6 +1,8 @@
module volcano.sh/volcano

go 1.20
Copy link
Member

Choose a reason for hiding this comment

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

This should not be changed.

Copy link
Author

Choose a reason for hiding this comment

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

the same comment as above. I did something wrong in the process, sorry

@viktoriaas
Copy link
Author

closing as per @Monokaix comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants