Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GCE] Set --kubelet-preferred-address-types on apiserver by default #59019

Merged

Conversation

MrHohn
Copy link
Member

@MrHohn MrHohn commented Jan 30, 2018

What this PR does / why we need it:
We currently set the default value of PreferredAddressTypes in KubeletConfig for apiserver as below:

PreferredAddressTypes: []string{
// --override-hostname
string(api.NodeHostName),
// internal, preferring DNS if reported
string(api.NodeInternalDNS),
string(api.NodeInternalIP),
// external, preferring DNS if reported
string(api.NodeExternalDNS),
string(api.NodeExternalIP),
},

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:

func (n nodeAddressProvider) externalAddresses() ([]string, error) {
preferredAddressTypes := []apiv1.NodeAddressType{
apiv1.NodeExternalIP,
}

func (m *Master) installTunneler(nodeTunneler tunneler.Tunneler, nodeClient corev1client.NodeInterface) {
nodeTunneler.Run(nodeAddressProvider{nodeClient}.externalAddresses)

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:

[GCE] Apiserver uses `InternalIP` as the most preferred kubelet address type by default.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 30, 2018
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jan 30, 2018

@MrHohn: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gke fd5dd96 link /test pull-kubernetes-e2e-gke

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@wojtek-t
Copy link
Member

That makes sense to me. But I will let others also take a look.

/approve no-issue

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 30, 2018
@bowei
Copy link
Member

bowei commented Jan 30, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei, MrHohn, wojtek-t

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 03d4c65 into kubernetes:master Jan 30, 2018
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 31, 2018
k8s-github-robot pushed a commit that referenced this pull request Feb 1, 2018
…-upstream-release-1.8

Automatic merge from submit-queue.

Automated cherry pick of #59019

Cherry pick of #59019 on release-1.8.

#59019: Set --kubelet-preferred-address-types on apiserver by default

```release-note
[GCE] Apiserver uses `InternalIP` as the most preferred kubelet address type by default.
```
k8s-github-robot pushed a commit that referenced this pull request Feb 2, 2018
…-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #59019

Cherry pick of #59019 on release-1.9.

#59019: Set --kubelet-preferred-address-types on apiserver by default

```release-note
[GCE] Apiserver uses `InternalIP` as the most preferred kubelet address type by default.
```
k8s-github-robot pushed a commit that referenced this pull request Mar 29, 2018
…-upstream-release-1.7

Automatic merge from submit-queue.

Automated cherry pick of #59019

Cherry pick of #59019 on release-1.7.

#59019: Set --kubelet-preferred-address-types on apiserver by default

This is already cherrypicked into 1.9 and 1.8 and proved working. Cherrypicking it into 1.7 so that we can proceed with kubernetes/test-infra#7156 (enabling zonal DNS on GCP projects).

```release-note
[GCE] Apiserver uses `InternalIP` as the most preferred kubelet address type by default.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants