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

"[Errno 2] No such file or directory: b'kubectl': b'kubectl'" #7467

Closed
ybhagwatkar opened this issue Apr 8, 2021 · 1 comment · Fixed by #7469
Closed

"[Errno 2] No such file or directory: b'kubectl': b'kubectl'" #7467

ybhagwatkar opened this issue Apr 8, 2021 · 1 comment · Fixed by #7469
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ybhagwatkar
Copy link

ybhagwatkar commented Apr 8, 2021

  • i created kubernetes HA Cluster using kubespray. 4 Master server and 1 node.

image

Server os : CentOS Linux 8
RAM : 4 GB
CPU 4
HHD : 30 GB

  • i am trying to delete k8s-master05 from kubernetes cluster.
  • i am getting Error as per below screen shot.

ansible-playbook -i inventory/mycluster/hosts.yaml --become --user=yogesh --become-user=root remove-node.yml -e node=k8s-master05

TASK [remove-node/pre-remove : remove-node | List nodes] ************************************************************************************************************************************
task path: /home/yogesh/kubespray/roles/remove-node/pre-remove/tasks/main.yml:2
The full traceback is:
  File "/tmp/ansible_command_payload_ox6s0azx/ansible_command_payload.zip/ansible/module_utils/basic.py", line 2687, in run_command
    cmd = subprocess.Popen(args, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
fatal: [k8s-master01 -> 136.243.184.161]: FAILED! => {
    "changed": false,
    "cmd": "kubectl get nodes -o 'go-template={{ range .items }}{{ .metadata.name }}{{ \"\\n\" }}{{ end }}'",
    "invocation": {
        "module_args": {
            "_raw_params": "kubectl get nodes -o go-template='{{ range .items }}{{ .metadata.name }}{{ \"\\n\" }}{{ end }}'",
            "_uses_shell": false,
            "argv": null,
            "chdir": null,
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "[Errno 2] No such file or directory: b'kubectl': b'kubectl'",
    "rc": 2
}

NO MORE HOSTS LEFT **************************************************************************************************************************************************************************

PLAY RECAP **********************************************************************************************************************************************************************************
k8s-master01               : ok=11   changed=0    unreachable=0    failed=1    skipped=35   rescued=0    ignored=0
k8s-master05               : ok=0    changed=0    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0
localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

image

@ybhagwatkar ybhagwatkar added the kind/bug Categorizes issue or PR as related to a bug. label Apr 8, 2021
@liupeng0518
Copy link
Member

On k8s-master1:

which kubectl

and

kubectl get node 

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.

2 participants