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

add no_proxy support to k8s* #271

Closed
itaru2622 opened this issue Oct 26, 2021 · 1 comment · Fixed by #272
Closed

add no_proxy support to k8s* #271

itaru2622 opened this issue Oct 26, 2021 · 1 comment · Fixed by #272

Comments

@itaru2622
Copy link
Contributor

SUMMARY

current kubernetes.core supports parameter for proxy but NOT no_proxy.
as the result, operator needs to set/unset proxy according to the target clusters.
it is bothering task because kubectl supports both proxy and no_proxy environment variables.

no_proxy is supported in latest kubernetes python library (since kubernetes>=19.15.0).
so lets support it in kubernetes.core for ansible.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

plugins/module_utils/args_common.py
plugins/modules/k8s*

ADDITIONAL INFORMATION
  - k8s:
      state: present
      src: "deployment.yaml"
      proxy:      "http://proxy.yourdomain.com:8080/"
      no_proxy:   "localhost,.yourdomain.com,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192,168.0.0/16"

or, set environment variables K8S_AUTH_NO_PROXY as well as K8S_AUTH_PROXY

@itaru2622 itaru2622 changed the title add no_proxy support add no_proxy support to k8s* Oct 26, 2021
@itaru2622
Copy link
Contributor Author

itaru2622 commented Oct 26, 2021

you can test if this feature working by below snippet yaml

if no_proxy working, you can acess anywhere in direct.
if it is not working, your access will get failure.

 proxy:  "http://blackhole.com:8080/"
 no_proxy: "*"

ansible-zuul bot pushed a commit that referenced this issue Nov 10, 2021
add no_proxy support to k8s*

SUMMARY

close #271

ISSUE TYPE


Feature Pull Request

COMPONENT NAME

plugins/module_utils/args_common.py
plugins/modules/k8s*
ADDITIONAL INFORMATION


It requires latest kubernetes library(>=19.15.0) to use this feature.


pip install kubernetes>=19.15.0
then, use following snippet yaml:

  - k8s:
      state: present
      src: "deployment.yaml"
      proxy:      "http://proxy.yourdomain.com:8080/"
      no_proxy:   "localhost,.yourdomain.com,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192,168.0.0/16"

or use environment variable K8S_AUTH_NO_PROXY as well as K8S_AUTH_PROXY.

Reviewed-by: None <None>
Reviewed-by: None <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant