blob: 11593ccccbd5902a34becd5bf9969d490345bb3f [file] [log] [blame]
Sylvain Desbureaux45348812020-05-19 17:46:54 +02001{{/*
2# Copyright © 2020 Orange
Andreas Geisslerd4f832d2023-07-27 19:07:08 +02003# Modifications Copyright © 2023 Deutsche Telekom AG
Sylvain Desbureaux45348812020-05-19 17:46:54 +02004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16*/}}
17
18{{- $dot := . -}}
19{{- range $role_type := $dot.Values.roles }}
Sylvain Desbureaux6f4e8c02021-04-19 15:26:15 +020020{{/* retrieve the names for generic roles */}}
21{{ $name := printf "%s-%s" (include "common.release" $dot) $role_type }}
Andreas Geisslerd4f832d2023-07-27 19:07:08 +020022{{- if or (not (has $role_type $dot.Values.defaultRoles)) ($dot.Values.global.createDefaultRoles) ($dot.Values.createDefaultRoles) }}
Sylvain Desbureaux6f4e8c02021-04-19 15:26:15 +020023{{ $name = include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }}
24{{- end }}
Sylvain Desbureaux45348812020-05-19 17:46:54 +020025---
26apiVersion: rbac.authorization.k8s.io/v1
27# This cluster role binding allows anyone in the "manager" group to read secrets in any namespace.
28kind: RoleBinding
29metadata:
Sylvain Desbureaux6f4e8c02021-04-19 15:26:15 +020030 name: {{ include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }}
Sylvain Desbureaux45348812020-05-19 17:46:54 +020031 namespace: {{ include "common.namespace" $dot }}
32subjects:
33- kind: ServiceAccount
Sylvain Desbureaux6f4e8c02021-04-19 15:26:15 +020034 name: {{ include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }}
Sylvain Desbureaux45348812020-05-19 17:46:54 +020035roleRef:
36 kind: Role
Sylvain Desbureaux6f4e8c02021-04-19 15:26:15 +020037 name: {{ $name }}
Sylvain Desbureaux45348812020-05-19 17:46:54 +020038 apiGroup: rbac.authorization.k8s.io
39{{- end }}