1806889205d207754b62d8e4cdc1c9292d765f90
[it/dep.git] / ric-platform / 50-RIC-Platform / helm / appmgr / templates / serviceaccount.yaml
1 {{- $tillerKey := .Values.appmgr.tillerkey | default "ricxapp" }}
2 {{- $topCtx :=  . }}
3 {{- $ctx := dict "ctx" $topCtx "key" $tillerKey }}
4 ---
5 apiVersion: v1
6 kind: ServiceAccount
7 metadata:
8   name: {{ include "common.serviceaccountname.appmgr" . }}
9   namespace: {{ include "common.namespace.platform" . }}
10 ---
11 apiVersion: rbac.authorization.k8s.io/v1beta1
12 kind: Role
13 metadata:
14   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
15   namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
16 rules:
17 - apiGroups: [""]
18   resources: ["pods", "pods/portforward"]
19   verbs: ["get", "list", "create"]
20
21 {{- if or (eq (include "common.tillerTLSVerify" $ctx) "true" )  (eq (include "common.tillerTLSAuthenticate" $ctx) "true") }}
22 - apiGroups: [""]
23   resources: ["secrets"]
24   resourceNames: [ {{ include "common.tillerHelmClientTLSSecret" $ctx | quote }} ]
25   verbs: ["get"]
26 {{- end }}  
27 ---
28 apiVersion: rbac.authorization.k8s.io/v1beta1
29 kind: RoleBinding
30 metadata:
31   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
32   namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
33 roleRef:
34   apiGroup: rbac.authorization.k8s.io
35   kind: Role
36   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
37 subjects:
38   - kind: ServiceAccount
39     name: {{ include "common.serviceaccountname.appmgr" . }}
40     namespace: {{ include "common.namespace.platform" . }}
41 ---