<p>I am trying to install the Kubernetes cluster on ubuntu 18.04 system..</p>

<p>As part of intializing the cluster with below command getting below error</p>

<pre><code>        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.14.0: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.3.10: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.3.1: output: Error response from daemon: Get https://k8s.gcr.io/v2/: remote error: tls: access denied
, error: exit status 1
</code></pre>

<p>When i tried to run <code>wget https://k8s.gcr.io/v2/</code> i am getting below error:</p>

<pre><code>Proxy request sent, awaiting response... 401 Unauthorized
Username/Password Authentication Failed.
</code></pre>

<p>Can you please let me know what is the issue.</p>

surya135
<p>In my case I have</p>

<pre><code>[root@instance-1 ~]# wget https://k8s.gcr.io/v2/
--2019-08-26 12:58:24--  https://k8s.gcr.io/v2/
Resolving k8s.gcr.io (k8s.gcr.io)... 64.233.167.82, 2a00:1450:400c:c06::52
Connecting to k8s.gcr.io (k8s.gcr.io)|64.233.167.82|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
</code></pre>

<p>That can be the proxy issue. Inspect  <a href="https://github.com/kubernetes/kubeadm/issues/1201" rel="nofollow noreferrer">[Kubeadm] Failing to pull images</a>, and more concrete [this answer](<a href="https://github.com/kubernetes/kubeadm/issues/1201#issuecomment-494686022" rel="nofollow noreferrer">https://github.com/kubernetes/kubeadm/issues/1201#issuecomment-494686022</a>.</p>

<p>So try to <a href="https://www.thegeekdiary.com/how-to-configure-docker-to-use-proxy/" rel="nofollow noreferrer">configure your docker to use proxy</a> and I hope your issue would be resolved.</p>

<p>And below is summarized set of commands for both the methods:</p>

<p>Method 1 : Configuring proxy variables in the /etc/sysconfig/docker file</p>

<p>-Add following configuration in /etc/sysconfig/docker file</p>

<pre><code># cat /etc/sysconfig/docker
HTTP_PROXY="http://USERNAME:PASSWORD@[your.proxy.server]:[port]"
HTTPS_PROXY="https://USERNAME:PASSWORD@[your.proxy.server]:[port]
</code></pre>

<p>-Restart docker</p>

<pre><code># service docker restart
</code></pre>

<p>Method 2:</p>

<p>1) Create a drop-in</p>

<pre><code># mkdir /etc/systemd/system/docker.service.d
</code></pre>

<p>2) Create a file with name <code>/etc/systemd/system/docker.service.d/http-proxy.conf</code> that adds the <code>HTTP_PROXY</code> environment variable:</p>

<pre><code>[Service]
Environment="HTTP_PROXY=http://user01:password@10.10.10.10:8080/"
Environment="HTTPS_PROXY=https://user01:password@10.10.10.10:8080/"
Environment="NO_PROXY= hostname.example.com,172.10.10.10"
</code></pre>

<p>3) reload the systemd daemon</p>

<pre><code># systemctl daemon-reload
</code></pre>

<p>4) restart docker</p>

<p><code># systemctl restart dock</code>er
5) Verify that the configuration has been loaded:</p>

<pre><code># systemctl show docker --property Environment
Environment=GOTRACEBACK=crash HTTP_PROXY=http://10.10.10.10:8080/ HTTPS_PROXY=http://10.10.10.10:8080/ NO_PROXY= hostname.example.com,172.10.10.10
</code></pre>
