mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
allowing option to deploy namespaced grafana rbac rules (#10846)
Signed-off-by: Sergio Millan Rodriguez <sergio.rodriguez@ticketmaster.co.uk>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
11fa809d7a
commit
fee2557f99
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: grafana
|
||||
version: 1.25.3
|
||||
version: 1.25.4
|
||||
appVersion: 5.4.3
|
||||
kubeVersion: "^1.8.0-0"
|
||||
description: The leading tool for querying and visualizing time series and metrics.
|
||||
|
||||
@@ -88,6 +88,7 @@ The command removes all the Kubernetes components associated with the chart and
|
||||
| `admin.userKey` | The key in the existing admin secret containing the username. | `"admin-user"` |
|
||||
| `admin.passwordKey` | The key in the existing admin secret containing the password. | `"admin-password"` |
|
||||
| `rbac.create` | Create and use RBAC resources | `true` |
|
||||
| `rbac.namespaced` | Creates Role and Rolebinding instead of the default ClusterRole and ClusteRoleBindings for the grafana instance | `false` |
|
||||
| `rbac.pspEnabled` | Create PodSecurityPolicy (with `rbac.create`, grant roles permissions as well) | `true` |
|
||||
| `rbac.pspUseAppArmor` | Enforce AppArmor in created PodSecurityPolicy (requires `rbac.pspEnabled`) | `true` |
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
@@ -20,4 +20,4 @@ roleRef:
|
||||
kind: ClusterRole
|
||||
name: {{ template "grafana.fullname" . }}-clusterrole
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
{{- if .Values.rbac.create -}}
|
||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||
kind: Role
|
||||
metadata:
|
||||
@@ -8,11 +8,24 @@ metadata:
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.rbac.pspEnabled }}
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.rbac.pspEnabled (and .Values.rbac.namespaced (or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled)) }}
|
||||
rules:
|
||||
{{- if .Values.rbac.pspEnabled }}
|
||||
- apiGroups: ['extensions']
|
||||
resources: ['podsecuritypolicies']
|
||||
verbs: ['use']
|
||||
resourceNames: [{{ template "grafana.fullname" . }}]
|
||||
{{- end }}
|
||||
{{- if and .Values.rbac.namespaced (or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled) }}
|
||||
- apiGroups: [""] # "" indicates the core API group
|
||||
resources: ["configmaps"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
rules: []
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -8,6 +8,10 @@ metadata:
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
heritage: {{ .Release.Service }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
@@ -15,4 +19,11 @@ roleRef:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "grafana.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- if .Values.rbac.namespaced }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: {{ template "grafana.fullname" . }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,6 +2,7 @@ rbac:
|
||||
create: true
|
||||
pspEnabled: true
|
||||
pspUseAppArmor: true
|
||||
namespaced: false
|
||||
serviceAccount:
|
||||
create: true
|
||||
name:
|
||||
|
||||
Reference in New Issue
Block a user