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: diff --git a/src/topolvm/generate_manifests.sh b/src/topolvm/generate_manifests.sh index 34cea945..bf2111c0 100755 --- a/src/topolvm/generate_manifests.sh +++ b/src/topolvm/generate_manifests.sh @@ -37,20 +37,40 @@ 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 '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 | + .startupProbe = { + "failureThreshold": 3, + "periodSeconds": 60, + "timeoutSeconds": 3, + "httpGet": { + "port": "healthz", + "path": "/healthz"} + } + )' -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 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