# Catalog availability with Rancher 2.0 HA behind HTTP proxy

**URL:** <https://forums.suse.com/t/catalog-availability-with-rancher-2-0-ha-behind-http-proxy/11087>\
**Category:** SUSE Rancher Prime\
**Created:** [July 11, 2018, 6:18pm UTC](https://forums.suse.com/t/catalog-availability-with-rancher-2-0-ha-behind-http-proxy/11087 "2018-07-11T18:18:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justindavis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/justindavis/32/4017_2.png) [@justindavis](https://forums.suse.com/u/justindavis)\
**Post date:** [July 11, 2018, 6:18pm UTC](https://forums.suse.com/t/catalog-availability-with-rancher-2-0-ha-behind-http-proxy/11087/1 "2018-07-11T18:18:37Z")

</div>

Hello

The official documention describes setting up a single node  
Rancher container behind a HTTP proxy, but not an HA  
configuration.

I have a three-node HA cluster setup on-prem, but can’t access  
any of the library or helm catalogs from our private network  
without the proxy settings.

Is this a supported architecture, and if so, where would the  
HTTP\_PROXY, HTTPS\_PROXY and NO\_PROXY environment variables  
need to be defined?

Thanks!

---

<div class="post-metadata">

**Author:** ![damlub](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/damlub/32/4309_2.png) [@damlub](https://forums.suse.com/u/damlub)\
**Post date:** [July 19, 2018, 10:04am UTC](https://forums.suse.com/t/catalog-availability-with-rancher-2-0-ha-behind-http-proxy/11087/2 "2018-07-19T10:04:54Z")

</div>

If you set it up with rke, like I did, you set it up in the cluster.yml configuration like this:

```
# Necessary for password protected SSH Keys:
ssh_agent_auth: true

# Nodes Definitions
nodes:
  - address: 10.0.0.2 # hostname or IP to access nodes
    user: docker # root user (usually 'root')
    role: [controlplane,etcd,worker] # K8s roles for node
    ssh_key_path: ~/.ssh/id_rsa # path to PEM file
...

services:
  kube-apiserver:
    extra_args:
      feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true"
  kubelet:
    extra_args:
      feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true"
    extra_env:
      - "HTTP_PROXY=http://your_proxy"
      - "HTTPS_PROXY=http://your_proxy"
      - "NO_PROXY=127.0.0.1,localhost"

# Default versions
system_images:
    kubernetes: rancher/hyperkube:v1.10.5-rancher1
...

```

Then recreate your cluster with `rke up`, as adding these values doesn’t work yet. I filed a bug report in:

> <https://github.com/rancher/rke/issues/772>
>
> \*\*RKE version:\*\*
> rke version v0.1.8 (on Mac)
> 
> \*\*Docker version: (\`docker vers…ion\`,\`docker info\` preferred)\*\*
> Client:
> Version: 17.03.2-ce
> API version: 1.27
> Go version: go1.7.5
> Git commit: f5ec1e2
> Built: Tue Jun 27 02:21:36 2017
> OS/Arch: linux/amd64
> 
> Server:
> Version: 17.03.2-ce
> API version: 1.27 (minimum version 1.12)
> Go version: go1.7.5
> Git commit: f5ec1e2
> Built: Tue Jun 27 02:21:36 2017
> OS/Arch: linux/amd64
> Experimental: false
> 
> Containers: 32
> Running: 16
> Paused: 0
> Stopped: 16
> Images: 42
> Server Version: 17.03.2-ce
> Storage Driver: overlay
> Backing Filesystem: extfs
> Supports d\_type: true
> Logging Driver: json-file
> Cgroup Driver: cgroupfs
> Plugins:
> Volume: local
> Network: bridge host macvlan null overlay
> Swarm: inactive
> Runtimes: runc
> Default Runtime: runc
> Init Binary: docker-init
> containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
> runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
> init version: 949e6fa
> Security Options:
> seccomp
> Profile: default
> Kernel Version: 3.10.0-862.6.3.el7.x86\_64
> Operating System: CentOS Linux 7 (Core)
> OSType: linux
> Architecture: x86\_64
> CPUs: 2
> Total Memory: 3.701 GiB
> Name: kubernetes01
> ID: 6DKQ:2UPH:2X52:OYZU:QJCI:4BH7:7LUC:K3MO:DVXO:A4Z4:X77R:SOCY
> Docker Root Dir: /var/lib/docker
> Debug Mode (client): false
> Debug Mode (server): false
> Registry: https://index.docker.io/v1/
> Experimental: false
> Insecure Registries:
> 127.0.0.0/8
> Live Restore Enabled: false
> 
> \*\*Operating system and kernel: (\`cat /etc/os-release\`, \`uname -r\` preferred)\*\*
> NAME="CentOS Linux"
> VERSION="7 (Core)"
> ID="centos"
> ID\_LIKE="rhel fedora"
> VERSION\_ID="7"
> PRETTY\_NAME="CentOS Linux 7 (Core)"
> 
> 3.10.0-862.6.3.el7.x86\_64
> 
> \*\*Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO)\*\*
> VMs based on KVM
> 
> \*\*cluster.yml file:\*\*
> (relevant section)
> \`\`\` ...
> services:
> kube-apiserver:
> extra\_args:
> feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true"
> kubelet:
> extra\_args:
> feature-gates: "PersistentLocalVolumes=true,VolumeScheduling=true"
> extra\_env:
> - "PROXY=damian1"
> \`\`\`
> \*\*Steps to Reproduce:\*\*
> Setup a new Rancher Cluster with \`rke up\`, then change variabe \`PROXY=damian2\`, rerung \`rke up\`
> The value of the variable can be checked with \`docker inspect kubelet|grep -C2 PROXY\` on the Linux host.
> 
> \*\*Results:\*\*
> the kubelets on the nodes do not get restarted, PROXY env var does not change
> 
> Changing the extra\_args settings is restarting the container and changes the according settings.

So far, I have setup these variables on my CentOS VM, in systemd Environment config for dockerd, and for kubelet, so it shoud theoratically work, but it still does not work as intended in my network.

Did anyone else find a working solution for that?

Cheers,  
Damian

---

<div class="post-metadata">

**Author:** ![damlub](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/damlub/32/4309_2.png) [@damlub](https://forums.suse.com/u/damlub)\
**Post date:** [July 23, 2018, 5:59am UTC](https://forums.suse.com/t/catalog-availability-with-rancher-2-0-ha-behind-http-proxy/11087/3 "2018-07-23T05:59:56Z")

</div>

Ok, we have solved that issue by providing the HTTP Proxy addresses _additionally_ in cluster.yml’s Deployment section of the rancher/rancher Pods.

There, additional environments vars need to be added, like

```
 kind: Deployment
  apiVersion: extensions/v1beta1
  metadata:
    namespace: cattle-system
    name: cattle
  spec:
    replicas: 1
    template:
      metadata:
        labels:
          app: cattle
      spec:
        serviceAccountName: cattle-admin
        containers:
        - image: rancher/rancher:latest
          imagePullPolicy: Always
          name: cattle-server
          ports:
          - containerPort: 80
            protocol: TCP
          - containerPort: 443
            protocol: TCP
          volumeMounts:
          - mountPath: /etc/rancher/ssl
            name: cattle-keys-volume
            readOnly: true
          env:
            - name: http_proxy
              value: "http://10.1.2.3:3128"
            - name: https_proxy
              value: "http://10.1.2.3:3128"
            - name: HTTP_PROXY
              value: "http://10.1.2.3:3128"
            - name: HTTPS_PROXY
              value: "http://10.1.2.3:3128"
            - name: NO_PROXY
              value: "localhost,127.0.0.1,10.0.0.0/8"
            - name: no_proxy
              value: "localhost,127.0.0.1,10.0.0.0/8"

```

Hope, this helps others to setup Rancher with Catalog behind a http proxy.

Cheers,  
Damian
