Merge pull request #59019 from MrHohn/gce-kubelet-preferred-address-types
Automatic merge from submit-queue. 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>.
[GCE] Set --kubelet-preferred-address-types on apiserver by default
**What this PR does / why we need it**:
We currently set the default value of `PreferredAddressTypes` in `KubeletConfig` for apiserver as below:
https://github.com/kubernetes/kubernetes/blob/2f403b7ad18a179514f1de77e29f1a2549ef030a/cmd/kube-apiserver/app/options/options.go#L99-L110
It denotes the ways (order matters) we prefer to use for kubelet connections, in which `NodeHostName` is listed as the most preferred one. However, it is not safe to assume `NodeHostName` will always be resolvable. This PR makes `InternalIP` as the most preferred one instead.
Note that this doesn't affect how the ssh tunnel is setup, which is configured explicitly elsewhere:
https://github.com/kubernetes/kubernetes/blob/d0d1e1dcc473d75c5dae6d4710ac67f4f8ba44c6/pkg/master/master.go#L442-L445
https://github.com/kubernetes/kubernetes/blob/d0d1e1dcc473d75c5dae6d4710ac67f4f8ba44c6/pkg/master/master.go#L388-L389
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #NONE
**Special notes for your reviewer**:
/assign @bowei @cjcullen
cc @dnardo in case I made terrible mistakes.
**Release note**:
```release-note
NONE
```
Showing
Please
register
or
sign in
to comment