Selaa lähdekoodia

Add init container to nextcloud pod to make sure it's not started until postgres is up

Waqar Ahmed 5 vuotta sitten
vanhempi
commit
8b7530d3bd
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4 0
      test/nextcloud/2.3.2/templates/deployment.yaml

+ 4 - 0
test/nextcloud/2.3.2/templates/deployment.yaml

@@ -38,6 +38,10 @@ spec:
         - name: {{ . }}
       {{- end}}
       {{- end }}
+      initContainers:
+        - name: init-postgresdb
+          image: busybox:latest
+          command: ['sh', '-c', "until nslookup {{ template "nextcloud.fullname" . }}-postgres; do echo waiting for postgres; sleep 2; done"]
       containers:
       - name: {{ .Chart.Name }}
         image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"