Skip to content

Commit

Permalink
Merge pull request coreos#1719 from yifan-gu/anti_affinity
Browse files Browse the repository at this point in the history
module/bootkube: Fix anti-affinity labels / selectors for controller manager and scheduler.
  • Loading branch information
Quentin-M authored Aug 18, 2017
2 parents 9abc0be + 0535269 commit dd94403
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/bootkube/assets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ resource "template_dir" "bootkube" {
etcd_client_cert = "${base64encode(data.template_file.etcd_client_crt.rendered)}"
etcd_client_key = "${base64encode(data.template_file.etcd_client_key.rendered)}"

tectonic_version = "${var.versions["tectonic"]}"
kubernetes_version = "${replace(var.versions["kubernetes"], "+", "-")}"

master_count = "${var.master_count}"
node_monitor_grace_period = "${var.node_monitor_grace_period}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ spec:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
selector:
matchLabels:
tier: control-plane
k8s-app: kube-controller-manager
template:
metadata:
labels:
tier: control-plane
k8s-app: kube-controller-manager
pod-anti-affinity: kube-controller-manager-${tectonic_version}
pod-anti-affinity: kube-controller-manager-${kubernetes_version}
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
spec:
Expand All @@ -26,7 +30,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
pod-anti-affinity: kube-controller-manager-${tectonic_version}
pod-anti-affinity: kube-controller-manager-${kubernetes_version}
namespaces:
- kube-system
topologyKey: kubernetes.io/hostname
Expand Down
8 changes: 6 additions & 2 deletions modules/bootkube/resources/manifests/kube-scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ spec:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
selector:
matchLabels:
tier: control-plane
k8s-app: kube-scheduler
template:
metadata:
labels:
tier: control-plane
k8s-app: kube-scheduler
pod-anti-affinity: kube-scheduler-${tectonic_version}
pod-anti-affinity: kube-scheduler-${kubernetes_version}
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
spec:
Expand All @@ -26,7 +30,7 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
pod-anti-affinity: kube-scheduler-${tectonic_version}
pod-anti-affinity: kube-scheduler-${kubernetes_version}
namespaces:
- kube-system
topologyKey: kubernetes.io/hostname
Expand Down

0 comments on commit dd94403

Please sign in to comment.