96da29abb20efb1c125986c0bdffeaf1baa3b6e3
[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/portforward"]
19   verbs: ["create"]
20 - apiGroups: [""]  
21   resources: ["pods", "configmaps", "deployments", "services"]
22   verbs: ["get", "list", "create", "delete"]
23 {{- if or (eq (include "common.tillerTLSVerify" $ctx) "true" )  (eq (include "common.tillerTLSAuthenticate" $ctx) "true") }}
24 - apiGroups: [""]
25   resources: ["secrets"]
26   resourceNames: [ {{ include "common.tillerHelmClientTLSSecret" $ctx | quote }} ]
27   verbs: ["get"]
28 {{- end }}  
29 ---
30 apiVersion: rbac.authorization.k8s.io/v1beta1
31 kind: RoleBinding
32 metadata:
33   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
34   namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
35 roleRef:
36   apiGroup: rbac.authorization.k8s.io
37   kind: Role
38   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
39 subjects:
40   - kind: ServiceAccount
41     name: {{ include "common.serviceaccountname.appmgr" . }}
42     namespace: {{ include "common.namespace.platform" . }}
43 ---
44 apiVersion: rbac.authorization.k8s.io/v1beta1
45 kind: Role
46 metadata:
47   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-getappconfig
48   namespace: {{ include "common.tillerNameSpace" $ctx }}
49 rules:
50 - apiGroups: [""]  
51   resources: ["configmaps", "endpoints"]
52   verbs: ["get"]
53 ---
54 apiVersion: rbac.authorization.k8s.io/v1beta1
55 kind: RoleBinding
56 metadata:
57   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.namespace.xapp" . }}-getappconfig
58   namespace: {{ include "common.tillerNameSpace" $ctx }}
59 roleRef:
60   apiGroup: rbac.authorization.k8s.io
61   kind: Role
62   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-getappconfig
63 subjects:
64   - kind: ServiceAccount
65     name: {{ include "common.serviceaccountname.appmgr" . }}
66     namespace: {{ include "common.namespace.platform" . }}