k3s/pkg/kubelet
Kubernetes Submit Queue a26e1ddacc
Merge pull request #67739 from liggitt/hostname-override
Automatic merge from submit-queue (batch tested with PRs 67739, 65222). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Honor --hostname-override, report compatible hostname addresses with cloud provider

xref #67714

7828e5d made cloud providers authoritative for the addresses reported on Node objects, so that the addresses used by the node (and requested as SANs in serving certs) could be verified via cloud provider metadata.

This had the effect of no longer reporting addresses of type Hostname for Node objects for some cloud providers. Cloud providers that have the instance hostname available in metadata should add a `type: Hostname` address to node status. This is being tracked in #67714

This PR does a couple other things to ease the transition to authoritative cloud providers:
* if `--hostname-override` is set on the kubelet, make the kubelet report that `Hostname` address. if it can't be verified via cloud-provider metadata (for cert approval, etc), the kubelet deployer is responsible for fixing the situation by adjusting the kubelet configuration (as they were in 1.11 and previously)
* if `--hostname-override` is not set, *and* the cloud provider didn't report a Hostname address, *and* the auto-detected hostname matches one of the addresses the cloud provider *did* report, make the kubelet report that as a Hostname address. That lets the addresses remain verifiable via cloud provider metadata, while still including a `Hostname` address whenever possible.

/sig node
/sig cloud-provider

/cc @mikedanese

fyi @hh

```release-note
NONE
```
2018-08-28 12:31:00 -07:00
..
apis K8s SCTP support implementation for the first pull request 2018-08-27 05:56:27 +00:00
cadvisor Remove --cadvisor-port - has been deprecated since v1.10 2018-07-02 08:54:14 -04:00
certificate Set connrotation dialer via restclient.Config.Dialer 2018-07-25 16:23:57 -07:00
checkpoint Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
checkpointmanager
client Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
cloudresource Reduce verbose logs of node addresses requesting 2018-08-21 13:23:01 +08:00
cm Merge pull request #67430 from choury/cpumanager 2018-08-21 23:20:58 -07:00
config remove duplicated import 2018-08-01 13:27:42 +08:00
configmap Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
container kubelet: plumb context for log requests 2018-08-10 17:35:46 -07:00
custommetrics Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
dockershim gofmt update 2018-08-27 05:59:50 +00:00
envvars K8s SCTP support implementation for the first pull request 2018-08-27 05:56:27 +00:00
events delete unused events 2018-07-17 14:19:50 +08:00
eviction move feature gate checks inside IsCriticalPod 2018-07-11 16:10:05 -05:00
images indent error flow 2018-08-13 17:31:31 +08:00
kubeletconfig Fix test failure of truncated time 2018-06-30 01:14:44 +09:00
kuberuntime K8s SCTP support implementation for the first pull request 2018-08-27 05:56:27 +00:00
leaky
lifecycle Compared preemption by priority. 2018-08-04 11:33:07 +08:00
logs Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
metrics fix metrics help comment 2018-07-13 10:26:35 +09:00
mountpod Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
network Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
nodelease Kubelet creates and manages node leases 2018-08-26 16:03:36 -07:00
nodestatus Honor --hostname-override, report compatible hostname addresses with cloud provider 2018-08-28 11:21:01 -04:00
pleg Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
pod Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
preemption Compared preemption by priority. 2018-08-04 11:33:07 +08:00
prober Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
qos Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
remote Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
secret Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
server Merge pull request #64601 from hzxuzhonghu/cm-dynamic-loglevel-set 2018-08-15 21:32:46 -07:00
stats Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
status Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
sysctl Run make update 2018-06-06 00:12:40 +02:00
token Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
types remove rescheduler 2018-08-22 11:49:14 +08:00
util Add unit tests for methods of pod's format 2018-07-17 15:37:13 +08:00
volumemanager Merge pull request #66884 from NickrenREN/attacher-detacher-refactor 2018-08-15 07:03:48 -07:00
winstats Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
BUILD Kubelet creates and manages node leases 2018-08-26 16:03:36 -07:00
OWNERS Add labels to kubelet OWNERS files 2018-08-22 00:43:32 +03:00
active_deadline.go
active_deadline_test.go
doc.go
kubelet.go Merge pull request #67739 from liggitt/hostname-override 2018-08-28 12:31:00 -07:00
kubelet_getters.go
kubelet_getters_test.go
kubelet_network.go Reduce latency to node ready after CIDR is assigned. 2018-08-22 10:43:58 +02:00
kubelet_network_test.go
kubelet_node_status.go Merge pull request #67739 from liggitt/hostname-override 2018-08-28 12:31:00 -07:00
kubelet_node_status_test.go Kubelet creates and manages node leases 2018-08-26 16:03:36 -07:00
kubelet_pods.go kubelet: plumb context for log requests 2018-08-10 17:35:46 -07:00
kubelet_pods_test.go
kubelet_pods_windows_test.go
kubelet_resources.go
kubelet_resources_test.go Cleanup verbose cAdvisor mocking in Kubelet unit tests 2018-06-27 11:53:41 -07:00
kubelet_test.go Kubelet creates and manages node leases 2018-08-26 16:03:36 -07:00
kubelet_volumes.go
kubelet_volumes_test.go Refactor of GenerateMapDeviceFunc to delegate Map call to volume plugin. 2018-06-03 17:25:37 -04:00
oom_watcher.go
oom_watcher_test.go
pod_container_deletor.go
pod_container_deletor_test.go
pod_workers.go Fix pod worker deadlock. 2018-07-09 11:45:26 -07:00
pod_workers_test.go
reason_cache.go
reason_cache_test.go
runonce.go
runonce_test.go implement service account token projection 2018-06-04 17:22:08 -07:00
runtime.go
util.go
volume_host.go Merge pull request #64877 from AdamDang/patch-11 2018-08-14 18:57:50 -07:00