This commit is contained in:
Mahima Singh 2026-05-05 11:35:28 +00:00 committed by GitHub
commit 000f44c1c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 1 deletions

View file

@ -3,7 +3,7 @@ name: vmpooler
description: A Helm chart to deploy vmpooler
type: application
icon: https://github.com/puppetlabs/vmpooler/raw/master/lib/vmpooler/public/img/logo.png
version: 3.10.3
version: 3.10.4
appVersion: pr177-9010ad15d1b63bae44be352e7288a477bf6f667d
dependencies:
- name: redis

View file

@ -32,6 +32,29 @@ spec:
serviceAccountName: {{ include "vmpooler.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.api.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 }}-api
securityContext:

View file

@ -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:

View file

@ -64,6 +64,10 @@ additionalConfigFiles: '/etc/vmpooler/config/pools.yaml'
api:
replicaCount: 1
# Set to true to add an init container that waits for Redis to accept
# connections before the API container starts. Useful in environments
# where Redis starts slowly (low resources).
waitForRedis: false
resources:
requests:
cpu: 1500m
@ -73,6 +77,10 @@ api:
memory: 4Gi
manager:
# Set to true to add an init container that waits for Redis to accept
# connections before the manager container starts. Useful in environments
# where Redis starts slowly (low resources).
waitForRedis: false
resources:
requests:
cpu: 4000m