From 8920b15f75211f421fb04f5beb4aa77d8d87fcc8 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Fri, 2 Dec 2022 14:57:33 +0200 Subject: [PATCH 1/2] metrics-server: Set preferred address type to `InternalIP` when non AWS --- .../addons/metrics-server.addons.k8s.io/k8s-1.11.yaml.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upup/models/cloudup/resources/addons/metrics-server.addons.k8s.io/k8s-1.11.yaml.template b/upup/models/cloudup/resources/addons/metrics-server.addons.k8s.io/k8s-1.11.yaml.template index 56bf935ad04a3..3d4825a0f77cd 100644 --- a/upup/models/cloudup/resources/addons/metrics-server.addons.k8s.io/k8s-1.11.yaml.template +++ b/upup/models/cloudup/resources/addons/metrics-server.addons.k8s.io/k8s-1.11.yaml.template @@ -132,7 +132,7 @@ spec: - --secure-port=4443 - --kubelet-use-node-status-port - --metric-resolution=15s - - --kubelet-preferred-address-types={{ if or IsIPv6Only (eq GetCloudProvider "hetzner")}}InternalIP{{ else }}Hostname{{ end }} + - --kubelet-preferred-address-types={{ if or IsIPv6Only (not (eq GetCloudProvider "aws"))}}InternalIP{{ else }}Hostname{{ end }} {{ if not (WithDefaultBool .MetricsServer.Insecure true) }} - --tls-cert-file=/srv/tls.crt - --tls-private-key-file=/srv/tls.key From 2b176aee015b31c8c3e27e92339003e13fb4b13d Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Sat, 3 Dec 2022 22:38:10 +0200 Subject: [PATCH 2/2] Run hack/update-expected.sh --- .../aws_s3_object_minimal.example.com-addons-bootstrap_content | 2 +- ...ple.com-addons-metrics-server.addons.k8s.io-k8s-1.11_content | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-bootstrap_content b/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-bootstrap_content index 1e1a0b7944602..9d83910e84235 100644 --- a/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-bootstrap_content +++ b/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-bootstrap_content @@ -48,7 +48,7 @@ spec: version: 9.99.0 - id: k8s-1.11 manifest: metrics-server.addons.k8s.io/k8s-1.11.yaml - manifestHash: 2c50298a62f772220623daac250303f2757a9393c63a441acd89f077f1b4c2f7 + manifestHash: 1b89be4bcb1ed917bbd82781eebceec127f2d30eb13f6e5477e3e42f0cafc1b6 name: metrics-server.addons.k8s.io needsPKI: true selector: diff --git a/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-metrics-server.addons.k8s.io-k8s-1.11_content b/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-metrics-server.addons.k8s.io-k8s-1.11_content index 2a95b2b19eab8..4130a7a0f8b8d 100644 --- a/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-metrics-server.addons.k8s.io-k8s-1.11_content +++ b/tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-metrics-server.addons.k8s.io-k8s-1.11_content @@ -170,7 +170,7 @@ spec: - --secure-port=4443 - --kubelet-use-node-status-port - --metric-resolution=15s - - --kubelet-preferred-address-types=Hostname + - --kubelet-preferred-address-types=InternalIP - --cert-dir=/tmp - --kubelet-insecure-tls image: registry.k8s.io/metrics-server/metrics-server:v0.6.1