Sylvain Desbureaux | 4534881 | 2020-05-19 17:46:54 +0200 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright © 2020 Orange |
Andreas Geissler | d4f832d | 2023-07-27 19:07:08 +0200 | [diff] [blame^] | 3 | # Modifications Copyright © 2023 Deutsche Telekom AG |
Sylvain Desbureaux | 4534881 | 2020-05-19 17:46:54 +0200 | [diff] [blame] | 4 | # |
| 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 Desbureaux | 6f4e8c0 | 2021-04-19 15:26:15 +0200 | [diff] [blame] | 20 | {{/* retrieve the names for generic roles */}} |
| 21 | {{ $name := printf "%s-%s" (include "common.release" $dot) $role_type }} |
Andreas Geissler | d4f832d | 2023-07-27 19:07:08 +0200 | [diff] [blame^] | 22 | {{- if or (not (has $role_type $dot.Values.defaultRoles)) ($dot.Values.global.createDefaultRoles) ($dot.Values.createDefaultRoles) }} |
Sylvain Desbureaux | 6f4e8c0 | 2021-04-19 15:26:15 +0200 | [diff] [blame] | 23 | {{ $name = include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }} |
| 24 | {{- end }} |
Sylvain Desbureaux | 4534881 | 2020-05-19 17:46:54 +0200 | [diff] [blame] | 25 | --- |
| 26 | apiVersion: rbac.authorization.k8s.io/v1 |
| 27 | # This cluster role binding allows anyone in the "manager" group to read secrets in any namespace. |
| 28 | kind: RoleBinding |
| 29 | metadata: |
Sylvain Desbureaux | 6f4e8c0 | 2021-04-19 15:26:15 +0200 | [diff] [blame] | 30 | name: {{ include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }} |
Sylvain Desbureaux | 4534881 | 2020-05-19 17:46:54 +0200 | [diff] [blame] | 31 | namespace: {{ include "common.namespace" $dot }} |
| 32 | subjects: |
| 33 | - kind: ServiceAccount |
Sylvain Desbureaux | 6f4e8c0 | 2021-04-19 15:26:15 +0200 | [diff] [blame] | 34 | name: {{ include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }} |
Sylvain Desbureaux | 4534881 | 2020-05-19 17:46:54 +0200 | [diff] [blame] | 35 | roleRef: |
| 36 | kind: Role |
Sylvain Desbureaux | 6f4e8c0 | 2021-04-19 15:26:15 +0200 | [diff] [blame] | 37 | name: {{ $name }} |
Sylvain Desbureaux | 4534881 | 2020-05-19 17:46:54 +0200 | [diff] [blame] | 38 | apiGroup: rbac.authorization.k8s.io |
| 39 | {{- end }} |