Add standalone R3 RIC platform helm charts and deployment scripts.
[ric-plt/ric-dep.git] / helm / appmgr / templates / serviceaccount.yaml
1 {{- $tillerKey := .Values.appmgr.tillerkey | default "ricxapp" }}
2 {{- $topCtx :=  . }}
3 {{- $ctx := dict "ctx" $topCtx "key" $tillerKey }}
4 {{- $certName := include "common.tillerHelmClientTLSSecret" $ctx }}
5 ---
6 apiVersion: v1
7 kind: ServiceAccount
8 metadata:
9   name: {{ include "common.serviceaccountname.appmgr" . }}
10   namespace: {{ include "common.namespace.platform" . }}
11 ---
12 apiVersion: rbac.authorization.k8s.io/v1beta1
13 kind: Role
14 metadata:
15   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
16   namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
17 rules:
18 - apiGroups: [""]
19   resources: ["pods/portforward"]
20   verbs: ["create"]
21 - apiGroups: [""]  
22   resources: ["pods", "configmaps", "deployments", "services"]
23   verbs: ["get", "list", "create", "delete"]
24 {{- if or (eq (include "common.tillerTLSVerify" $ctx) "true" )  (eq (include "common.tillerTLSAuthenticate" $ctx) "true") }}
25 - apiGroups: [""]
26   resources: ["secrets"]
27   resourceNames: [ {{ include "common.tillerHelmClientTLSSecret" $ctx | quote }} ]
28   verbs: ["get"]
29 {{- end }}
30 ---
31 apiVersion: rbac.authorization.k8s.io/v1beta1
32 kind: RoleBinding
33 metadata:
34   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
35   namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
36 roleRef:
37   apiGroup: rbac.authorization.k8s.io
38   kind: Role
39   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
40 subjects:
41   - kind: ServiceAccount
42     name: {{ include "common.serviceaccountname.appmgr" . }}
43     namespace: {{ include "common.namespace.platform" . }}
44 ---
45 apiVersion: rbac.authorization.k8s.io/v1beta1
46 kind: Role
47 metadata:
48   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-getappconfig
49   namespace: {{ include "common.tillerNameSpace" $ctx }}
50 rules:
51 - apiGroups: [""]  
52   resources: ["configmaps", "endpoints"]
53   verbs: ["get"]
54 ---
55 apiVersion: rbac.authorization.k8s.io/v1beta1
56 kind: RoleBinding
57 metadata:
58   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.namespace.xapp" . }}-getappconfig
59   namespace: {{ include "common.tillerNameSpace" $ctx }}
60 roleRef:
61   apiGroup: rbac.authorization.k8s.io
62   kind: Role
63   name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-getappconfig
64 subjects:
65   - kind: ServiceAccount
66     name: {{ include "common.serviceaccountname.appmgr" . }}
67     namespace: {{ include "common.namespace.platform" . }}