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

[stable/grafana]: add RBAC - #5386

Merged
k8s-ci-robot merged 15 commits into
helm:masterfrom
mikeraimondi:grafana-rbac
May 16, 2018
Merged

k8s-ci-robot merged 15 commits into
helm:masterfrom
mikeraimondi:grafana-rbac

Conversation

@mikeraimondi

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • Adds the option to create a role and roleBinding
  • Adds the option to create a podSecurityPolicy
  • Adds the option to create a serviceAccount or use an existing serviceAccount

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Details

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 3, 2018
@mikeraimondi

Copy link
Copy Markdown
Contributor Author

CLA signed

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 3, 2018
@mikeraimondi

Copy link
Copy Markdown
Contributor Author

/assign @linki

apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "grafana.fullname" . }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add standard labels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@unguiculus

Copy link
Copy Markdown
Member

/assign

privileged: false
allowPrivilegeEscalation: false
allowedCapabilities:
- CAP_CHOWN

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This and the 'RunAsAny' on line 32 are only needed for images prior to 5.1.0. I could condition on the image tag to render the most restrictive PSP. I'm not sure if that's needed/desired.

What's the typical approach, here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally, I'd move forward with the chart and not make it backwards-compatible.

@zanhsieh @rtluckie What do you think?

@zanhsieh zanhsieh May 12, 2018 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agreed with @unguiculus . I think we might add kubeVersion in Chart.yaml file (e.g. kubeVersion: 1.9) as charts.md suggested.

Comment thread stable/grafana/templates/_helpers.tpl Outdated
*/}}
{{- define "grafana.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "grafana.fullname" .) .Values.rbac.serviceAccountName }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.Values.serviceAccount.name

Comment thread stable/grafana/templates/_helpers.tpl Outdated
{{- if .Values.serviceAccount.create -}}
{{ default (include "grafana.fullname" .) .Values.rbac.serviceAccountName }}
{{- else -}}
{{ default "default" .Values.rbac.serviceAccountName }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.Values.serviceAccount.name

Comment thread stable/grafana/Chart.yaml Outdated
@@ -1,5 +1,5 @@
name: grafana
version: 1.3.0
version: 1.3.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bump minor version.

privileged: false
allowPrivilegeEscalation: false
allowedCapabilities:
- CAP_CHOWN

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally, I'd move forward with the chart and not make it backwards-compatible.

@zanhsieh @rtluckie What do you think?

@unguiculus

Copy link
Copy Markdown
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 12, 2018

@zanhsieh zanhsieh left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/lgtm

@mikeraimondi

Copy link
Copy Markdown
Contributor Author

CI is showing this: Error: Chart requires kubernetesVersion: >=1.8 which is incompatible with Kubernetes v1.9.6-gke.1

Any idea what that's about?

@zanhsieh

Copy link
Copy Markdown
Collaborator

@mikeraimondi It's about the recently update grafana chart RBAC standardization.

@mikeraimondi

mikeraimondi commented May 16, 2018 •

Copy link
Copy Markdown
Contributor Author

Updated with latest changes and passing CI! Let me know if anything else needs to be fixed up. CC @unguiculus

@unguiculus

Copy link
Copy Markdown
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 16, 2018
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikeraimondi, unguiculus, zanhsieh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 May 16, 2018
@k8s-ci-robot
k8s-ci-robot merged commit 81eca40 into helm:master May 16, 2018
voron pushed a commit to dysnix/helm-charts that referenced this pull request Sep 5, 2018
* add RBAC to Grafana

* bump version

* add standard labels

* conditionalize PSP role

* fix whitespace

* fix reference to serviceAccount

* update version to not require root or chown

* set minimum kubeVersion to earliest version w/ stable RBAC

* attempt to fix test failure

* blind attempt to fix CI failure

* match versions between stable RBAC and possible breaking changes in 2.x

* include pre-release versions

Signed-off-by: voron <[email protected]>
hickey pushed a commit to hickey/charts that referenced this pull request Jun 12, 2019
* add RBAC to Grafana

* bump version

* add standard labels

* conditionalize PSP role

* fix whitespace

* fix reference to serviceAccount

* update version to not require root or chown

* set minimum kubeVersion to earliest version w/ stable RBAC

* attempt to fix test failure

* blind attempt to fix CI failure

* match versions between stable RBAC and possible breaking changes in 2.x

* include pre-release versions
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. 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.

5 participants