Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tasks.sh #3961

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions scripts/tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ function taint_primaries() {

# Rook tolerations
if kubectl get namespace rook-ceph &>/dev/null; then
kubectl -n rook-ceph patch cephclusters rook-ceph --type=merge -p '{"spec":{"placement":{"all":{"tolerations":[{"key":"node-role.kubernetes.io/master","operator":"Exists"}]}}}}'
kubectl -n rook-ceph patch cephclusters rook-ceph --type=merge -p '{"spec":{"placement":{"all":{"tolerations":[{"key":"node-role.kubernetes.io/control-plane","operator":"Exists"}]}}}}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than remove the existing node-role.kubernetes.io/master toleration can we append node-role.kubernetes.io/control-plane as an additional toleration?

cat <<EOF | kubectl -n rook-ceph patch deployment rook-ceph-operator -p "$(cat)"
apiVersion: apps/v1
kind: Deployment
Expand All @@ -490,32 +490,32 @@ spec:
template:
spec:
tolerations:
- key: node-role.kubernetes.io/master
- key: node-role.kubernetes.io/control-plane
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than remove the existing node-role.kubernetes.io/master toleration can we append node-role.kubernetes.io/control-plane as an additional toleration?

operator: Exists
containers:
- name: rook-ceph-operator
env:
- name: DISCOVER_TOLERATION_KEY
value: node-role.kubernetes.io/master
value: node-role.kubernetes.io/control-plane
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may need to be updated to DISCOVER_TOLERATIONS for newer rook versions

- name: CSI_PROVISIONER_TOLERATIONS
value: |
- key: node-role.kubernetes.io/master
- key: node-role.kubernetes.io/control-plane
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than remove the existing node-role.kubernetes.io/master toleration can we append node-role.kubernetes.io/control-plane as an additional toleration?

operator: Exists
- name: CSI_PLUGIN_TOLERATIONS
value: |
- key: node-role.kubernetes.io/master
- key: node-role.kubernetes.io/control-plane
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than remove the existing node-role.kubernetes.io/master toleration can we append node-role.kubernetes.io/control-plane as an additional toleration?

operator: Exists
EOF
fi

# EKCO tolerations
if kubernetes_resource_exists kurl deployment ekc-operator; then
kubectl -n kurl patch deployment ekc-operator --type=merge -p '{"spec":{"template":{"spec":{"tolerations":[{"key":"node-role.kubernetes.io/master","operator":"Exists"}]}}}}'
kubectl -n kurl patch deployment ekc-operator --type=merge -p '{"spec":{"template":{"spec":{"tolerations":[{"key":"node-role.kubernetes.io/control-plane","operator":"Exists"}]}}}}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than remove the existing node-role.kubernetes.io/master toleration can we append node-role.kubernetes.io/control-plane as an additional toleration?

fi


# Taint all primaries
kubectl taint nodes --overwrite --selector=node-role.kubernetes.io/master node-role.kubernetes.io/master=:NoSchedule
kubectl taint nodes --overwrite --selector=node-role.kubernetes.io/control-plane node-role.kubernetes.io/control-plane=:NoSchedule
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to detect the kubernetes version and apply the proper taint for that version?


# Delete pods with PVCs so they get rescheduled to worker nodes immediately
# TODO: delete pods with PVCs on other primaries
Expand Down