From beef7c7b01d6c02bb9377eb609f895761ee139b2 Mon Sep 17 00:00:00 2001 From: Kosuke Morimoto Date: Wed, 18 Dec 2024 13:27:11 +0900 Subject: [PATCH] fix --- .github/helm/values/values-readreplica.yaml | 19 +++++++++++++++++++ charts/vald/templates/_helpers.tpl | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/.github/helm/values/values-readreplica.yaml b/.github/helm/values/values-readreplica.yaml index 7e2d32fe36..d6386c5c38 100644 --- a/.github/helm/values/values-readreplica.yaml +++ b/.github/helm/values/values-readreplica.yaml @@ -31,6 +31,25 @@ gateway: memory: 50Mi gateway_config: index_replica: 3 + initContainers: + - type: wait-for + name: wait-for-discoverer + target: discoverer + image: busybox:stable + imagePullPolicy: Always + sleepDuration: 2 + - type: wait-for + name: wait-for-agent + target: agent + image: busybox:stable + imagePullPolicy: Always + sleepDuration: 2 + - type: wait-for + name: wait-for-agent-readreplica + target: agent-readreplica + image: busybox:stable + imagePullPolicy: Always + sleepDuration: 2 agent: minReplicas: 3 maxReplicas: 10 diff --git a/charts/vald/templates/_helpers.tpl b/charts/vald/templates/_helpers.tpl index 11730a90ab..f4286dee29 100644 --- a/charts/vald/templates/_helpers.tpl +++ b/charts/vald/templates/_helpers.tpl @@ -714,6 +714,10 @@ initContainers {{- $agentReadinessPort := default $.Values.defaults.server_config.healths.readiness.port $.Values.agent.server_config.healths.readiness.port }} {{- $agentReadinessPath := default $.Values.defaults.server_config.healths.readiness.readinessProbe.httpGet.path .readinessPath }} until [ "$(wget --server-response --spider --quiet http://{{ $.Values.agent.name }}.{{ $.namespace }}.svc.cluster.local:{{ $agentReadinessPort }}{{ $agentReadinessPath }} 2>&1 | awk 'NR==1{print $2}')" == "200" ]; do + {{- else if eq .target "agent-readreplica" }} + {{- $agentReadReplicaReadinessPort := default $.Values.defaults.server_config.healths.readiness.port $.Values.agent.server_config.healths.readiness.port }} + {{- $agentReadReplicaReadinessPath := default $.Values.defaults.server_config.healths.readiness.readinessProbe.httpGet.path .readinessPath }} + until [ "$(wget --server-response --spider --quiet http://{{ $.Values.agent.readreplica.name }}-0.{{ $.namespace }}.svc.cluster.local:{{ $agentReadReplicaReadinessPort }}{{ $agentReadReplicaReadinessPath }} 2>&1 | awk 'NR==1{print $2}')" == "200" ]; do {{- else if eq .target "gateway-lb" }} {{- $lbGatewayReadinessPort := default $.Values.defaults.server_config.healths.readiness.port $.Values.gateway.lb.server_config.healths.readiness.port }} {{- $lbGatewayReadinessPath := default $.Values.defaults.server_config.healths.readiness.readinessProbe.httpGet.path .readinessPath }}