Skip to content

Commit ef43010

Browse files
committed
add and use serviceAccount
1 parent e974db2 commit ef43010

File tree

6 files changed

+79
-1
lines changed

6 files changed

+79
-1
lines changed

helm/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ Install using the values file:
6363
helm install stac-auth-proxy oci://ghcr.io/developmentseed/stac-auth-proxy/charts/stac-auth-proxy -f values.yaml
6464
```
6565

66+
### Using Image Pull Secrets
67+
68+
To use private container registries, you can configure image pull secrets:
69+
70+
```yaml
71+
72+
serviceAccount:
73+
create: true
74+
imagePullSecrets:
75+
name: "my-registry-secret"
76+
```
77+
78+
6679
## Configuration
6780
6881
### Required Values

helm/templates/_helpers.tpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ Selector labels
4646
{{- define "stac-auth-proxy.selectorLabels" -}}
4747
app.kubernetes.io/name: {{ include "stac-auth-proxy.name" . }}
4848
app.kubernetes.io/instance: {{ .Release.Name }}
49+
{{- end }}
50+
51+
{{/*
52+
Create the name of the service account to use
53+
*/}}
54+
{{- define "stac-auth-proxy.serviceAccountName" -}}
55+
{{- if .Values.serviceAccount.create }}
56+
{{- default (include "stac-auth-proxy.fullname" .) .Values.serviceAccount.name }}
57+
{{- else }}
58+
{{- default "default" .Values.serviceAccount.name }}
59+
{{- end }}
4960
{{- end }}

helm/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
labels:
1515
{{- include "stac-auth-proxy.selectorLabels" . | nindent 8 }}
1616
spec:
17+
serviceAccountName: {{ include "stac-auth-proxy.serviceAccountName" . }}
1718
securityContext:
1819
{{- toYaml .Values.securityContext | nindent 8 }}
1920
containers:

helm/templates/serviceaccount.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "stac-auth-proxy.serviceAccountName" . }}
6+
labels:
7+
{{- include "stac-auth-proxy.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- with .Values.serviceAccount.imagePullSecrets }}
13+
imagePullSecrets:
14+
{{- toYaml . | nindent 2 }}
15+
{{- end }}
16+
{{- end }}

helm/values.schema.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,5 +231,30 @@ properties:
231231
value:
232232
type: string
233233

234+
serviceAccount:
235+
type: object
236+
properties:
237+
create:
238+
type: boolean
239+
description: "Specifies whether a service account should be created"
240+
annotations:
241+
type: object
242+
additionalProperties:
243+
type: string
244+
description: "Annotations to add to the service account"
245+
name:
246+
type: string
247+
description: "The name of the service account to use. If not set and create is true, a name is generated"
248+
imagePullSecrets:
249+
type: array
250+
description: "Image pull secrets to add to the service account"
251+
items:
252+
type: object
253+
required: ["name"]
254+
properties:
255+
name:
256+
type: string
257+
description: "Name of the image pull secret"
258+
234259
required:
235260
- service

helm/values.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,16 @@ config:
8484
# Additional environment variables
8585
extraEnv: []
8686
# - name: CUSTOM_VAR
87-
# value: "custom-value"
87+
# value: "custom-value"
88+
89+
serviceAccount:
90+
# Specifies whether a service account should be created
91+
create: true
92+
# Annotations to add to the service account
93+
annotations: {}
94+
# The name of the service account to use.
95+
# If not set and create is true, a name is generated using the fullname template
96+
name: ""
97+
# Image pull secrets to add to the service account
98+
imagePullSecrets: []
99+
# - name: my-registry-secret

0 commit comments

Comments
 (0)