kubectl: command not found (bash), but is exist in my VM (OD-2244)
Halil UGUR opened 1 year ago

Command executer, type is bash;

What I miss, or what do I need to do?

19:43:09 Pending resource allocation...
19:43:09 Executing job (executor: kubernete, agent: kubdoc)...
19:43:09 Downloading job dependencies...
19:43:09 Running step "pull-code"...
19:43:09 Checking out code...
19:43:10 Switched to branch 'main'
19:43:10 branch 'main' set up to track 'origin/main'.
19:43:10 Step "pull-code" is successful (0 seconds)
19:43:10 Running step "deploy"...
19:43:10 /root/agent/work/temp/onedev-build-1-11/command/step-1.sh: line 1: kubectl: command not found
19:43:10 Command exited with code 127
19:43:10 Step "deploy" is failed (0 seconds)
19:43:11 Job finished
  • Halil UGUR changed title 1 year ago
    Previous Value Current Value
    kubectl: command not found, but is exist in my VM
    kubectl: command not found (bash), but is exist in my VM
  • Halil UGUR commented 1 year ago

    also,

    1. run in container is false
    2. onedev and kubernete server are different VM
    3. agent installed on kubernete VM and it is working well
  • Robin Shen commented 1 year ago

    Seems that OneDev can not find kubectl in system path for some reason. Please specify absolute path to kubectl to see if it works.

  • Halil UGUR commented 1 year ago

    Let me explain in detail, minikube is working but the bash command does not see the full path or anything I give as an alias, it acts as if it is in a container.

    also I run some basic commands like alias, ls -a, systemctl.

    commands results.

    alias -> gave empty ( but there is lot of alias)

    ls -a -> gave files of the project

    systemctl -> gave working services ( I saw minikube working but not found for full path or alias)

  • Robin Shen commented 1 year ago

    I see you are runing commands on an agent. The agent is not aware of k8s, it simply runs command with VM's shell (if you are running agent directly on VM), or inside the container (if you are running agent inside container). I can not understand why you are mentioning minikube here.

  • Halil UGUR commented 1 year ago

    The point I want to say is that remote shell is not working properly. kubectl, minikube, k3s, I will create a new VM, maybe there is a problem with VM.

  • Halil UGUR commented 1 year ago

    update

    18:56:09 error: error validating "k8s.yml": error validating data: failed to download openapi: Get "http://localhost:8080/openapi/v2?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused; if you choose to ignore these errors, turn validation off with --validate=false
    
  • Robin Shen commented 12 months ago

    How are you running the build agent?

  • Halil UGUR commented 12 months ago

    Hi Robin, Finally I resolve all bugs and issues. There are lot of workaround I has been applied. I will write an article on Medium about it and share my experience as a developer. Thanks for your kind help.

    Note: I will share the Medium article link here after write.

  • Robin Shen commented 12 months ago

    That will be great. Thank you!

  • Robin Shen changed state to 'Closed' 11 months ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-2244
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover