Skip to content

Commit fb0dd95

Browse files
committedAug 14, 2023
feat: add service accounts for extensions
1 parent 99dc33b commit fb0dd95

File tree

7 files changed

+42
-1
lines changed

7 files changed

+42
-1
lines changed
 

‎charts/steadybit-extension-http/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: steadybit-extension-http
33
description: Steadybit action implementation to check HTTP endpoints.
4-
version: 1.0.13
4+
version: 1.0.14
55
appVersion: latest
66
home: https://www.steadybit.com/
77
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png

‎charts/steadybit-extension-http/templates/deployment.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ spec:
6666
runAsGroup: 10000
6767
volumes:
6868
{{- include "extensionlib.deployment.volumes" (list .) | nindent 8 }}
69+
serviceAccountName: {{ .Values.serviceAccount.name }}
6970
{{- with .Values.nodeSelector }}
7071
nodeSelector:
7172
{{- toYaml . | nindent 8 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ .Values.serviceAccount.name }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- range $key, $value := .Values.extraLabels }}
9+
{{ $key }}: {{ $value }}
10+
{{- end }}
11+
automountServiceAccountToken: true
12+
{{- end }}

‎charts/steadybit-extension-http/tests/__snapshot__/deployment_test.yaml.snap

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ manifest should match snapshot using podAnnotations and Labels:
5151
runAsNonRoot: true
5252
runAsUser: 10000
5353
volumeMounts: null
54+
serviceAccountName: steadybit-extension-http
5455
volumes: null
5556
manifest should match snapshot with TLS:
5657
1: |
@@ -110,6 +111,7 @@ manifest should match snapshot with TLS:
110111
- mountPath: /etc/extension/certificates/server-cert
111112
name: certificate-server-cert
112113
readOnly: true
114+
serviceAccountName: steadybit-extension-http
113115
volumes:
114116
- name: certificate-server-cert
115117
secret:
@@ -173,6 +175,7 @@ manifest should match snapshot with extra env vars:
173175
runAsNonRoot: true
174176
runAsUser: 10000
175177
volumeMounts: null
178+
serviceAccountName: steadybit-extension-http
176179
volumes: null
177180
manifest should match snapshot with extra labels:
178181
1: |
@@ -227,6 +230,7 @@ manifest should match snapshot with extra labels:
227230
runAsNonRoot: true
228231
runAsUser: 10000
229232
volumeMounts: null
233+
serviceAccountName: steadybit-extension-http
230234
volumes: null
231235
manifest should match snapshot with mutual TLS:
232236
1: |
@@ -291,6 +295,7 @@ manifest should match snapshot with mutual TLS:
291295
- mountPath: /etc/extension/certificates/server-cert
292296
name: certificate-server-cert
293297
readOnly: true
298+
serviceAccountName: steadybit-extension-http
294299
volumes:
295300
- name: certificate-client-cert-a
296301
secret:
@@ -357,6 +362,7 @@ manifest should match snapshot with mutual TLS using containerPaths:
357362
runAsNonRoot: true
358363
runAsUser: 10000
359364
volumeMounts: null
365+
serviceAccountName: steadybit-extension-http
360366
volumes: null
361367
manifest should match snapshot without TLS:
362368
1: |
@@ -409,4 +415,5 @@ manifest should match snapshot without TLS:
409415
runAsNonRoot: true
410416
runAsUser: 10000
411417
volumeMounts: null
418+
serviceAccountName: steadybit-extension-http
412419
volumes: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
manifest should match snapshot:
2+
1: |
3+
apiVersion: v1
4+
automountServiceAccountToken: true
5+
kind: ServiceAccount
6+
metadata:
7+
labels: null
8+
name: steadybit-extension-http
9+
namespace: NAMESPACE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
templates:
2+
- serviceaccount.yaml
3+
tests:
4+
- it: manifest should match snapshot
5+
asserts:
6+
- matchSnapshot: { }

‎charts/steadybit-extension-http/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ resources:
4848
# resources.limits.cpu -- The limit of cpu share to be used during its interval
4949
cpu: "200m"
5050

51+
serviceAccount:
52+
# serviceAccount.create -- Specifies whether a ServiceAccount should be created.
53+
create: true
54+
# serviceAccount.name -- The name of the ServiceAccount to use.
55+
name: steadybit-extension-http
56+
5157
# extra labels to apply to the Kubernetes resources
5258
extraLabels: {}
5359

0 commit comments

Comments
 (0)
Please sign in to comment.