Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / common / serviceAccount / templates / role-binding.yaml
1 {{/*
2 # Copyright © 2020 Orange
3 # Modifications Copyright © 2023 Deutsche Telekom AG
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 }}
20 {{/* retrieve the names for generic roles */}}
21 {{ $name := printf "%s-%s" (include "common.release" $dot) $role_type }}
22 {{- if or (not (has $role_type $dot.Values.defaultRoles)) ($dot.Values.global.createDefaultRoles) ($dot.Values.createDefaultRoles) }}
23 {{ $name = include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }}
24 {{- end }}
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:
30   name: {{ include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }}
31   namespace: {{ include "common.namespace" $dot }}
32 subjects:
33 - kind: ServiceAccount
34   name: {{ include "common.fullname" (dict "suffix" $role_type "dot" $dot ) }}
35 roleRef:
36   kind: Role
37   name: {{ $name }}
38   apiGroup: rbac.authorization.k8s.io
39 {{- end }}