From 56419ff5b66268146fbe7baef2571a6f0e7951a8 Mon Sep 17 00:00:00 2001 From: copejon Date: Tue, 28 Oct 2025 14:54:38 -0500 Subject: [PATCH 1/4] patch topolvm-controller --- src/topolvm/generate_manifests.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/topolvm/generate_manifests.sh b/src/topolvm/generate_manifests.sh index 34cea945..679456ef 100755 --- a/src/topolvm/generate_manifests.sh +++ b/src/topolvm/generate_manifests.sh @@ -37,6 +37,22 @@ EOF # Patch replicas to 1 # shellcheck disable=SC2016 yq 'select(.kind == "Deployment").spec.replicas = 1' -i "${ASSETS_DIR}/03-topolvm.yaml" + + # Patch topolvm-controller manifest with longer startup delay to allow dns to start + yq 'select(.kind == "Deployment" and .metadata.name == "topolvm-controller").spec.template.spec.containers[0] |= ( + .livenessProbe.failureThreshold = 3 | + .readinessProbe.timeoutSeconds = 3 | + .readinessProbe.failureThreshold = 3 | + .readinessProbe.periodSeconds = 60 | + .startupProbe = { + "failureThreshold": 3, + "periodSeconds": 60, + "timeoutSeconds": 3, + "httpGet": { + "port": "healthz", + "path": "/healthz"} + } + )' -i "${ASSETS_DIR}/03-topolvm.yaml" # Generate kustomize cat >"${ASSETS_DIR}/kustomization.yaml" <<'EOF' From 8be40e4093e697b3f9018b32d593736a108ad010 Mon Sep 17 00:00:00 2001 From: copejon Date: Wed, 29 Oct 2025 10:13:03 -0500 Subject: [PATCH 2/4] patch topolvm-node probe --- src/topolvm/generate_manifests.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/topolvm/generate_manifests.sh b/src/topolvm/generate_manifests.sh index 679456ef..9d9ea9ba 100755 --- a/src/topolvm/generate_manifests.sh +++ b/src/topolvm/generate_manifests.sh @@ -39,8 +39,8 @@ EOF yq 'select(.kind == "Deployment").spec.replicas = 1' -i "${ASSETS_DIR}/03-topolvm.yaml" # Patch topolvm-controller manifest with longer startup delay to allow dns to start - yq 'select(.kind == "Deployment" and .metadata.name == "topolvm-controller").spec.template.spec.containers[0] |= ( - .livenessProbe.failureThreshold = 3 | + yq 'with(select(.kind == "Deployment" and .metadata.name == "topolvm-controller").spec.template.spec.containers[] | select(.name == "topolvm-controller"); + .livenessProbe.failureThreshold = 3 | .readinessProbe.timeoutSeconds = 3 | .readinessProbe.failureThreshold = 3 | .readinessProbe.periodSeconds = 60 | @@ -54,6 +54,19 @@ EOF } )' -i "${ASSETS_DIR}/03-topolvm.yaml" + # Patch topolvm-node DaemonSet with probes + # echo 'Patching topolvm-node DaemonSet with longer startup delay to allow dns to start' + yq 'with(select(.kind == "DaemonSet" and .metadata.name == "topolvm-node").spec.template.spec.containers[] | select(.name == "topolvm-node"); + .startupProbe = { + "failureThreshold": 60, + "periodSeconds": 2, + "timeoutSeconds": 3, + "httpGet": { + "port": "healthz", + "path": "/healthz" + } + })' -i "${ASSETS_DIR}/03-topolvm.yaml" + # Generate kustomize cat >"${ASSETS_DIR}/kustomization.yaml" <<'EOF' apiVersion: kustomize.config.k8s.io/v1beta1 From 2b8ccb279dd503e85f26d927888f4238d7d93856 Mon Sep 17 00:00:00 2001 From: copejon Date: Wed, 29 Oct 2025 13:31:44 -0500 Subject: [PATCH 3/4] generate topolvm manifests --- src/topolvm/assets/03-topolvm.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/topolvm/assets/03-topolvm.yaml b/src/topolvm/assets/03-topolvm.yaml index 49aa2c49..d6fee40f 100644 --- a/src/topolvm/assets/03-topolvm.yaml +++ b/src/topolvm/assets/03-topolvm.yaml @@ -865,6 +865,13 @@ spec: mountPropagation: "Bidirectional" - name: devices-dir mountPath: /dev + startupProbe: + failureThreshold: 60 + periodSeconds: 2 + timeoutSeconds: 3 + httpGet: + port: healthz + path: /healthz - name: csi-registrar image: "ghcr.io/topolvm/topolvm-with-sidecar:0.36.2" command: @@ -984,6 +991,9 @@ spec: path: /readyz port: readyz scheme: HTTP + timeoutSeconds: 3 + failureThreshold: 3 + periodSeconds: 60 livenessProbe: httpGet: path: /healthz @@ -991,11 +1001,19 @@ spec: initialDelaySeconds: 10 timeoutSeconds: 3 periodSeconds: 60 + failureThreshold: 3 volumeMounts: - name: socket-dir mountPath: /run/topolvm - name: certs mountPath: /certs + startupProbe: + failureThreshold: 3 + periodSeconds: 60 + timeoutSeconds: 3 + httpGet: + port: healthz + path: /healthz - name: csi-provisioner image: "ghcr.io/topolvm/topolvm-with-sidecar:0.36.2" command: From 17c45d887297f8c2d42472c75b2ca28106df1ddc Mon Sep 17 00:00:00 2001 From: copejon Date: Wed, 29 Oct 2025 13:34:30 -0500 Subject: [PATCH 4/4] dedup code, fix leading whitespace --- src/topolvm/generate_manifests.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/topolvm/generate_manifests.sh b/src/topolvm/generate_manifests.sh index 9d9ea9ba..bf2111c0 100755 --- a/src/topolvm/generate_manifests.sh +++ b/src/topolvm/generate_manifests.sh @@ -39,7 +39,7 @@ EOF yq 'select(.kind == "Deployment").spec.replicas = 1' -i "${ASSETS_DIR}/03-topolvm.yaml" # Patch topolvm-controller manifest with longer startup delay to allow dns to start - yq 'with(select(.kind == "Deployment" and .metadata.name == "topolvm-controller").spec.template.spec.containers[] | select(.name == "topolvm-controller"); + yq 'with(select(.kind == "Deployment" and .metadata.name == "topolvm-controller").spec.template.spec.containers[] | select(.name == "topolvm-controller"); .livenessProbe.failureThreshold = 3 | .readinessProbe.timeoutSeconds = 3 | .readinessProbe.failureThreshold = 3 | @@ -71,15 +71,6 @@ EOF cat >"${ASSETS_DIR}/kustomization.yaml" <<'EOF' apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -resources: - - 01-namespace.yaml - - 02-cert-manager.yaml - - 03-topolvm.yaml -EOF - - cat >"${ASSETS_DIR}/kustomization.yaml" <<'EOF' -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization resources: - 01-namespace.yaml - 02-cert-manager.yaml