这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions plugins/scheduler-k3s/templates/helm-config/ingress-nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 36 additions & 5 deletions tests/unit/scheduler-k3s.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -63,14 +70,38 @@ 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

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"
Expand Down