Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit dd448af

Browse files
madalazaruniemimu
authored andcommitted
Adjust tolerations and affinities for K8s 1.24
Signed-off-by: Madalina Lazar <[email protected]>
1 parent bd322c4 commit dd448af

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

.github/scripts/e2e_setup_cluster.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ KIND_IMAGE="kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae4
1717
[ -n "$1" ] && KIND_IMAGE=$1
1818
SCHEDULER_VERSION=""
1919
KUBE_SCHEDULER_API_VERSION=""
20-
CONTROL_PLANE_NODE_AFINITY_LABEL="control-plane"
21-
NODE_AFFINITY_LABEL_KEY=$CONTROL_PLANE_NODE_AFINITY_LABEL
22-
20+
TAS_DEPLOYMENT_FILE="${root}/telemetry-aware-scheduling/deploy/tas-deployment.yaml"
2321
# private registry set-up variables
2422
CHANGE_MIRROR_REPO="false"
2523
[ -n "$2" ] && CHANGE_MIRROR_REPO=$2
@@ -180,11 +178,15 @@ check_requirements() {
180178
done
181179
}
182180

183-
set_node_affinity_expression_label_key() {
181+
set_node_affinity_and_tolerations() {
184182
scheduler_image_version_24=24
185183
[ -z "${SCHEDULER_VERSION}" ] && echo "### Unable to get K8s scheduler value, got $SCHEDULER_VERSION. Exit..." && exit 1
186184
if [ "$SCHEDULER_VERSION" -lt $scheduler_image_version_24 ]; then
187-
NODE_AFFINITY_LABEL_KEY="master"
185+
sed "s/control-plane/master/g" "$TAS_DEPLOYMENT_FILE" -i
186+
elif [ "$SCHEDULER_VERSION" -eq $scheduler_image_version_24 ]; then
187+
# add master toleration as it's needed for K8s v1.24
188+
sed -e "/ tolerations:/a\\
189+
- key: node-role.kubernetes.io/master\n operator: Exists" "$TAS_DEPLOYMENT_FILE" -i
188190
fi
189191
}
190192

@@ -248,8 +250,5 @@ docker cp kind-control-plane:/etc/kubernetes/pki/ca.key "${mount_dir}/certs/clie
248250

249251
kubectl create secret tls extender-secret --cert "${mount_dir}/certs/client.crt" --key "${mount_dir}/certs/client.key"
250252
sed "s/intel\/telemetry-aware-scheduling.*$/tasextender/g" "${root}/telemetry-aware-scheduling/deploy/tas-deployment.yaml" -i
251-
set_node_affinity_expression_label_key
252-
if [ "$CONTROL_PLANE_NODE_AFINITY_LABEL" != "$NODE_AFFINITY_LABEL_KEY" ]; then
253-
sed "s/control-plane/$NODE_AFFINITY_LABEL_KEY/g" "$TAS_DEPLOYMENT_FILE" -i
254-
fi
253+
set_node_affinity_and_tolerations
255254
kubectl apply -f "${root}/telemetry-aware-scheduling/deploy/"

.github/workflows/regression-workflow.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,13 @@ jobs:
108108
codeBranch: ${{ needs.current_branch.outputs.extract_branch }}
109109
imageHash: "kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1"
110110

111+
112+
end-to-end-test-local-K8s-v26:
113+
uses: ./.github/workflows/end-to-end-test.yaml
114+
needs: [ end-to-end-test-local-K8s-v25 ]
115+
with:
116+
runson: self-hosted-kind
117+
cleanup: false
118+
isLocal: "true"
119+
codeBranch: ${{ needs.current_branch.outputs.extract_branch }}
120+
imageHash: "kindest/node:v1.26.0@sha256:691e24bd2417609db7e589e1a479b902d2e209892a10ce375fab60a8407c7352"

0 commit comments

Comments
 (0)