mirror of https://github.com/kubernetes/kops.git
Merge pull request #13857 from hakman/gce_resource_tracking
Fix GCE resource tracking
This commit is contained in:
commit
3310db3447
|
|
@ -146,7 +146,7 @@ func (b *AutoscalingGroupModelBuilder) buildInstanceTemplate(c *fi.ModelBuilderC
|
|||
t.Labels = map[string]string{
|
||||
gce.GceLabelNameKubernetesCluster: gce.SafeClusterName(b.ClusterName()),
|
||||
roleLabel: "",
|
||||
gce.GceLabelNameInstanceGroup: name,
|
||||
gce.GceLabelNameInstanceGroup: ig.ObjectMeta.Name,
|
||||
}
|
||||
|
||||
if gce.UsesIPAliases(b.Cluster) {
|
||||
|
|
|
|||
|
|
@ -1237,7 +1237,14 @@ func (d *clusterDiscoveryGCE) matchesClusterNameMultipart(name string, maxParts
|
|||
if id == "" {
|
||||
continue
|
||||
}
|
||||
if name == gce.SafeObjectName(id, d.clusterName) {
|
||||
|
||||
safeName := gce.SafeObjectName(id, d.clusterName)
|
||||
suffixedName, err := gce.ClusterSuffixedName(id, d.clusterName, 63)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
if name == safeName || name == suffixedName {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -533,7 +533,7 @@ resource "google_compute_instance_template" "master-us-test1-a-ha-gce-example-co
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a-ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a"
|
||||
"k8s-io-role-master" = ""
|
||||
}
|
||||
machine_type = "n1-standard-1"
|
||||
|
|
@ -579,7 +579,7 @@ resource "google_compute_instance_template" "master-us-test1-b-ha-gce-example-co
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-b-ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-b"
|
||||
"k8s-io-role-master" = ""
|
||||
}
|
||||
machine_type = "n1-standard-1"
|
||||
|
|
@ -625,7 +625,7 @@ resource "google_compute_instance_template" "master-us-test1-c-ha-gce-example-co
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-c-ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-c"
|
||||
"k8s-io-role-master" = ""
|
||||
}
|
||||
machine_type = "n1-standard-1"
|
||||
|
|
@ -671,7 +671,7 @@ resource "google_compute_instance_template" "nodes-ha-gce-example-com" {
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "nodes-ha-gce-example-com"
|
||||
"k8s-io-instance-group" = "nodes"
|
||||
"k8s-io-role-node" = ""
|
||||
}
|
||||
machine_type = "n1-standard-2"
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-examp
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "minimal-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a-minimal-gce-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a"
|
||||
"k8s-io-role-master" = ""
|
||||
}
|
||||
machine_type = "n1-standard-1"
|
||||
|
|
@ -483,7 +483,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-example-com" {
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "minimal-gce-example-com"
|
||||
"k8s-io-instance-group" = "nodes-minimal-gce-example-com"
|
||||
"k8s-io-instance-group" = "nodes"
|
||||
"k8s-io-role-node" = ""
|
||||
}
|
||||
machine_type = "n1-standard-2"
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-ilb-e
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "minimal-gce-ilb-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a-minimal-gce-ilb-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a"
|
||||
"k8s-io-role-master" = ""
|
||||
}
|
||||
machine_type = "n1-standard-1"
|
||||
|
|
@ -476,7 +476,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-ilb-example-com"
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "minimal-gce-ilb-example-com"
|
||||
"k8s-io-instance-group" = "nodes-minimal-gce-ilb-example-com"
|
||||
"k8s-io-instance-group" = "nodes"
|
||||
"k8s-io-role-node" = ""
|
||||
}
|
||||
machine_type = "n1-standard-2"
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ resource "google_compute_instance_template" "master-us-test1-a-minimal-gce-priva
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "minimal-gce-private-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a-minimal-gce-private-example-com"
|
||||
"k8s-io-instance-group" = "master-us-test1-a"
|
||||
"k8s-io-role-master" = ""
|
||||
}
|
||||
machine_type = "n1-standard-1"
|
||||
|
|
@ -473,7 +473,7 @@ resource "google_compute_instance_template" "nodes-minimal-gce-private-example-c
|
|||
}
|
||||
labels = {
|
||||
"k8s-io-cluster-name" = "minimal-gce-private-example-com"
|
||||
"k8s-io-instance-group" = "nodes-minimal-gce-private-example-com"
|
||||
"k8s-io-instance-group" = "nodes"
|
||||
"k8s-io-role-node" = ""
|
||||
}
|
||||
machine_type = "n1-standard-2"
|
||||
|
|
|
|||
Loading…
Reference in New Issue