KUBECTL commands not executing after configuring proxy

  docker, kubernetes

I’m setting up a lab for myself to study and I’m trying to bring up a 3 node cluster running on Ubuntu 20.04 VM’s in private network.
Do be patient with me as I’m still learning :slight_smile: Hopefully I can provide all the needed data to diagnose the issue.

At first, I had my cluster up but 3 nodes were in NotReady state as I did not have any CNI plugin running.

kubectl get nodes
NAME STATUS ROLES AGE VERSION
master-node NotReady control-plane,master 2m17s v1.22.4
worker-node-1 NotReady 100s v1.22.4
worker-node-2 NotReady 97s v1.22.4

Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message

MemoryPressure False Tue, 23 Nov 2021 16:13:31 +0100 Tue, 23 Nov 2021 16:08:25 +0100 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Tue, 23 Nov 2021 16:13:31 +0100 Tue, 23 Nov 2021 16:08:25 +0100 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Tue, 23 Nov 2021 16:13:31 +0100 Tue, 23 Nov 2021 16:08:25 +0100 KubeletHasSufficientPID kubelet has sufficient PID available
Ready False Tue, 23 Nov 2021 16:13:31 +0100 Tue, 23 Nov 2021 16:08:25 +0100 KubeletNotReady container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

In order to pull docker images for CNI I had to configure proxy and I did :slight_smile:

env | grep -i http

https_proxy=proxy.xyx.yyyy.com:8080

I confirmed now I have external reachability however my kubectl just keeps running and finally it times out after quite a bit of time.

I first thought of restarting deamon and reset of kubelet + docker but it didn’t help.
The moment I unset the proxy variable, all works well.

I’m just worried if perhaps the CIDR I used for pod creation is perhaps used in the rest of the network
(I used 10.244.0.0/16)
However proxy should just be used for external connections therefore I"m not sure this would apply.

Any ideas?

Kubernetes version:
kubectl version

Client Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.4”, GitCommit:“b695d79d4f967c403a96986f1750a35eb75e75f1”, GitTreeState:“clean”, BuildDate:“2021-11-17T15:48:33Z”, GoVersion:“go1.16.10”, Compiler:“gc”, Platform:“linux/amd64”}

Server Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.4”, GitCommit:“b695d79d4f967c403a96986f1750a35eb75e75f1”, GitTreeState:“clean”, BuildDate:“2021-11-17T15:42:41Z”, GoVersion:“go1.16.10”, Compiler:“gc”, Platform:“linux/amd64”}

Cloud being used: VM in private network
Installation method:kubeadm
Host OS:

cat /etc/os-release

NAME=“Ubuntu”

VERSION=“20.04.2 LTS (Focal Fossa)”

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME=“Ubuntu 20.04.2 LTS”

VERSION_ID=“20.04”

HOME_URL=“https://www.ubuntu.com/”

SUPPORT_URL=“https://help.ubuntu.com/”

BUG_REPORT_URL=“https://bugs.launchpad.net/ubuntu/”

PRIVACY_POLICY_URL=“Data privacy | Ubuntu”

VERSION_CODENAME=focal

UBUNTU_CODENAME=focal

Source: Docker Questions

LEAVE A COMMENT