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

Fix kube_hostname_override inconsistencies #4185

Merged

Conversation

chadswen
Copy link
Member

@chadswen chadswen commented Feb 5, 2019

This takes care of some situations where hostname overrides may not be set consistently across join (kubelet) and kube proxy configurations.

Closes #4037 Closes #4036

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 5, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chadswen

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 5, 2019
@chadswen
Copy link
Member Author

chadswen commented Feb 5, 2019

ci check this

@dannyk81
Copy link
Contributor

dannyk81 commented Feb 6, 2019

Should this also deprecate the following patch:

- name: Apply kube-proxy hostnameOverride
block:
- name: Copy kube-proxy daemonset hostnameOverride patch
copy:
src: hostnameOverride-patch.json
dest: "{{ kubernetes_user_manifests_path }}/hostnameOverride-patch.json"
- name: Check current command for kube-proxy daemonset
shell: "{{bin_dir}}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf get ds kube-proxy --namespace=kube-system -o jsonpath='{.spec.template.spec.containers[0].command}'"
register: current_kube_proxy_command
- name: Apply hostnameOverride patch for kube-proxy daemonset
shell: "{{bin_dir}}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf patch ds kube-proxy --namespace=kube-system --type=json -p \"$(cat hostnameOverride-patch.json)\""
args:
chdir: "{{ kubernetes_user_manifests_path }}"
register: patch_kube_proxy_command
when: not current_kube_proxy_command.stdout is search("--hostname-override=${NODE_NAME}")
- debug: msg={{ patch_kube_proxy_command.stdout_lines }}
when: patch_kube_proxy_command is not skipped
- debug: msg={{ patch_kube_proxy_command.stderr_lines }}
when: patch_kube_proxy_command is not skipped
tags: init
when:
- not kube_proxy_remove

This patch is currently broken and anyway is no longer needed given what this PR does.

@chadswen
Copy link
Member Author

chadswen commented Feb 6, 2019

@dannyk81 Thanks for the confirmation, I can remove that patch along with this.

@chadswen chadswen force-pushed the kubelet-hostname-fixes branch from b3eb9f6 to bf08a87 Compare February 6, 2019 16:56
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 6, 2019
@chadswen
Copy link
Member Author

chadswen commented Feb 6, 2019

@dannyk81 patch removed.

@Atoms
Copy link
Member

Atoms commented Feb 7, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit 6878c2a into kubernetes-sigs:master Feb 7, 2019
@neith00
Copy link
Contributor

neith00 commented Feb 7, 2019

I just want to let you know that when using cloud_provider: aws hostnames must match AWS private DNS hostname. Otherwise kubeadm fails to join nodes.
source: https://kubernetes.io/docs/concepts/cluster-administration/cloud-providers/#node-name

@chadswen chadswen deleted the kubelet-hostname-fixes branch February 7, 2019 14:58
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Feb 18, 2019
LuckySB added a commit to southbridgeio/kubespray that referenced this pull request Feb 18, 2019
deleted:    files/hostnameOverride-patch.json
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants