fix: ensure k3s can be installed with taints
This commit is contained in:
@@ -55,3 +55,26 @@ controller:
|
|||||||
operator: Exists
|
operator: Exists
|
||||||
effect: NoSchedule
|
effect: NoSchedule
|
||||||
priorityClassName: system-cluster-critical
|
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
|
||||||
@@ -50,10 +50,17 @@ install_k3s() {
|
|||||||
assert_output_contains "Login Succeeded"
|
assert_output_contains "Login Succeeded"
|
||||||
|
|
||||||
INGRESS_CLASS="${INGRESS_CLASS:-traefik}"
|
INGRESS_CLASS="${INGRESS_CLASS:-traefik}"
|
||||||
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS"
|
if [[ "$TAINT_SCHEDULING" == "true" ]]; then
|
||||||
echo "output: $output"
|
run /bin/bash -c "dokku scheduler-k3s:initialize --ingress-class $INGRESS_CLASS --taint-scheduling"
|
||||||
echo "status: $status"
|
echo "output: $output"
|
||||||
assert_success
|
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() {
|
uninstall_k3s() {
|
||||||
@@ -63,7 +70,7 @@ uninstall_k3s() {
|
|||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(scheduler-k3s) install" {
|
@test "(scheduler-k3s) install traefik" {
|
||||||
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
|
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
|
||||||
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
|
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
|
||||||
fi
|
fi
|
||||||
@@ -71,6 +78,30 @@ uninstall_k3s() {
|
|||||||
install_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" {
|
@test "(scheduler-k3s) deploy traefik" {
|
||||||
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
|
if [[ -z "$DOCKERHUB_USERNAME" ]] || [[ -z "$DOCKERHUB_TOKEN" ]]; then
|
||||||
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
|
skip "skipping due to missing docker.io credentials DOCKERHUB_USERNAME:DOCKERHUB_TOKEN"
|
||||||
|
|||||||
Reference in New Issue
Block a user