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

First line of admin.conf file downloaded to artifacts directory is wrong #4695

Closed
dmrub opened this issue May 2, 2019 · 3 comments · Fixed by #4696
Closed

First line of admin.conf file downloaded to artifacts directory is wrong #4695

dmrub opened this issue May 2, 2019 · 3 comments · Fixed by #4696
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@dmrub
Copy link
Contributor

dmrub commented May 2, 2019

I set kubeconfig_localhost: true and kubectl_localhost: true. The downloaded admin.conf starts with following line: [kubeconfig] Writing "admin.conf" kubeconfig file. After manually removing this line everything works and I can access kubernetes cluster.

Environment:

  • Cloud provider or hardware configuration:
    Installation on single virtual machine in vSphere

  • OS (printf "$(uname -srm)\n$(cat /etc/os-release)\n"):
    Linux 3.10.0-957.10.1.el7.x86_64 x86_64
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"

    CENTOS_MANTISBT_PROJECT="CentOS-7"
    CENTOS_MANTISBT_PROJECT_VERSION="7"
    REDHAT_SUPPORT_PRODUCT="centos"
    REDHAT_SUPPORT_PRODUCT_VERSION="7"

  • Version of Ansible (ansible --version):
    ansible 2.7.10

Kubespray version (commit) (git rev-parse --short HEAD):
dcd9c95

Network plugin used:
calico

Copy of your inventory file:

Command used to invoke ansible:

Output of ansible run:

Anything else do we need to know:

@dmrub dmrub added the kind/bug Categorizes issue or PR as related to a bug. label May 2, 2019
@dmrub
Copy link
Contributor Author

dmrub commented May 2, 2019

Problem is generated by following task:

- name: Generate admin kubeconfig with external api endpoint

In the case that kubeadm_version >= v1.14.0, kubeadm does not output admin.conf to stdout, and shell command outputs its contents with cat:

&& cat {{ kube_config_dir }}/external_kubeconfig/admin.conf &&

However, kubeadm outputs the following messages to the stdout that precede admin.conf:
[kubeconfig] Writing "admin.conf" kubeconfig file
or
[kubeconfig] Using existing kubeconfig file: "/etc/kubernetes/external_kubeconfig/admin.conf"

To fix this bug I suggest to change the line:
&& cat {{ kube_config_dir }}/external_kubeconfig/admin.conf &&
to
>/dev/null && cat {{ kube_config_dir }}/external_kubeconfig/admin.conf &&

@lystor
Copy link
Contributor

lystor commented May 7, 2019

Hello
Please merge the fix into release-2.10 branch.
Thank you

@woopstar
Copy link
Member

woopstar commented May 7, 2019

Feel free to do a PR to that branch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants