Skip to content

Proxy environment variables shouldn't be passed to apiserver #666

Closed
@andrewshilliday

Description

@andrewshilliday

What keywords did you search in kubeadm issues before filing this one?

environment, proxy

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version (use kubeadm version):
kubeadm version: &version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T09:42:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Kubernetes version (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T09:42:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}

  • Cloud provider or hardware configuration:

  • OS (e.g. from /etc/os-release):
    NAME="Red Hat Enterprise Linux Workstation"
    VERSION="7.4 (Maipo)"
    ID="rhel"
    ID_LIKE="fedora"
    VARIANT="Workstation"
    VARIANT_ID="workstation"
    VERSION_ID="7.4"
    PRETTY_NAME="Red Hat Enterprise Linux"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:workstation"
    HOME_URL="https://www.redhat.com/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.4"

What happened?

My cluster sits behind a corporate firewall and as such, we have http_proxy, https_proxy, and no_proxy environment variables defined in order to reach outside severs. When calling kubdadm the enviromnment gets passed along to the apiserver manifest (and to others). However, unless your no_proxy settings are configured to include all of the IP adresses that will be used by kubernetes for pods and services, the api server may incorrectly try to use the proxy settings to access services.

For example, if you start up the dashboard and attempt to access it through the api server through http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/, the service will fail with an EOF error because the api server cannot access the dashboard (because it attempts to use the proxy settings).

What you expected to happen?

To the best of my knowledge, the api server never needs to access the outside world, only local services and endpoints, therefore, I see no reason why the environment should be passed to it when the manifest is created.

How to reproduce it (as minimally and precisely as possible)?

[ See example above ]

Anything else we need to know?

The obvious workaround is to not have proxy settings defined when you call kubeadm init. And this is a workable solution. However, some of the services that start up do expect to call home for various reasons (e.g., kubeadm attempts to fetch the latest version number of kubernetes if it's not passed as a command line), and those requests will fail if required proxy settings are not defined.

Metadata

Metadata

Assignees

Labels

priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.triaged

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions