Need to know how to set path on Octopus server to kubectl executable

So we are trying to set up a Kubernetes deployment. In these instructions:

it says this about installing kubectl:

" Otherwise the kubectl executable must be in the path on the Octopus server itself."

However, it is not clear to me how to set that (lack of Windows knowledge here). I can obviously set my own path in Windows, but I am not sure how to set a path anywhere so that the running Octopus service (on the Octopus server, not on a node) can utilize it to execute kubectl. Can someone explain where I can set the path so that Octopus will find the kubectl executable?

Hi Matt,

Thanks for getting in touch!

You can do this via powershell (make sure you are running an admin powershell window). If your kubectl file is in c:\kubectl (for example) then the command to append that location to the system path is:

$Env:Path += ";C:\kubectl"

Any questions please let me know!

Regards,
Alex

I tried this and it worked, thanks. But I needed to do one other thing to get Octopus to recognize the new path, and that was to restart the entire virtual machine, i.e. a full OS restart. After that, Octopus was able to find the kubectl executable. I wanted to mention that in case others run into this issue.

Hi Matt,

Thanks for the update, glad to hear that you have everything working.

Regards,
Alex

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.