mirror of https://github.com/kubernetes/kops.git
populate cloud labels with cluster autoscaler tags
This commit is contained in:
parent
b4eaf6b7d3
commit
888702b1a9
|
|
@ -33,6 +33,11 @@ import (
|
|||
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
|
||||
)
|
||||
|
||||
const (
|
||||
clusterAutoscalerNodeTemplateLabel = "k8s.io/cluster-autoscaler/node-template/label/"
|
||||
clusterAutoscalerNodeTemplateTaint = "k8s.io/cluster-autoscaler/node-template/taint/"
|
||||
)
|
||||
|
||||
var UseLegacyELBName = featureflag.New("UseLegacyELBName", featureflag.Bool(false))
|
||||
|
||||
type KopsModelContext struct {
|
||||
|
|
@ -173,6 +178,19 @@ func (m *KopsModelContext) CloudTagsForInstanceGroup(ig *kops.InstanceGroup) (ma
|
|||
labels[k] = v
|
||||
}
|
||||
|
||||
// Apply labels for cluster autoscaler node labels
|
||||
for k, v := range ig.Spec.NodeLabels {
|
||||
labels[clusterAutoscalerNodeTemplateLabel+k] = v
|
||||
}
|
||||
|
||||
// Apply labels for cluster autoscaler node taints
|
||||
for _, v := range ig.Spec.Taints {
|
||||
splits := strings.SplitN(v, "=", 2)
|
||||
if len(splits) > 1 {
|
||||
labels[clusterAutoscalerNodeTemplateTaint+splits[0]] = splits[1]
|
||||
}
|
||||
}
|
||||
|
||||
// The system tags take priority because the cluster likely breaks without them...
|
||||
|
||||
if ig.Spec.Role == kops.InstanceGroupRoleMaster {
|
||||
|
|
|
|||
Loading…
Reference in New Issue