kubespray icon indicating copy to clipboard operation
kubespray copied to clipboard

TASK [kubernetes/kubeadm : Join to cluster if needed] failed but not exit

Open ciiiii opened this issue 2 years ago • 3 comments

I met the problem several times that ansible run to end and some worker showed failed and not join the cluster.

I found the reason is in task [kubernetes/kubeadm : Join to cluster if needed], kubespray use block and rescue to handle the exception of first join cluster, but if second join in rescue still failed, ansible will continue to run tasks and skip the failed node, and this is the correct behavior of block and rescue in ansible, but I want to know if we should exit in this scenario. Maybe ansible should choose to exit here or not by a variable, and the default behavior is exit when twice tries both failed.

https://github.com/kubernetes-sigs/kubespray/blob/21b71b38a3e73224e813c9d21c00039b5ea872f5/roles/kubernetes/kubeadm/tasks/main.yml#L67-L114

Environment:

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

  • Version of Python (python --version): Python 3.9.10

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

Command used to invoke ansible:

ansible-playbook cluster.yml --flush-cache -vvv

Output of ansible run:

TASK [kubernetes/kubeadm : Join to cluster] ***************************************************************************************************
fatal: [worker-0]: FAILED! => {...}

TASK [kubernetes/kubeadm : Join to cluster with ignores] **************************************************************************************
fatal: [worker-0]: FAILED! => {...}

TASK [kubernetes/kubeadm : Display kubeadm join stderr if any] ********************************************************************************
ok: [worker-0] => {"msg": "...."}

TASK [kubernetes/kubeadm : Set ca.crt file permission] ****************************************************************************************
ok: [master-0] => {...}

Anything else do we need to know:

Use the playbook in following gist to simulate the problem fast. https://gist.github.com/ciiiii/6e483dcea4bb888f68e7547626b4532c

ciiiii avatar Mar 23 '22 08:03 ciiiii

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 21 '22 09:06 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jul 21 '22 09:07 k8s-triage-robot

/remove-lifecycle rotten

ciiiii avatar Jul 21 '22 10:07 ciiiii

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 19 '22 10:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Nov 18 '22 11:11 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Dec 18 '22 11:12 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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.

k8s-ci-robot avatar Dec 18 '22 11:12 k8s-ci-robot