helmsman icon indicating copy to clipboard operation
helmsman copied to clipboard

The -destroy command does not respect no_proxy configuration

Open mehyedes opened this issue 5 years ago • 2 comments

I have been working with helmsman for a while behind a corporate proxy without issues so far by making sure to set the no_proxy environment variable properly. All I have used so far are the -apply and the -dry-run commands.

However, I recently needed to use the -destroy command and noticed that it fails no matter how I set the no_proxy env variable.

I am using jenkins pipelines, so I used the same pipeline and same value for the no_proxy environment variable and only changed the helmsman command from -apply to -destroy, but it fails every time to connect to the kubernetes API server endpoint:

+ helmsman -destroy -f dependencies.toml
 _          _ 
| |        | | 
| |__   ___| |_ __ ___  ___ _ __ ___   __ _ _ __
| '_ \ / _ \ | '_ ` _ \/ __| '_ ` _ \ / _` | '_ \ 
| | | |  __/ | | | | | \__ \ | | | | | (_| | | | | 
|_| |_|\___|_|_| |_| |_|___/_| |_| |_|\__,_|_| |_| version: v3.4.4
A Helm-Charts-as-Code tool.

[37m2020-09-15 06:55:10 INFO: validating environment variables in dependencies.toml[0m
[37m2020-09-15 06:55:10 INFO: Parsed TOML [[ dependencies.toml ]] successfully and found [ 10 ] apps[0m
[37m2020-09-15 06:55:10 INFO: Validating desired state definition...[0m
[37m2020-09-15 06:55:10 INFO: Setting up kubectl...[0m
[37m2020-09-15 06:55:10 INFO: Kubectl context [ deploy ] does not exist. Attempting to create it...[0m
[37m2020-09-15 06:55:10 INFO: Creating kube context with bearer token from /var/lib/jenkins/workspace/cleanup_k8s_environment/environments/nightly/.helmsman-tmp/tmp652333628/004270296bearer.token[0m
[37m2020-09-15 06:55:11 INFO: Setting up helm...[0m
[37m2020-09-15 06:55:19 INFO: Setting up namespaces...[0m
[35m2020-09-15 06:55:19 CRITICAL: Failed creating namespace [ cert-manager ] with error: Unable to connect to the server: Forbidden

mehyedes avatar Sep 15 '20 07:09 mehyedes

After a bit more testing, I found out that unlike -apply and -dry-run, -destroy only takes into consideration the NO_PROXY environment variable, but not no_proxy.

Is that the expected behaviour?

mehyedes avatar Sep 15 '20 09:09 mehyedes

helmsman doesn't seem to handle these variables by itself, it's basically running helm commands (you could look at what command fails with the -debug flag and run it on your side) One usually have to export both uppercase and lowercase variables when setting http_proxy/https_proxy/no_proxy as it's not handled the same way in every applications.

antoinedeschenes avatar Oct 11 '20 17:10 antoinedeschenes

This issue has been marked stale due to an inactivity.

github-actions[bot] avatar Aug 19 '22 05:08 github-actions[bot]