Skip to content

Commit 940cb7a

Browse files
added service-account for app-proxy (#186)
* added service-account for app-proxy
1 parent 47b2720 commit 940cb7a

File tree

8 files changed

+86
-2
lines changed

8 files changed

+86
-2
lines changed

venona/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.24
1+
1.4.25

venonactl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.24
1+
1.4.25
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if .CreateRbac }}
2+
kind: ClusterRoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1beta1
4+
metadata:
5+
name: {{ .AppProxy.AppName }}-cluster-reader
6+
subjects:
7+
- kind: ServiceAccount
8+
name: {{ .AppProxy.AppName }} # this service account can get secrets cluster-wide (all namespaces)
9+
namespace: {{ .Namespace }}
10+
roleRef:
11+
kind: ClusterRole
12+
name: {{ .AppProxy.AppName }}-cluster-reader
13+
apiGroup: rbac.authorization.k8s.io
14+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .CreateRbac }}
2+
kind: ClusterRole
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: {{ .AppProxy.AppName }}-cluster-reader
6+
labels:
7+
app: {{ .AppProxy.AppName }}
8+
version: {{ .Version }}
9+
rules:
10+
- apiGroups: [""]
11+
resources: ["secrets"]
12+
verbs: ["get"]
13+
{{- end }}

venonactl/pkg/templates/kubernetes/deployment.app-proxy.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ spec:
2424
app: {{ .AppProxy.AppName }}
2525
version: {{ .Version }}
2626
spec:
27+
{{- if .CreateRbac }}
28+
serviceAccountName: {{ .AppProxy.AppName }}
29+
{{- end }}
2730
containers:
2831
- name: {{ .AppProxy.AppName }}
2932
image: {{ if ne .DockerRegistry ""}} {{- .DockerRegistry }}/{{ .AppProxy.Image.Name }}:{{ .AppProxy.Image.Tag }} {{- else }} {{- .AppProxy.Image.Name }}:{{ .AppProxy.Image.Tag }} {{- end}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if .CreateRbac }}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ .AppProxy.AppName }}
6+
namespace: {{ .Namespace }}
7+
labels:
8+
app: {{ .AppProxy.AppName }}
9+
version: {{ .Version }}
10+
{{- end }}

venonactl/pkg/templates/kubernetes/templates.go

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)