Files
charts/bitnami/thanos/templates/query/psp-clusterrolebinding.yaml
corico44 2d6cc8fc2a [bitnami/thanos] Fix serviceAccount name logic for Thanos (#13406)
* [bitnami/thanos] Fix serviceAccount name logic

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/thanos] Modified Chart version

Signed-off-by: Cori Avila <amisericordi@vmware.com>

* [bitnami/thanos] Modified the way of naming serviceAccount to use the standard format used in other charts

Signed-off-by: Cori Avila <amisericordi@vmware.com>

Signed-off-by: Cori Avila <amisericordi@vmware.com>
2022-11-08 14:19:14 +01:00

26 lines
1.2 KiB
YAML

{{- $query := (include "thanos.query.values" . | fromYaml) -}}
{{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) }}
{{- if and $pspAvailable $query.enabled $query.pspEnabled $query.rbac.create }}
apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
kind: ClusterRoleBinding
metadata:
name: {{ include "common.names.fullname" . }}-query
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: query
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
roleRef:
kind: ClusterRole
name: {{ include "common.names.fullname" . }}-query
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ include "thanos.serviceAccountName" (dict "component" "query" "context" $) }}
namespace: {{ .Release.Namespace | quote }}
{{- end }}