From 67425e03fd576cdb692cf20f92eb7f2a6fc774ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Wanzenb=C3=B6ck?= Date: Mon, 20 Nov 2023 09:57:50 +0100 Subject: [PATCH] docs: fix node affinity for satellites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Wanzenböck --- .../upgrade/collect-operator-v1-information.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/how-to/upgrade/collect-operator-v1-information.sh b/docs/how-to/upgrade/collect-operator-v1-information.sh index cad94ae1..aa8ac5bd 100755 --- a/docs/how-to/upgrade/collect-operator-v1-information.sh +++ b/docs/how-to/upgrade/collect-operator-v1-information.sh @@ -356,6 +356,14 @@ for IDX in $(seq 0 "$(jq '.items | length - 1' "$TEMPDIR/linstorsatellitesets.js jq --arg CONFIG "$NAME.yaml" '.resources += [$CONFIG]' "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml" > "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml.new" mv "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml.new" "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml" + if [ "$(jq_item '.spec.affinity?.nodeAffinity?.requiredDuringSchedulingIgnoredDuringExecution | length')" -gt 0 ]; then + jq_item '.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution' \ + | format_patch LinstorSatelliteConfiguration "$NAME" '[{"op": "add", "path": "/spec/nodeAffinity", "value": .}]' \ + | append_patch "$TEMPDIR/linstorsatelliteconfiguration" \ + | diff_patch "$TEMPDIR/linstorsatelliteconfiguration" + confirm_patch "$TEMPDIR/linstorsatelliteconfiguration" y + fi + if [ "$(jq_item '.spec.additionalEnv | length')" -gt 0 ]; then echo "Found additional environment variables passed to LINSTOR Satellite" jq_item '.spec.additionalEnv' \ @@ -492,7 +500,9 @@ echo "|---------------------|--------------------------------|------------------ [ -z "$(jq -r '.items[0].spec.priorityClassName' "$TEMPDIR/linstorcsidrivers.json")" ] || print_row LinstorCSIDriver .spec.priorityClassName "Use LinstorCluster.spec.patches" "$(jq -r '.items[0].spec.priorityClassName' "$TEMPDIR/linstorcsidrivers.json")" for IDX in $(seq 0 "$(jq '.items | length - 1' "$TEMPDIR/linstorsatellitesets.json")"); do - [ "$(jq_item '.spec.affinity | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity "Use LinstorSatelliteConfiguration.spec.nodeSelector" "$(jq_item -c '.spec.affinity')" + [ "$(jq_item '.spec.affinity?.nodeAffinity?.preferredDuringSchedulingIgnoredDuringExecution | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution "Use LinstorSatelliteConfiguration.spec.nodeAffinity" "$(jq_item -c '.spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution')" + [ "$(jq_item '.spec.affinity?.podAffinity | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity.podAffinity "Use LinstorSatelliteConfiguration.spec.nodeAffinity" "$(jq_item -c '.spec.affinity.podAffinity')" + [ "$(jq_item '.spec.affinity?.podAntiAffinity | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity.podAntiAffinity "Use LinstorSatelliteConfiguration.spec.nodeAffinity" "$(jq_item -c '.spec.affinity.podAntiAffinity')" [ "$(jq_item '.spec.storagePools.zfsPools | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.storagePools.zfsPools "Manually configure ZFS pools" "$(jq_item -c '.spec.storagePools.zfsPools')" [ "$(jq_item -r '.spec.automaticStorageType')" == "None" ] || print_row LinstorSatelliteSet .spec.automaticStorageType "Use LinstorSatelliteConfiguration.spec.storagePools" "$(jq_item -r '.spec.automaticStorageType')" [ "$(jq_item -r '.spec.controllerEndpoint')" == "$EXPECTED_CONTROLLER_ENDPOINT" ] || print_row LinstorSatelliteSet .spec.controllerEndpoint "Set LinstorCluster.spec.externalController" "$(jq_item -r '.spec.controllerEndpoint')"