Skip to content

Commit

Permalink
Merge pull request #87 from krupeshf/kpf_waitForDb_waitForEs
Browse files Browse the repository at this point in the history
Allow users to toggle waiting for db or es to start up
  • Loading branch information
mooreds authored Jun 21, 2022
2 parents 4a76727 + 8c47149 commit 8ba59f4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ The command removes all the Kubernetes components associated with the chart and
| ingress.hosts | list | `[]` | List of hostnames to configure the ingress with |
| ingress.paths | list | `[]` | |
| ingress.tls | list | `[]` | List of secrets used to configure TLS for the ingress. |
| initContainers.waitForDb | bool | `true` | Create an init container which waits for db to be ready |
| initContainers.waitForEs | bool | `true` | Create an init container which waits for ES to be ready |
| initContainers.image.repository | string | `"busybox"` | Tag to use for initContainers docker image |
| initContainers.image.tag | string | `"latest"` | |
| initContainers.resources | object | `{}` | Resource requests and limits to use for initContainers |
Expand Down
6 changes: 5 additions & 1 deletion chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ spec:
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
{{- if or (.Values.extraInitContainers) (or (.Values.initContainers.waitForDb) (and (eq .Values.search.engine "elasticsearch") (.Values.initContainers.waitForEs))) }}
initContainers:
{{- end }}
{{- if .Values.initContainers.waitForDb }}
- name: wait-for-db
image: "{{ .Values.initContainers.image.repository }}:{{ .Values.initContainers.image.tag }}"
args:
Expand All @@ -48,7 +51,8 @@ spec:
done
resources:
{{- toYaml .Values.initContainers.resources | nindent 12 }}
{{- if eq .Values.search.engine "elasticsearch" }}
{{- end }}
{{- if and (eq .Values.search.engine "elasticsearch") (.Values.initContainers.waitForEs) }}
- name: wait-for-search
image: "{{ .Values.initContainers.image.repository }}:{{ .Values.initContainers.image.tag }}"
args:
Expand Down
6 changes: 6 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@
},
"resources": {
"type": "object"
},
"waitForDb": {
"type": "boolean"
},
"waitForEs": {
"type": "boolean"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ imagePullSecrets: []
extraInitContainers: []

initContainers:
waitForDb: true
waitForEs: true
# This image should contain `nc`, `wget` and a shell of some kind to do a simple loop.
image:
# initContainers.image.repository -- Docker image to use for initContainers
Expand Down

0 comments on commit 8ba59f4

Please sign in to comment.