mirror of
https://github.com/puppetlabs/vmpooler-deployment.git
synced 2026-05-31 15:15:21 -04:00
P4DEVOPS-11504: add waitForRedis init container to deployment-manager
This commit is contained in:
parent
40410411eb
commit
62fc1c4251
1 changed files with 23 additions and 12 deletions
|
|
@ -34,6 +34,29 @@ spec:
|
|||
serviceAccountName: {{ include "vmpooler.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
{{- if .Values.manager.waitForRedis }}
|
||||
initContainers:
|
||||
- name: wait-for-redis
|
||||
image: "{{ .Values.redis.image.registry }}/{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
until redis-cli -h redis-master -p 6379 -a "$REDIS_PASSWORD" ping | grep -q PONG; do
|
||||
echo "Waiting for Redis to be ready..."
|
||||
sleep 2
|
||||
done
|
||||
echo "Redis is ready."
|
||||
env:
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: redis
|
||||
key: redis-password
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ $fullName }}-manager
|
||||
securityContext:
|
||||
|
|
@ -154,15 +177,3 @@ spec:
|
|||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue