Skip to content

Commit

Permalink
feat(nextjs): add support for initContainers in Helm chart to allow p…
Browse files Browse the repository at this point in the history
…re-startup tasks

chore(nextjs): bump chart version from 1.1.5 to 1.1.6 to reflect new feature addition
  • Loading branch information
masterkain committed Jan 21, 2025
1 parent 69eac5d commit 0d1352a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/nextjs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: nextjs
description: Generic Helm chart for Nextjs apps on Kubernetes
type: application
version: 1.1.5
version: 1.1.6
appVersion: '1.0.0'
icon: https://icoretech.github.io/helm/charts/nextjs/logo.png
keywords:
Expand Down
4 changes: 4 additions & 0 deletions charts/nextjs/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ spec:
imagePullSecrets:
- name: {{ .Values.web.imagePullSecrets }}
{{- end }}
{{- if .Values.web.initContainers }}
initContainers:
{{ toYaml .Values.web.initContainers | nindent 8 }}
{{- end }}
containers:
- name: {{ include "app.web.name" . }}
image: "{{ .Values.web.image }}"
Expand Down
16 changes: 16 additions & 0 deletions charts/nextjs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ web:
maxUnavailable: 0
maxSurge: 1

# optional array of additional initcontainers
initContainers: []
# Example usage:
# initContainers:
# - name: init-mydb
# image: busybox:1.36
# command: ["/bin/sh"]
# args: ["-c", "echo Setting up DB; sleep 5"]
# volumeMounts:
# - name: next-data
# mountPath: /data
# - name: wait-for-service
# image: busybox:1.36
# command: ["/bin/sh"]
# args: ["-c", "until nc -z some-service 5432; do sleep 3; done"]

# optional array of additional containers
extraContainers: []
# Example usage:
Expand Down

0 comments on commit 0d1352a

Please sign in to comment.