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

Fix the PROXY variables, once and for all #4762

Merged
merged 2 commits into from
Jul 18, 2017

Conversation

tbielawa
Copy link
Contributor

@tbielawa tbielawa commented Jul 14, 2017

This will fix a myriad of proxy setting related bugs. At the very least it will impact these:

@tbielawa
Copy link
Contributor Author

Moving the hacky test script into this gist https://gist.github.com/tbielawa/7276903c31ad3dfb0f2759d72f2c5547

@tbielawa tbielawa force-pushed the bz1470165_bz1468424 branch 2 times, most recently from 27c46f1 to b142cea Compare July 17, 2017 13:44
@tbielawa
Copy link
Contributor Author

Squashed.
Rebased onto latest master
Removed the test script (it's in the linked gist, above)

@tbielawa
Copy link
Contributor Author

[test]

@tbielawa
Copy link
Contributor Author

aos-ci-test

#
# Hosts in the openshift_no_proxy list will NOT use any globally
# configured HTTP(S)_PROXYs. openshift_no_proxy accepts domains
# (.example.com), hosts (example.com), and CIDR ranges (10.1.0.0/16)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But certain implementation's don't support CIDR ranges. Docker doesn't. OpenShift does.

#
# For example, having hosts with FQDNs: m1.ex.com, n1.ex.com, and
# n2.ex.com, one would simply add '.ex.com' to the openshift_no_proxy
# variable (above) and set this value to False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

raw_no_proxy_list = []

# Automatic 3.6 NO_PROXY additions if a proxy is in use
svc_cluster_name = ['.svc', '.' + common['dns_domain'], common['hostname']]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just verifying, but dns_domain can never fall back to be an IP address, correct? By it's name I'd assume not but just in case ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we do anything to ensure that someone doesn't set it to an ip address but I'd never expect that to work. It's always used as a dns suffix so I'd expect everything to blow up violently if it weren't a suffix.

# Automatic 3.6 NO_PROXY additions if a proxy is in use
svc_cluster_name = ['.svc', '.' + common['dns_domain'], common['hostname']]

# auto_hosts: Added to NO_PROXY list if any proxy params are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Since this logic only is used if generate_no_proxy_hosts is True it may be worth moving it to line 1692 so it only is generated and stored if it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed on IRC. Implications of leaving the definition in place are negligible. Going to leave as is.

Copy link
Member

@ashcrow ashcrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits but nothing to block over.

@tbielawa tbielawa changed the title [WIP] Fix the PROXY variables, once and for all Fix the PROXY variables, once and for all Jul 17, 2017
@tbielawa
Copy link
Contributor Author

[merge][severity:blocker]

@tbielawa tbielawa added the docs label Jul 17, 2017
@tbielawa
Copy link
Contributor Author

tbielawa commented Jul 17, 2017

@openshift/team-documentation , @adellape this PR introduces and solidifies behavior which is new in 3.6 and may differ slightly from the existing documentation

https://docs.openshift.org/latest/install_config/install/advanced_install.html#advanced-install-configuring-global-proxy

If your hosts require use of a HTTP or HTTPS proxy in order to connect to external hosts, there are many components that must be configured to use the proxy, including masters, Docker, and builds. Node services only connect to the master API requiring no external access and therefore do not need to be configured to use a proxy.

May want to reflect explicitly in the online documentation that if any of

  • openshift_no_proxy
  • openshift_https_proxy
  • openshift_http_proxy

are set, then all cluster hosts will have an automatically generated NO_PROXY environment variable injected into several service configuration scripts. I'm not sure how you want to describe that, but the point I'm trying to make it, it should be clear that if you set any proxy variables then you will have a NO_PROXY environment variable set up for you.

Setting the http/s_proxy variables by themselves will cause all cluster members to be added to the NO_PROXY environment variable. The same goes for any definition of openshift_no_proxy in your inventory. Also added are the default .svc domain and your clusters dns_domain (typically .cluster.local).

Setting openshift_generate_no_proxy_hosts to False in inventory will NOT disable the automatic addition of the .svc domain and the cluster domain. These are required and added automatically if any of the proxy parameters (list, above) are set.

Copy link
Member

@sdodson sdodson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tbielawa tbielawa force-pushed the bz1470165_bz1468424 branch from 1ad834a to bdbc7d9 Compare July 17, 2017 15:08
@sdodson
Copy link
Member

sdodson commented Jul 17, 2017

aos-ci-test

@ashcrow
Copy link
Member

ashcrow commented Jul 17, 2017

flake openshift/origin#10162

@ashcrow
Copy link
Member

ashcrow commented Jul 17, 2017

[merge][severity:blocker]

@openshift-bot
Copy link

error: aos-ci-jenkins/OS_3.6_NOT_containerized for bdbc7d9 (logs)

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.6_containerized, aos-ci-jenkins/OS_3.6_containerized_e2e_tests" for bdbc7d9 (logs)

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.5_NOT_containerized, aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests" for bdbc7d9 (logs)

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.5_containerized, aos-ci-jenkins/OS_3.5_containerized_e2e_tests" for bdbc7d9 (logs)

@tbielawa
Copy link
Contributor Author

flake openshift/origin#8571

@tbielawa
Copy link
Contributor Author

flake openshift/origin#10162

…I think they default it to an empty list if its not found.
@tbielawa
Copy link
Contributor Author

aos-ci-test

@openshift-bot
Copy link

Evaluated for openshift ansible test up to b99b554

@tbielawa
Copy link
Contributor Author

I think other parts of the openshift-ansible API were expecting openshift.common.no_proxy to either be defined, or if undefined then they set it to an empty list. I am hoping that by setting common['no_proxy'] to an empty string in the early-return I can avoid those default([])ing branches in the playbooks later on.

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.5_NOT_containerized, aos-ci-jenkins/OS_3.5_NOT_containerized_e2e_tests" for b99b554 (logs)

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.6_containerized, aos-ci-jenkins/OS_3.6_containerized_e2e_tests" for b99b554 (logs)

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.6_NOT_containerized, aos-ci-jenkins/OS_3.6_NOT_containerized_e2e_tests" for b99b554 (logs)

@openshift-bot
Copy link

success: "aos-ci-jenkins/OS_3.5_containerized, aos-ci-jenkins/OS_3.5_containerized_e2e_tests" for b99b554 (logs)

@openshift-bot
Copy link

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_openshift_ansible/343/) (Base Commit: da7551b) (PR Branch Commit: b99b554)

@vikram-redhat
Copy link

@tbielawa - Thanks Tim. Added a card to our Trello board to make these updates in the docs and tagged @adellape to it. https://trello.com/c/7IsRsDEo/596-updates-for-proxy-variables

@sdodson
Copy link
Member

sdodson commented Jul 18, 2017

[merge][severity:blocker]

@openshift-bot
Copy link

Evaluated for openshift ansible merge up to b99b554

@openshift-bot
Copy link

openshift-bot commented Jul 18, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_openshift_ansible/706/) (Base Commit: 69d3800) (PR Branch Commit: b99b554) (Extended Tests: blocker)

@openshift-bot openshift-bot merged commit 99f37b8 into openshift:master Jul 18, 2017
@sdodson
Copy link
Member

sdodson commented Jul 20, 2017

"once and for all" lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants