Skip to content

Commit

Permalink
Taint masters with PreferNoSchedule
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lipovetsky committed Jan 24, 2019
1 parent 401d28d commit a742c33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,13 @@ func newProvisionedMachineAndMachine(name string, role clustercommon.MachineRole
CreationTimestamp: metav1.Now(),
},
Spec: clusterv1.MachineSpec{
Roles: []clustercommon.MachineRole{role},
Taints: []corev1.Taint{},
Roles: []clustercommon.MachineRole{role},
Taints: []corev1.Taint{
{
Key: common.LabelNodeRoleMaster,
Effect: corev1.TaintEffectPreferNoSchedule,
},
},
},
Status: clusterv1.MachineStatus{},
}
Expand Down
2 changes: 2 additions & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Machine IP Creation Timestamp Role
{{ range $machine := .}}{{ $machine.ObjectMeta.Name }} {{ $machine.ObjectMeta.CreationTimestamp }} {{ $machine.Spec.Roles }}
{{ end }}
`
// LabelNodeRoleMaster specifies that a node is a master
LabelNodeRoleMaster = "node-role.kubernetes.io/master"
)

var (
Expand Down

0 comments on commit a742c33

Please sign in to comment.