aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2024-05-09 11:59:37 +0100
committersaul.gill <saul.gill@est.tech>2024-05-09 16:23:20 +0100
commitaed46b6a5bfe0680043a2fd2239f642aee5902d7 (patch)
tree6bbae7c5ae64d198934ac1296a0626bacb3ed05a
parentf2e84f8528911e533079d1048d2a7ab2c94826b6 (diff)
Adding readiness condition for k8s csits
Issue-ID: POLICY-4985 Change-Id: I17371e72866c11774ffd14a762120f2fedcc7406 Signed-off-by: saul.gill <saul.gill@est.tech>
-rwxr-xr-xcsit/run-k8s-csit.sh13
-rwxr-xr-xhelm/policy/templates/job.yaml2
-rwxr-xr-xhelm/policy/values.yaml1
3 files changed, 10 insertions, 6 deletions
diff --git a/csit/run-k8s-csit.sh b/csit/run-k8s-csit.sh
index d8fda028..c7d04032 100755
--- a/csit/run-k8s-csit.sh
+++ b/csit/run-k8s-csit.sh
@@ -350,13 +350,16 @@ wait_for_pods_running() {
for pod_name_prefix in "${pending_pods[@]}"; do
local pod_name=$(get_pod_name "$pod_name_prefix")
local pod_status
+ local pod_ready
+
pod_status=$(kubectl get pod "$pod_name" -n "$namespace" --no-headers -o custom-columns=STATUS:.status.phase 2>/dev/null)
+ pod_ready=$(kubectl get pod "$pod_name" -o jsonpath='{.status.containerStatuses[*].ready}')
- if [ "$pod_status" == "Running" ]; then
- echo "Pod '$pod_name' in namespace '$namespace' is now in 'Running' state."
+ if [ "$pod_status" == "Running" ] && [ "$pod_ready" == "true" ]; then
+ echo "Pod '$pod_name' in namespace '$namespace' is now in 'Running' state and 'Readiness' is true"
else
newly_running_pods+=("$pod_name")
- echo "Waiting for pod '$pod_name' in namespace '$namespace' to reach 'Running' state..."
+ echo "Waiting for pod '$pod_name' in namespace '$namespace' to reach 'Running' and 'Ready' state..."
fi
done
@@ -365,7 +368,7 @@ wait_for_pods_running() {
sleep 5
done
- echo "All specified pods are in the 'Running' state. Exiting the function."
+ echo "All specified pods are in the 'Running and Ready' state. Exiting the function."
}
@@ -397,7 +400,7 @@ if [ $OPERATION == "install" ]; then
sudo microk8s helm dependency build policy
sudo microk8s helm install csit-policy policy ${SET_VALUES}
sudo microk8s helm install prometheus prometheus
- wait_for_pods_running default 300 $READINESS_CONTAINERS
+ wait_for_pods_running default 480 $READINESS_CONTAINERS
echo "Policy chart installation completed"
echo "-------------------------------------------"
fi
diff --git a/helm/policy/templates/job.yaml b/helm/policy/templates/job.yaml
index 4d3bd714..7d3656cd 100755
--- a/helm/policy/templates/job.yaml
+++ b/helm/policy/templates/job.yaml
@@ -212,7 +212,7 @@ spec:
fieldPath: metadata.namespace
containers:
- name: policy-galera-db-migrator-clamp
- image: {{ .Values.global.repository }}/{{ .Values.dbmigrator.image }}
+ image: {{ .Values.global.repository }}/{{ .Values.global.image.dbMigrator }}
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
volumeMounts:
- mountPath: /dbcmd-config/db_migrator_policy_init.sh
diff --git a/helm/policy/values.yaml b/helm/policy/values.yaml
index 6ff3d5d5..9e5347d5 100755
--- a/helm/policy/values.yaml
+++ b/helm/policy/values.yaml
@@ -49,6 +49,7 @@ global:
httpparticipant: onap/policy-clamp-ac-http-ppnt:$tag
simparticipant: onap/policy-clamp-ac-sim-ppnt:$tag
a1pmsparticipant: onap/policy-clamp-ac-a1pms-ppnt:$tag
+ dbMigrator: onap/policy-db-migrator:$tag
policy-mariadb-galera:
enabled: true