apt-get update stuck in my K8s, fail to install any tool to debug

12/21/2018

I am new in K8s world and I am using helm to install the stable/mysql template then I would like to test it.

I run below to spawn a new ubuntu container as mysql client. However the apt-get update stuck at "Waiting for headers" always.

kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il

root@ubuntu:/# apt-get update
0% [Waiting for headers] [Waiting for headers]

I think it is network issue, but I am not able to install any tool to debug as the apt-get not work.

I tried couple of ways like modifying the /etc/resolv.conf, but it seems it doesn't help.

Anyone can share me some lights about how to proceed?

Thanks!

-- Martin Peng
kubernetes
kubernetes-helm
ubuntu-16.04

1 Answer

1/7/2019

Follow this to setup the proxy will make it work. https://askubuntu.com/questions/109673/how-to-use-apt-get-via-http-proxy-like-this

Add below content to file /etc/apt/apt.conf.

Acquire::http::Proxy "http://proxy.server.port:8080";
-- Martin Peng
Source: StackOverflow