Skip to content

Commit

Permalink
Merge pull request #171 from resouer/toleration
Browse files Browse the repository at this point in the history
Use taint toleration instead of cordon
  • Loading branch information
jinl authored Mar 3, 2018
2 parents 79f475f + dba54cd commit e5ef95b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
18 changes: 7 additions & 11 deletions src/ClusterBootstrap/template/kube-addons/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,11 @@ spec:
metadata:
labels:
app: kubernetes-dashboard
# Comment the following annotation if Dashboard must not be deployed on master
annotations:
scheduler.alpha.kubernetes.io/tolerations: |
[
{
"key": "dedicated",
"operator": "Equal",
"value": "master",
"effect": "NoSchedule"
}
]
spec:
# Only run dashboard on master
nodeSelector:
infrastructure: active
volumes:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1
Expand All @@ -62,6 +55,9 @@ spec:
port: 9090
initialDelaySeconds: 30
timeoutSeconds: 30
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
---
kind: Service
apiVersion: v1
Expand Down
3 changes: 3 additions & 0 deletions src/ClusterBootstrap/template/kube-addons/dns-addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ spec:
labels:
k8s-app: kube-dns
spec:
# Only run kube-dns on master
nodeSelector:
infrastructure: active
volumes:
- name: kube-dns-config
configMap:
Expand Down
2 changes: 1 addition & 1 deletion src/ClusterBootstrap/template/master/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ExecStartPre=/bin/bash -c 'if lspci | grep -qE "[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-
ExecStart=/opt/bin/kubelet \
--kubeconfig=/etc/kubernetes/worker-kubeconfig.yaml \
--require-kubeconfig=true \
--register-schedulable=false \
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
--container-runtime=docker \
--allow-privileged=true \
--feature-gates="Accelerators=true" \
Expand Down

0 comments on commit e5ef95b

Please sign in to comment.