Skip to content

Commit e5b3f6b

Browse files
cccs-niknineinchnick
authored andcommitted
initContainers for gateway
1 parent 547bba6 commit e5b3f6b

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

charts/gateway/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ A Helm chart for Trino Gateway
3737
- secretRef:
3838
name: password-secret
3939
```
40+
* `initContainers` - object, default: `{}`
41+
42+
Additional [containers that run to completion](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) during pod initialization.
43+
Example:
44+
```yaml
45+
initContainers:
46+
- name: wait-for-service
47+
image: busybox:1.28
48+
imagePullPolicy: IfNotPresent
49+
command: ['sh', '-c', "until nslookup {{ .Values.serviceName }}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
50+
- name: init-sleep
51+
image: busybox:1.28
52+
imagePullPolicy: IfNotPresent
53+
command: ['sh', '-c', 'echo The worker is running! && sleep 3600']
54+
```
4055
* `config.serverConfig."node.environment"` - string, default: `"test"`
4156
* `config.serverConfig."http-server.http.port"` - int, default: `8080`
4257
* `config.serverConfig."http-server.http.enabled"` - bool, default: `true`

charts/gateway/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ spec:
4646
securityContext:
4747
{{- toYaml .Values.podSecurityContext | nindent 8 }}
4848
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
49+
{{- if .Values.initContainers }}
50+
initContainers:
51+
{{- tpl (toYaml .Values.initContainers) . | nindent 6 }}
52+
{{- end }}
4953
containers:
5054
- name: {{ .Chart.Name }}
5155
securityContext:

charts/gateway/values.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ imagePullSecrets: []
3030
# ```
3131
envFrom: []
3232

33+
# -- Additional [containers that run to
34+
# completion](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
35+
# during pod initialization.
36+
# @raw
37+
# Example:
38+
# ```yaml
39+
# initContainers:
40+
# - name: wait-for-service
41+
# image: busybox:1.28
42+
# imagePullPolicy: IfNotPresent
43+
# command: ['sh', '-c', "until nslookup {{ .Values.serviceName }}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
44+
# - name: init-sleep
45+
# image: busybox:1.28
46+
# imagePullPolicy: IfNotPresent
47+
# command: ['sh', '-c', 'echo The worker is running! && sleep 3600']
48+
# ```
49+
initContainers: {}
50+
3351
config:
3452
serverConfig:
3553
node.environment: test

tests/gateway/test-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ config:
1818
clusterStatsConfiguration:
1919
monitorType: INFO_API
2020

21+
initContainers:
22+
- name: wait-for-service
23+
image: busybox:1.28
24+
imagePullPolicy: IfNotPresent
25+
command: ['sh', '-c', "until nslookup {{ .Values.serviceName }}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]
26+
2127
ingress:
2228
enabled: true
2329

0 commit comments

Comments
 (0)