Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Add pod security policies for prometheus components #15055

Merged
merged 1 commit into from Aug 17, 2019

Conversation

wfernandes
Copy link
Contributor

@wfernandes wfernandes commented Jun 25, 2019

What this PR does / why we need it:

This PR adds basic Pod Security Policies for the promethues components. This will allow this chart to be installed in an environment that has the PSP admission controller enabled.

Interestingly, there was a PSP included just for the node-exporter job. We just mimicked that PSP and added some for the other jobs.

Special notes for your reviewer:

This is a duplicate of #12825 which as already been approved. Unfortunately, it got stale and the bot closed the PR.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md

@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Jun 25, 2019
@helm-bot helm-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 25, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @wfernandes. Thanks for your PR.

I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 25, 2019
@wfernandes
Copy link
Contributor Author

@gianrubio @mgoodness As mentioned in the description, this PR is a duplicate of #12825 which was approved but it just had a merge conflict which I believe has been resolved.

@wfernandes
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

@wfernandes: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@wfernandes
Copy link
Contributor Author

@gianrubio @mgoodness As mentioned in the description, this PR is a duplicate of #12825 which was approved but it just had a merge conflict which I believe has been resolved.

@@ -1,5 +1,7 @@
rbac:
create: true
podSecurityPolicy:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure enabling PSP is an RBAC related thing, so it probably doesn't belong inside the rbac structure here?

@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus
version: 8.14.3
version: 8.14.4
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's adding a new feature, so i would bump version to 8.15.0

@paulczar
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 15, 2019
@paulczar paulczar self-assigned this Aug 15, 2019
@Benjamintf1 Benjamintf1 force-pushed the prometheus-psps branch 2 times, most recently from d455386 to 92db526 Compare August 15, 2019 20:14
@Benjamintf1
Copy link

We pulled PSP enablement outside of rbac, and upped to 9.0.0 (because moving psp property from under node-exporter to a global property is a breaking change).

@@ -1,5 +1,5 @@
{{- if and .Values.nodeExporter.enabled .Values.rbac.create }}
{{- if .Values.nodeExporter.podSecurityPolicy.enabled }}
{{- if .Values.podSecurityPolicy.enabled }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if we did {{- if or (default .Values.nodeExporter.podSecurityPolicy.enabled false) (.Values.podSecurityPolicy.enabled) }} for these checks, and then put a deprecation message in the NOTES.txt ?

that way its not yet a breaking change, but is also preparing people for deprecation of the old value ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

or if we want the breaking change we could error if .Values.nodeExporter.podSecurityPolicy.enabled is set with a error message with upgrade instructions.

Choose a reason for hiding this comment

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

done!

@dtimm dtimm force-pushed the prometheus-psps branch 2 times, most recently from ab6f016 to 69b34f1 Compare August 16, 2019 22:01
- deprecate nodeExporter.podSecurityPolicy.enabled

Signed-off-by: David Timm <dtimm@pivotal.io>
Co-authored-by: David Timm <dtimm@pivotal.io>
@paulczar
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 17, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: paulczar, wfernandes

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 Aug 17, 2019
@k8s-ci-robot k8s-ci-robot merged commit af1e617 into helm:master Aug 17, 2019
ThoTischner pushed a commit to bitsbeats/charts that referenced this pull request Aug 19, 2019
- deprecate nodeExporter.podSecurityPolicy.enabled

Signed-off-by: David Timm <dtimm@pivotal.io>
Co-authored-by: David Timm <dtimm@pivotal.io>
landorg pushed a commit to landorg/charts that referenced this pull request Aug 19, 2019
- deprecate nodeExporter.podSecurityPolicy.enabled

Signed-off-by: David Timm <dtimm@pivotal.io>
Co-authored-by: David Timm <dtimm@pivotal.io>
Signed-off-by: Roland Gritzer <gritzer.roland@gmail.com>
kengou pushed a commit to kengou/charts that referenced this pull request Sep 18, 2019
- deprecate nodeExporter.podSecurityPolicy.enabled

Signed-off-by: David Timm <dtimm@pivotal.io>
Co-authored-by: David Timm <dtimm@pivotal.io>
@nico-ulbricht
Copy link

This PR seems to have introduced a bug whereas the following error occurs if rbac.enabled is true but podSecurity.enabled is false:

Error: rpc error: code = Unknown desc = validation failed: error validating "": error validating data: ValidationError(ClusterRole): missing required field "rules" in io.k8s.api.rbac.v1beta1.ClusterRole

Which seems to be caused by creating a ClusterRole without rules here: https://github.com/helm/charts/pull/15055/files#diff-055e5eaaea98daeb77e0619ee5effa11R9

@Benjamintf1
Copy link

Benjamintf1 commented Sep 19, 2019

@nico-ulbricht ahh, that makes sense. It should probubly encompase the entire clusterrole. (at least, until another rule is added).

ramkumarvs pushed a commit to yugabyte/charts-helm-fork that referenced this pull request Sep 30, 2019
- deprecate nodeExporter.podSecurityPolicy.enabled

Signed-off-by: David Timm <dtimm@pivotal.io>
Co-authored-by: David Timm <dtimm@pivotal.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. ok-to-test size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants