From 2db5f6b7a089536ec89cff3167f26e98b726ad90 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Tue, 18 Jul 2023 20:11:54 -0400 Subject: [PATCH 01/12] Triggering different build --- hack/run-e2e-kind.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 0688a5f5b..ef58d4786 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -399,6 +399,7 @@ function kuttl-tests { } trap cleanup EXIT +exit update_test_host check-prerequisites kind-up-cluster From ca05cf10dc33f6288ae2b8ef2c8a90e61f6b1ddd Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Wed, 19 Jul 2023 13:23:43 -0400 Subject: [PATCH 02/12] Checking if nodes can be listed --- hack/run-e2e-kind.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index ef58d4786..db57d95f1 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -399,10 +399,11 @@ function kuttl-tests { } trap cleanup EXIT -exit update_test_host check-prerequisites kind-up-cluster +kubectl get all nodes +exit setup-mcad-env # MCAD with quotamanagement options is started by kuttl-tests kuttl-tests From b83139e5cc36537edbdbbd3ba3e2c7178c0a33f6 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Thu, 20 Jul 2023 11:05:17 -0400 Subject: [PATCH 03/12] Trigger build From 42048dc1953b7ceca47a4dd1bc4ae8b57d8a45cc Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Thu, 20 Jul 2023 11:20:57 -0400 Subject: [PATCH 04/12] Resource patching. Extending resources of Kubernetes nodes to include 'fake' GPUs. --- hack/run-e2e-kind.sh | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index db57d95f1..3c2bb6543 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -376,6 +376,40 @@ function setup-mcad-env { } +function extend-resources { + # Patch nodes to provide GPUs resources without physical GPUs. + # This is intended to allow testing of GPU specific features such as histograms. + + # Start communication with cluster + echo -n "Starting proxy " + + kubectl proxy > /dev/null 2>&1 & + PROXY_PID=$! + + echo "(pid=${PROXY_PID})..." + + # Variables + RESOURCE_NAME="nvidia.com~1gpu" + RESOURCE_COUNT="8" + + # Patch nodes + for NODE_NAME in $(kubectl get nodes --no-headers -o custom-columns=":metadata.name") + do + echo "- Patching node (add): ${NODE_NAME}" + + curl --header "Content-Type: application/json-patch+json" \ + --request PATCH \ + --data '[{"op": "add", "path": "/status/capacity/'${RESOURCE_NAME}'", "value": "'${RESOURCE_COUNT}'"}]' \ + http://localhost:8001/api/v1/nodes/${NODE_NAME}/status + + echo + done + + # Stop communication with cluster + echo "Killing proxy (pid=${PROXY_PID})..." + kill ${PROXY_PID} +} + function kuttl-tests { for kuttl_test in ${KUTTL_TEST_SUITES[@]}; do echo "kubectl kuttl test --config ${kuttl_test}" @@ -402,7 +436,8 @@ trap cleanup EXIT update_test_host check-prerequisites kind-up-cluster -kubectl get all nodes +extend-resources +kubectl describe all nodes exit setup-mcad-env # MCAD with quotamanagement options is started by kuttl-tests From 52074325b1ff126bc75288de6cac617d9b34fc34 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Fri, 21 Jul 2023 11:10:26 -0400 Subject: [PATCH 05/12] Fixed command to describe nodes --- hack/run-e2e-kind.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 3c2bb6543..e7a1410e4 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -437,7 +437,7 @@ update_test_host check-prerequisites kind-up-cluster extend-resources -kubectl describe all nodes +kubectl describe nodes exit setup-mcad-env # MCAD with quotamanagement options is started by kuttl-tests From 6fb4e758111de9a776cb99277d0e1871f8adb2d3 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Fri, 21 Jul 2023 15:15:30 -0400 Subject: [PATCH 06/12] Kuttl tests for checking if GPUs we added correctly to the nodes --- hack/run-e2e-kind.sh | 5 ++--- .../steps/00-assert.yaml | 10 ++++++++++ .../steps/01-assert.yaml | 8 ++++++++ .../steps/01-install.yaml | 19 +++++++++++++++++++ test/kuttl-test-extended-resources.yaml | 8 ++++++++ 5 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 test/e2e-kuttl-extended-resources/steps/00-assert.yaml create mode 100644 test/e2e-kuttl-extended-resources/steps/01-assert.yaml create mode 100644 test/e2e-kuttl-extended-resources/steps/01-install.yaml create mode 100644 test/kuttl-test-extended-resources.yaml diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index e7a1410e4..4a37393ad 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -45,7 +45,8 @@ export IMAGE_MCAD="${IMAGE_REPOSITORY_MCAD}:${IMAGE_TAG_MCAD}" CLUSTER_STARTED="false" export KUTTL_VERSION=0.15.0 export KUTTL_OPTIONS=${TEST_KUTTL_OPTIONS} -export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") +#export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") +export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test-extended-resources.yaml") DUMP_LOGS="true" @@ -437,8 +438,6 @@ update_test_host check-prerequisites kind-up-cluster extend-resources -kubectl describe nodes -exit setup-mcad-env # MCAD with quotamanagement options is started by kuttl-tests kuttl-tests diff --git a/test/e2e-kuttl-extended-resources/steps/00-assert.yaml b/test/e2e-kuttl-extended-resources/steps/00-assert.yaml new file mode 100644 index 000000000..e678252ce --- /dev/null +++ b/test/e2e-kuttl-extended-resources/steps/00-assert.yaml @@ -0,0 +1,10 @@ +--- +# Verify that GPUs are a resource for the node +apiVersion: v1 +kind: Node +metadata: + name: minikube # CHANGE NAME +status: + allocatable: + nvidia.com/gpu: "8" + diff --git a/test/e2e-kuttl-extended-resources/steps/01-assert.yaml b/test/e2e-kuttl-extended-resources/steps/01-assert.yaml new file mode 100644 index 000000000..43d54f873 --- /dev/null +++ b/test/e2e-kuttl-extended-resources/steps/01-assert.yaml @@ -0,0 +1,8 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: gpu-job + namespace: test +status: + conditions: + - type: Complete diff --git a/test/e2e-kuttl-extended-resources/steps/01-install.yaml b/test/e2e-kuttl-extended-resources/steps/01-install.yaml new file mode 100644 index 000000000..8c362a21f --- /dev/null +++ b/test/e2e-kuttl-extended-resources/steps/01-install.yaml @@ -0,0 +1,19 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: gpu-job + namespace: test +spec: + template: + spec: + restartPolicy: Never + containers: + - name: gpu-job + image: ubuntu:latest + command: [ "/bin/bash", "-c", "--" ] + args: [ "sleep 10;" ] + resources: + requests: + nvidia.com/gpu: 8 + limits: + nvidia.com/gpu: 8 diff --git a/test/kuttl-test-extended-resources.yaml b/test/kuttl-test-extended-resources.yaml new file mode 100644 index 000000000..8f09de1ee --- /dev/null +++ b/test/kuttl-test-extended-resources.yaml @@ -0,0 +1,8 @@ +apiVersion: kuttl.dev/v1beta1 +kind: TestSuite +testDirs: + - test/e2e-kuttl-extended-resources/ +timeout: 60 +artifactsDir: _output/logs +commands: + From aa9fbea9f262d1764c7ba9e8931fe3826d8eef2a Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Sat, 22 Jul 2023 15:39:39 -0400 Subject: [PATCH 07/12] Fixed namespace issue and node name issue. --- .../steps/00-assert.yaml | 2 +- .../steps/01-assert.yaml | 11 ++++------ .../steps/01-install.yaml | 21 +++---------------- .../steps/02-assert.yaml | 8 +++++++ .../steps/02-install.yaml | 19 +++++++++++++++++ test/kuttl-test-extended-resources.yaml | 1 - 6 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 test/e2e-kuttl-extended-resources/steps/02-assert.yaml create mode 100644 test/e2e-kuttl-extended-resources/steps/02-install.yaml diff --git a/test/e2e-kuttl-extended-resources/steps/00-assert.yaml b/test/e2e-kuttl-extended-resources/steps/00-assert.yaml index e678252ce..fe161130d 100644 --- a/test/e2e-kuttl-extended-resources/steps/00-assert.yaml +++ b/test/e2e-kuttl-extended-resources/steps/00-assert.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Node metadata: - name: minikube # CHANGE NAME + name: test-worker status: allocatable: nvidia.com/gpu: "8" diff --git a/test/e2e-kuttl-extended-resources/steps/01-assert.yaml b/test/e2e-kuttl-extended-resources/steps/01-assert.yaml index 43d54f873..eca0eb63c 100644 --- a/test/e2e-kuttl-extended-resources/steps/01-assert.yaml +++ b/test/e2e-kuttl-extended-resources/steps/01-assert.yaml @@ -1,8 +1,5 @@ -apiVersion: batch/v1 -kind: Job +# Verify that the namespace was created +apiVersion: v1 +kind: Namespace metadata: - name: gpu-job - namespace: test -status: - conditions: - - type: Complete + name: extended-resources diff --git a/test/e2e-kuttl-extended-resources/steps/01-install.yaml b/test/e2e-kuttl-extended-resources/steps/01-install.yaml index 8c362a21f..c74d93f2e 100644 --- a/test/e2e-kuttl-extended-resources/steps/01-install.yaml +++ b/test/e2e-kuttl-extended-resources/steps/01-install.yaml @@ -1,19 +1,4 @@ -apiVersion: batch/v1 -kind: Job +apiVersion: v1 +kind: Namespace metadata: - name: gpu-job - namespace: test -spec: - template: - spec: - restartPolicy: Never - containers: - - name: gpu-job - image: ubuntu:latest - command: [ "/bin/bash", "-c", "--" ] - args: [ "sleep 10;" ] - resources: - requests: - nvidia.com/gpu: 8 - limits: - nvidia.com/gpu: 8 + name: extended-resources diff --git a/test/e2e-kuttl-extended-resources/steps/02-assert.yaml b/test/e2e-kuttl-extended-resources/steps/02-assert.yaml new file mode 100644 index 000000000..8a9462858 --- /dev/null +++ b/test/e2e-kuttl-extended-resources/steps/02-assert.yaml @@ -0,0 +1,8 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: gpu-job + namespace: extended-resources +status: + conditions: + - type: Complete diff --git a/test/e2e-kuttl-extended-resources/steps/02-install.yaml b/test/e2e-kuttl-extended-resources/steps/02-install.yaml new file mode 100644 index 000000000..1a5f86f4e --- /dev/null +++ b/test/e2e-kuttl-extended-resources/steps/02-install.yaml @@ -0,0 +1,19 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: gpu-job + namespace: extended-resources +spec: + template: + spec: + restartPolicy: Never + containers: + - name: gpu-job + image: ubuntu:latest + command: [ "/bin/bash", "-c", "--" ] + args: [ "sleep 10;" ] + resources: + requests: + nvidia.com/gpu: 8 + limits: + nvidia.com/gpu: 8 diff --git a/test/kuttl-test-extended-resources.yaml b/test/kuttl-test-extended-resources.yaml index 8f09de1ee..4b325eb27 100644 --- a/test/kuttl-test-extended-resources.yaml +++ b/test/kuttl-test-extended-resources.yaml @@ -5,4 +5,3 @@ testDirs: timeout: 60 artifactsDir: _output/logs commands: - From 17201fbf37c21b6796c461eaca469e109de53326 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Sat, 22 Jul 2023 16:33:56 -0400 Subject: [PATCH 08/12] Adding all tests again now that the resource extension passes --- hack/run-e2e-kind.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 4a37393ad..17c10ac08 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -45,8 +45,7 @@ export IMAGE_MCAD="${IMAGE_REPOSITORY_MCAD}:${IMAGE_TAG_MCAD}" CLUSTER_STARTED="false" export KUTTL_VERSION=0.15.0 export KUTTL_OPTIONS=${TEST_KUTTL_OPTIONS} -#export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") -export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test-extended-resources.yaml") +export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test-extended-resources.yaml" "${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") DUMP_LOGS="true" From db72f4258aa4f7f9915db20f17cf4def51d4cf31 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Sat, 22 Jul 2023 17:02:30 -0400 Subject: [PATCH 09/12] Changed where the extended resources are tested --- hack/run-e2e-kind.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 17c10ac08..5b531b242 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -45,7 +45,7 @@ export IMAGE_MCAD="${IMAGE_REPOSITORY_MCAD}:${IMAGE_TAG_MCAD}" CLUSTER_STARTED="false" export KUTTL_VERSION=0.15.0 export KUTTL_OPTIONS=${TEST_KUTTL_OPTIONS} -export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test-extended-resources.yaml" "${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") +export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") DUMP_LOGS="true" @@ -408,6 +408,16 @@ function extend-resources { # Stop communication with cluster echo "Killing proxy (pid=${PROXY_PID})..." kill ${PROXY_PID} + + # Run kuttl tests to confirm GPUs were added correctly + kuttl_test="${ROOT_DIR}/test/kuttl-test-extended-resources.yaml" + echo "kubectl kuttl test --config ${kuttl_test}" + kubectl kuttl test --config ${kuttl_test} + if [ $? -ne 0 ] + then + echo "kuttl e2e test '${kuttl_test}' failure, exiting." + exit 1 + fi } function kuttl-tests { From 2d8eb922448b23ce18f86e4054c357c82d76f927 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Mon, 24 Jul 2023 11:26:01 -0400 Subject: [PATCH 10/12] Added error checks for 'curl' calls. Rename variables to use lower case. --- hack/run-e2e-kind.sh | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 5b531b242..e29b8b1f8 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -373,7 +373,6 @@ function setup-mcad-env { do echo -n "." && sleep 1; done - } function extend-resources { @@ -381,33 +380,46 @@ function extend-resources { # This is intended to allow testing of GPU specific features such as histograms. # Start communication with cluster - echo -n "Starting proxy " - kubectl proxy > /dev/null 2>&1 & - PROXY_PID=$! + proxy_pid=$! + + echo "Starting background proxy connection (pid=${proxy_pid})..." + + curl 127.0.0.1:8001 > /dev/null 2>&1 + + if [[ ! $? -eq 0 ]]; then + echo "Calling 'kubectl proxy' did not create a successful connection to the kubelet needed to patch the nodes. Exiting." + exit 1 + else + echo "Connected to the kubelet for patching the nodes" + fi - echo "(pid=${PROXY_PID})..." # Variables - RESOURCE_NAME="nvidia.com~1gpu" - RESOURCE_COUNT="8" + resource_name="nvidia.com~1gpu" + resource_count="8" # Patch nodes - for NODE_NAME in $(kubectl get nodes --no-headers -o custom-columns=":metadata.name") + for node_name in $(kubectl get nodes --no-headers -o custom-columns=":metadata.name") do - echo "- Patching node (add): ${NODE_NAME}" + echo "- Patching node (add): ${node_name}" + + patching_status=$(curl --header "Content-Type: application/json-patch+json" \ + --request PATCH \ + --data '[{"op": "add", "path": "/status/capacity/'${resource_name}'", "value": "'${resource_count}'"}]' \ + http://localhost:8001/api/v1/nodes/${node_name}/status | jq -r '.status') - curl --header "Content-Type: application/json-patch+json" \ - --request PATCH \ - --data '[{"op": "add", "path": "/status/capacity/'${RESOURCE_NAME}'", "value": "'${RESOURCE_COUNT}'"}]' \ - http://localhost:8001/api/v1/nodes/${NODE_NAME}/status + if [[ ${patching_status} = "Failure" ]]; then + echo "Failed to patch node '${node_name}' with GPU resources" + exit 1 + fi echo done # Stop communication with cluster - echo "Killing proxy (pid=${PROXY_PID})..." - kill ${PROXY_PID} + echo "Killing proxy (pid=${proxy_pid})..." + kill -9 ${proxy_pid} # Run kuttl tests to confirm GPUs were added correctly kuttl_test="${ROOT_DIR}/test/kuttl-test-extended-resources.yaml" From 7de6aee1c69416c190b1d4e9b61aca68341392ec Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Tue, 25 Jul 2023 09:22:57 -0400 Subject: [PATCH 11/12] Fixed 'if' equal operator --- hack/run-e2e-kind.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index e29b8b1f8..be9dc1b27 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -409,7 +409,7 @@ function extend-resources { --data '[{"op": "add", "path": "/status/capacity/'${resource_name}'", "value": "'${resource_count}'"}]' \ http://localhost:8001/api/v1/nodes/${node_name}/status | jq -r '.status') - if [[ ${patching_status} = "Failure" ]]; then + if [[ ${patching_status} == "Failure" ]]; then echo "Failed to patch node '${node_name}' with GPU resources" exit 1 fi From 0d00d6ff348d827626b1130b78f5787c1f5757f5 Mon Sep 17 00:00:00 2001 From: "Pedro D. Bello-Maldonado" Date: Thu, 27 Jul 2023 12:04:05 -0400 Subject: [PATCH 12/12] Reopening PR #517 here to avoid naming issues. --- hack/run-e2e-kind.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index be9dc1b27..88555554f 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -48,7 +48,6 @@ export KUTTL_OPTIONS=${TEST_KUTTL_OPTIONS} export KUTTL_TEST_SUITES=("${ROOT_DIR}/test/kuttl-test.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-03.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-02.yaml" "${ROOT_DIR}/test/kuttl-test-deployment-01.yaml") DUMP_LOGS="true" - function update_test_host { local arch="$(go env GOARCH)" @@ -380,20 +379,25 @@ function extend-resources { # This is intended to allow testing of GPU specific features such as histograms. # Start communication with cluster - kubectl proxy > /dev/null 2>&1 & + kubectl proxy --port=0 > .port.dat 2>&1 & proxy_pid=$! echo "Starting background proxy connection (pid=${proxy_pid})..." + echo "Waiting for proxy process to start." + sleep 30 - curl 127.0.0.1:8001 > /dev/null 2>&1 + kube_proxy_port=$(cat .port.dat | awk '{split($5, substrings, ":"); print substrings[2]}') + curl -s 127.0.0.1:${kube_proxy_port} > /dev/null 2>&1 if [[ ! $? -eq 0 ]]; then echo "Calling 'kubectl proxy' did not create a successful connection to the kubelet needed to patch the nodes. Exiting." + kill -9 ${proxy_pid} exit 1 else - echo "Connected to the kubelet for patching the nodes" + echo "Connected to the kubelet for patching the nodes. Using port ${kube_proxy_port}." fi + rm .port.dat # Variables resource_name="nvidia.com~1gpu" @@ -404,17 +408,17 @@ function extend-resources { do echo "- Patching node (add): ${node_name}" - patching_status=$(curl --header "Content-Type: application/json-patch+json" \ + patching_status=$(curl -s --header "Content-Type: application/json-patch+json" \ --request PATCH \ --data '[{"op": "add", "path": "/status/capacity/'${resource_name}'", "value": "'${resource_count}'"}]' \ - http://localhost:8001/api/v1/nodes/${node_name}/status | jq -r '.status') + http://localhost:${kube_proxy_port}/api/v1/nodes/${node_name}/status | jq -r '.status') if [[ ${patching_status} == "Failure" ]]; then echo "Failed to patch node '${node_name}' with GPU resources" exit 1 fi - echo + echo "Patching done!" done # Stop communication with cluster