Merge pull request #6579 from dokku/taint-tests

Ensure k3s can be installed with taints
This commit is contained in:
Jose Diaz-Gonzalez
2024-02-11 05:17:57 -05:00
committed by GitHub
2 changed files with 59 additions and 5 deletions

View File

@@ -55,3 +55,26 @@ controller:
operator: Exists
effect: NoSchedule
priorityClassName: system-cluster-critical
admissionWebhooks:
patch:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
defaultBackend:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- key: node-role.kubernetes.io/control-plane
operator: Exists
effect: NoSchedule
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule

View File

@@ -50,10 +50,17 @@ install_k3s() {
assert_output_contains "Login Succeeded"
INGRESS_CLASS="${INGRESS_CLASS:-traefik}"
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS"
echo "output: $output"
echo "status: $status"
assert_success
if [[ "$TAINT_SCHEDULING" == "true" ]]; then
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS --taint-scheduling"
echo "output: $output"
echo "status: $status"
assert_success
else
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS"
echo "output: $output"
echo "status: $status"
assert_success
fi
}
uninstall_k3s() {
@@ -63,7 +70,7 @@ uninstall_k3s() {
assert_success
}
@test "(scheduler-k3s) install" {
@test "(scheduler-k3s) install traefik" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
@@ -71,6 +78,30 @@ uninstall_k3s() {
install_k3s
}
@test "(scheduler-k3s) install nginx" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
INGRESS_CLASS=nginx install_k3s
}
@test "(scheduler-k3s) install traefik with taint" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
TAINT_SCHEDULING=true install_k3s
}
@test "(scheduler-k3s) install nginx with taint" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
fi
INGRESS_CLASS=nginx TAINT_SCHEDULING=true install_k3s
}
@test "(scheduler-k3s) deploy traefik" {
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"