Move Taints into the NodeupConfig

This commit is contained in:
John Gardiner Myers 2020-06-07 16:23:12 -07:00
parent 64167b7420
commit 1ba0f0d463
3 changed files with 4 additions and 4 deletions

View File

@ -484,8 +484,6 @@ func (b *KubeletBuilder) buildKubeletConfigSpec() (*kops.KubeletConfigSpec, erro
// Use --register-with-taints
{
c.Taints = append(c.Taints, b.InstanceGroup.Spec.Taints...)
if len(c.Taints) == 0 && isMaster {
// (Even though the value is empty, we still expect <Key>=<Value>:<Effect>)
c.Taints = append(c.Taints, nodelabels.RoleLabelMaster16+"=:"+string(v1.TaintEffectNoSchedule))

View File

@ -83,6 +83,7 @@ type StaticManifest struct {
func NewConfig(cluster *kops.Cluster, instanceGroup *kops.InstanceGroup) *Config {
role := instanceGroup.Spec.Role
isMaster := role == kops.InstanceGroupRoleMaster
config := Config{
InstanceGroupRole: role,
@ -90,7 +91,7 @@ func NewConfig(cluster *kops.Cluster, instanceGroup *kops.InstanceGroup) *Config
VolumeMounts: instanceGroup.Spec.VolumeMounts,
}
if role == kops.InstanceGroupRoleMaster {
if isMaster {
reflectutils.JSONMergeStruct(&config.KubeletConfig, cluster.Spec.MasterKubelet)
// A few settings in Kubelet override those in MasterKubelet. I'm not sure why.
@ -111,5 +112,7 @@ func NewConfig(cluster *kops.Cluster, instanceGroup *kops.InstanceGroup) *Config
}
}
config.KubeletConfig.Taints = append(config.KubeletConfig.Taints, instanceGroup.Spec.Taints...)
return &config
}

View File

@ -282,7 +282,6 @@ func (b *BootstrapScript) Run(c *fi.Context) error {
"IGSpec": func() (string, error) {
spec := make(map[string]interface{})
spec["nodeLabels"] = b.ig.Spec.NodeLabels
spec["taints"] = b.ig.Spec.Taints
hooks, err := b.getRelevantHooks(b.ig.Spec.Hooks, b.ig.Spec.Role)
if err != nil {