@@ -531,15 +531,15 @@ jobs:
531531 sds_replicated_ready() {
532532 local count=60
533533 for i in $(seq 1 $count); do
534-
534+
535535 sds_replicated_volume_status=$(kubectl get ns d8-sds-replicated-volume -o jsonpath='{.status.phase}' || echo "False")
536-
536+
537537 if [[ "${sds_replicated_volume_status}" = "Active" ]]; then
538538 echo "[SUCCESS] Namespaces sds-replicated-volume are Active"
539539 kubectl get ns d8-sds-replicated-volume
540540 return 0
541541 fi
542-
542+
543543 echo "[INFO] Waiting 10s for sds-replicated-volume namespace to be ready (attempt ${i}/${count})"
544544 if (( i % 5 == 0 )); then
545545 echo "[INFO] Show namespaces sds-replicated-volume"
@@ -582,7 +582,7 @@ jobs:
582582 echo "[SUCCESS] sds-replicated-volume is ready"
583583 return 0
584584 fi
585-
585+
586586 echo "[WARNING] Not all pods are ready, linstor_node=${linstor_node}, csi_node=${csi_node}"
587587 echo "[INFO] Waiting 10s for pods to be ready (attempt ${i}/${count})"
588588 if (( i % 5 == 0 )); then
@@ -615,12 +615,12 @@ jobs:
615615 local count=60
616616 workers=$(kubectl get nodes -o name | grep worker | wc -l)
617617 workers=$((workers))
618-
618+
619619 if [[ $workers -eq 0 ]]; then
620620 echo "[ERROR] No worker nodes found"
621621 exit 1
622622 fi
623-
623+
624624 for i in $(seq 1 $count); do
625625 blockdevices=$(kubectl get blockdevice -o name | wc -l || true)
626626 if [ $blockdevices -ge $workers ]; then
@@ -686,6 +686,70 @@ jobs:
686686 echo "[SUCCESS] Done"
687687 fi
688688
689+ - name : Configure NFS storage
690+ if : ${{ inputs.storage_type == 'nfs' }}
691+ id : storage-nfs-setup
692+ working-directory : ${{ env.SETUP_CLUSTER_TYPE_PATH }}/storage/nfs
693+ env :
694+ NAMESPACE : ${{ needs.bootstrap.outputs.namespace }}
695+ run : |
696+ nfs_ready() {
697+ local count=90
698+ local controller
699+ local csi_controller
700+ local csi_node_desired
701+ local csi_node_ready
702+
703+ for i in $(seq 1 $count); do
704+ echo "[INFO] Check d8-csi-nfs pods (attempt ${i}/${count})"
705+ controller=$(kubectl -n d8-csi-nfs get deploy controller -o jsonpath='{.status.readyReplicas}' 2>/dev/null || echo "0")
706+ csi_controller=$(kubectl -n d8-csi-nfs get deploy csi-controller -o jsonpath='{.status.readyReplicas}' 2>/dev/null || echo "0")
707+ csi_node_desired=$(kubectl -n d8-csi-nfs get ds csi-node -o jsonpath='{.status.desiredNumberScheduled}' 2>/dev/null || echo "0")
708+ csi_node_ready=$(kubectl -n d8-csi-nfs get ds csi-node -o jsonpath='{.status.numberReady}' 2>/dev/null || echo "0")
709+
710+ if [[ "$controller" -ge 1 && "$csi_controller" -ge 1 && "$csi_node_desired" -gt 0 && "$csi_node_ready" -eq "$csi_node_desired" ]]; then
711+ echo "[SUCCESS] NFS CSI is ready (controller=${controller}, csi-controller=${csi_controller}, csi-node=${csi_node_ready}/${csi_node_desired})"
712+ return 0
713+ fi
714+
715+ echo "[WARNING] NFS CSI not ready: controller=${controller}, csi-controller=${csi_controller}, csi-node=${csi_node_ready}/${csi_node_desired}"
716+ if (( i % 5 == 0 )); then
717+ echo "[DEBUG] Pods in d8-csi-nfs:"
718+ kubectl -n d8-csi-nfs get pods || echo "[WARNING] Failed to retrieve pods"
719+ echo "[DEBUG] Deployments in d8-csi-nfs:"
720+ kubectl -n d8-csi-nfs get deploy || echo "[WARNING] Failed to retrieve deployments"
721+ echo "[DEBUG] DaemonSets in d8-csi-nfs:"
722+ kubectl -n d8-csi-nfs get ds || echo "[WARNING] Failed to retrieve daemonsets"
723+ echo "[DEBUG] csi-nfs module status:"
724+ kubectl get modules csi-nfs -o wide || echo "[WARNING] Failed to retrieve module"
725+ fi
726+ sleep 10
727+ done
728+
729+ echo "[ERROR] NFS CSI did not become ready in time"
730+ kubectl -n d8-csi-nfs get pods || true
731+ exit 1
732+ }
733+
734+ echo "[INFO] Apply csi-nfs ModuleConfig, ModulePullOverride, snapshot-controller"
735+ kubectl apply -f mc.yaml
736+
737+ echo "[INFO] Wait for csi-nfs module to be ready"
738+ kubectl wait --for=jsonpath='{.status.phase}'=Ready modules csi-nfs --timeout=300s
739+
740+ echo "[INFO] Wait for csi-nfs pods to be ready"
741+ nfs_ready
742+
743+ echo "[INFO] Apply NFSStorageClass"
744+ envsubst < storageclass.yaml | kubectl apply -f -
745+
746+ echo "[INFO] Configure default storage class"
747+ ./default-sc-configure.sh
748+
749+
750+ echo "[INFO] Show existing storageclasses"
751+ kubectl get storageclass
752+
689753 configure-virtualization :
690754 name : Configure Virtualization
691755 runs-on : ubuntu-latest
@@ -822,7 +886,7 @@ jobs:
822886 kubectl describe node $node
823887 echo "::endgroup::"
824888 done
825-
889+
826890 echo "[DEBUG] Show queue (first 25 lines)"
827891 d8 s queue list | head -n 25 || echo "[WARNING] Failed to retrieve list queue"
828892 echo "[DEBUG] Show deckhouse logs"
@@ -848,7 +912,7 @@ jobs:
848912 d8 s queue list | head -n25 || echo "[WARNING] Failed to retrieve list queue"
849913 echo " "
850914 fi
851-
915+
852916 if (( i % 10 == 0 )); then
853917 echo "[INFO] deckhouse logs"
854918 echo "::group::📝 deckhouse logs"
@@ -873,9 +937,9 @@ jobs:
873937 kubectl get vmclass || echo "[WARNING] no vmclasses found"
874938 return 0
875939 fi
876-
940+
877941 echo "[INFO] Waiting 10s for Virtualization module to be ready (attempt $i/$count)"
878-
942+
879943 if (( i % 5 == 0 )); then
880944 echo " "
881945 echo "[DEBUG] Show additional info"
@@ -887,7 +951,7 @@ jobs:
887951 fi
888952 sleep 10
889953 done
890-
954+
891955 debug_output
892956 exit 1
893957 }
@@ -897,9 +961,9 @@ jobs:
897961 local virt_handler_ready
898962 local workers
899963 local time_wait=10
900-
964+
901965 workers=$(kubectl get nodes -o name | grep worker | wc -l || true)
902- workers=$((workers))
966+ workers=$((workers))
903967
904968 for i in $(seq 1 $count); do
905969 virt_handler_ready=$(kubectl -n d8-virtualization get pods | grep "virt-handler.*Running" | wc -l || true)
@@ -1145,7 +1209,7 @@ jobs:
11451209 # Format: https://github.com/{owner}/{repo}/actions/runs/{run_id}
11461210 # The job name will be visible in the workflow run view
11471211 local link="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
1148-
1212+
11491213 jq -n \
11501214 --arg csi "$csi" \
11511215 --arg date "$date" \
@@ -1188,11 +1252,11 @@ jobs:
11881252 local status_msg="$3"
11891253 local job_name="$4"
11901254 local is_e2e_test="${5:-false}"
1191-
1255+
11921256 if [ "$result_value" != "success" ]; then
11931257 FAILED_STAGE="$stage_name"
11941258 FAILED_JOB_NAME="$job_name (${{ inputs.storage_type }})"
1195-
1259+
11961260 if [ -z "$REPORT_JSON" ] || [ "$REPORT_JSON" == "" ]; then
11971261 REPORT_JSON=$(create_failure_summary "$stage_name" "$status_msg" "$FAILED_JOB_NAME")
11981262 elif [ "$is_e2e_test" == "true" ]; then
0 commit comments