Master & node setup in Virtual box

Hi ,

im getting the below error

osboxes@kubemaster:~$ kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.52.2
W0427 07:58:59.080404 4241 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
[init] Using Kubernetes version: v1.18.2
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR IsPrivilegedUser]: user is not running as root
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher

because you are setting this configuration from normal user. You must be have sudo or root user to access this.

Thanks for your response but still getting same issue.

I think it will not work if already cluster setup in your machine.

Kodekloud team,

Can you pls help me to resolve this issue.
Appreciate your quick response.

Hi Team,

Im able to resolve using Calico Pod network but not able to see Kube DNS and also not able to join kubeadm.

Pls find the below error :

Kube Master

osboxes@kubemaster:~$ sudo kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-75d56dfc47-h2898 1/1 Running 0 5m24s
kube-system calico-node-77vxf 1/1 Running 0 5m24s
kube-system coredns-66bff467f8-8qlsw 0/1 CrashLoopBackOff 5 12m
kube-system coredns-66bff467f8-v9dkc 0/1 CrashLoopBackOff 5 12m
kube-system etcd-kubemaster 1/1 Running 0 12m
kube-system kube-apiserver-kubemaster 1/1 Running 0 12m
kube-system kube-controller-manager-kubemaster 1/1 Running 0 12m
kube-system kube-proxy-9rpp9 1/1 Running 0 12m
kube-system kube-scheduler-kubemaster 1/1 Running 0 12m

Kube node

osboxes@kubenode1:~$ kubeadm join 192.168.56.2:6443 --token tjafe0.v8nnurg7kenbkhrw \

kubeadm join 192.168.56.2:6443 --token tjafe0.v8nnurg7kenbkhrw ^C
osboxes@kubenode1:~$ sudo kubeadm join 192.168.56.2:6443 --token tjafe0.v8nnurg7kenbkhrw
–discovery-token-ca-cert-hash sha256:c2648d9491547c521de201a4f6f57d9e28898486234d5a6d461e8824285cf937
[sudo] password for osboxes:
W0428 10:21:07.569441 15318 join.go:346] [preflight] WARNING: JoinControlPane.controlPlane settings will be ignored when control-plane flag is not set.
[preflight] Running pre-flight checks
[WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at Container Runtimes | Kubernetes
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher
osboxes@kubenode1:~$