Skip to content

Commit

Permalink
jenkins-x-buildpacks#33 | Ola | Add sa for listing Kubernetes resourc…
Browse files Browse the repository at this point in the history
…es for vertx-grpc pack

Added role, rolebinding and serviceaccount definitions
  • Loading branch information
ofadeyi committed Aug 22, 2019
1 parent 4fd70bb commit 011e7d5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packs/vertx-grpc/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ spec:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Chart.Name }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: KUBERNETES_NAMESPACE
value: {{ .Release.Namespace | quote }}
{{- range $pkey, $pval := .Values.env }}
- name: {{ $pkey }}
value: {{ quote $pval }}
Expand Down
15 changes: 15 additions & 0 deletions packs/vertx-grpc/charts/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ .Chart.Name }}
rules:
- apiGroups:
- ""
resources:
- endpoints
- pods
- services
verbs:
- get
- list
- watch
13 changes: 13 additions & 0 deletions packs/vertx-grpc/charts/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ .Chart.Name }}
subjects:
- kind: ServiceAccount
name: {{ .Chart.Name }}
namespace: {{ .Release.Namespace }}
9 changes: 9 additions & 0 deletions packs/vertx-grpc/charts/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ .Chart.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
name: {{ .Chart.Name }}

0 comments on commit 011e7d5

Please sign in to comment.