소스 검색

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

Waqar Ahmed 5 년 전
부모
커밋
8b7530d3bd
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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 }}"