Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

pkg/asset: Add critical pod annotations to control-plane #435

Merged
merged 1 commit into from
Apr 14, 2017
Merged
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
17 changes: 17 additions & 0 deletions pkg/asset/internal/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ spec:
component: kube-apiserver
annotations:
checkpointer.alpha.coreos.com/checkpoint: "true"
scheduler.alpha.kubernetes.io/critical-pod: ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Given this is a daemonset, should this also get the toleration? or should it not have the annotation at all? The taint is currently only scheduler side (not kubelet enforced) -- daemonsets don't use scheduler -- so my guess is that this would be ignored (unless daemon controller respects the taint?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The annotation also exists on kube-proxy but not the toleration, so I added it here for consistency. However, daemonsets do respect taints / tolerations so I don't think it hurts to add the toleration to the daemonsets as well. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah right. The annotation is basically so it can check if it isn't being scheduled (and would evict other work).

Yeah, if the daemon controller respects it (and maybe later kubelet enforces taints) might not be bad to have the toleration already set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
nodeSelector:
master: "true"
hostNetwork: true
Expand Down Expand Up @@ -377,7 +381,12 @@ spec:
labels:
tier: control-plane
component: kube-controller-manager
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -494,7 +503,12 @@ spec:
labels:
tier: control-plane
component: kube-scheduler
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -574,6 +588,9 @@ spec:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
hostNetwork: true
containers:
- name: kube-proxy
Expand Down