Skip to content

Commit

Permalink
Add ability to specify annotations on service accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktavious committed Dec 4, 2024
1 parent 19168ae commit 476e49a
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 5 deletions.
4 changes: 4 additions & 0 deletions charts/opslevel/templates/elasticsearch/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ metadata:
labels:
app.kubernetes.io/component: serviceAccount
app.kubernetes.io/part-of: elasticsearch
{{- with .Values.elasticsearch.serviceAccount.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/opslevel/templates/minio/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ metadata:
labels:
app.kubernetes.io/component: serviceAccount
app.kubernetes.io/part-of: minio
{{- with .Values.objectStorage.serviceAccount.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/opslevel/templates/mysql/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ metadata:
labels:
app.kubernetes.io/component: serviceAccount
app.kubernetes.io/part-of: mysql
{{- with .Values.mysql.serviceAccount.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
9 changes: 7 additions & 2 deletions charts/opslevel/templates/opslevel/service.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{{- if .Values.opslevel.service.create }}
apiVersion: v1
kind: Service
metadata:
name: opslevel
name: {{ .Values.opslevel.service.name }}
labels:
app.kubernetes.io/component: service
app.kubernetes.io/part-of: opslevel
{{- with .Values.opslevel.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
ports:
- name: http
Expand All @@ -13,4 +18,4 @@ spec:
selector:
app.kubernetes.io/component: web
app.kubernetes.io/part-of: opslevel

{{- end }}
4 changes: 4 additions & 0 deletions charts/opslevel/templates/postgres/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ metadata:
labels:
app.kubernetes.io/component: serviceAccount
app.kubernetes.io/part-of: postgres
{{- with .Values.postgres.serviceAccount.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/opslevel/templates/runner/new-mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
spec:
{{- template "global.nodeSelector" . }}
priorityClassName: opslevel-normal
serviceAccountName: opslevel-runner
serviceAccountName: {{ .Values.runner.serviceAccount.name }}
{{- if .Values.certificate.enabled }}
initContainers:
- name: init-certs
Expand Down
2 changes: 1 addition & 1 deletion charts/opslevel/templates/runner/old-mode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
spec:
{{- template "global.nodeSelector" . }}
priorityClassName: opslevel-normal
serviceAccountName: opslevel-runner
serviceAccountName: {{ .Values.runner.serviceAccount.name }}
{{- if .Values.certificate.enabled }}
initContainers:
- name: init-certs
Expand Down
9 changes: 8 additions & 1 deletion charts/opslevel/templates/runner/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{{- if .Values.runner.enabled }}
{{- if .Values.runner.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: opslevel-runner
name: {{ .Values.runner.serviceAccount.name }}
labels:
app.kubernetes.io/component: serviceAccount
app.kubernetes.io/part-of: runner
{{- with .Values.runner.serviceAccount.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
12 changes: 12 additions & 0 deletions charts/opslevel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ opslevel:
workerLow:
replicas: 2
resources: *resourcesMedium
service:
create: true
name: "opslevel" &opslevel_service_name
annotations: {}
secret:
name: "opslevel"
create: true
Expand All @@ -71,6 +75,10 @@ runner:
tag: "v2024.10.14"
replicas: 3
resources: *resourcesLarge
serviceAccount:
create: true
name: opslevel-runner
annotations: {}
secret:
name: "opslevel-runner"
create: true
Expand Down Expand Up @@ -101,6 +109,7 @@ mysql:
serviceAccount:
create: true
name: mysql
annotations: {}
storageClass: ""
storageSize: "10Gi"
secret:
Expand All @@ -121,6 +130,7 @@ postgres:
serviceAccount:
create: true
name: postgres
annotations: {}
storageClass: ""
storageSize: "10Gi"
secret:
Expand Down Expand Up @@ -156,6 +166,7 @@ elasticsearch:
serviceAccount:
create: true
name: elasticsearch
annotations: {}
storageClass: ""
storageSize: "8Gi"
secret:
Expand All @@ -178,6 +189,7 @@ objectStorage:
serviceAccount:
create: true
name: minio
annotations: {}
storageClass: ""
storageSize: "8Gi"
secret:
Expand Down

0 comments on commit 476e49a

Please sign in to comment.