I am trying to install Kubernetes on my Ubuntu 22.04 machine. When I try the following command:
sudo kubeadm init --skip-phases=addon/kube-proxy --pod-network-cidr=10.244.0.0/16 --v=5
I get this result:
I1213 17:00:05.712274 521447 initconfiguration.go:116] detected and using CRI socket: unix:///var/run/containerd/containerd.sock
I1213 17:00:05.712654 521447 interface.go:432] Looking for default routes with IPv4 addresses
I1213 17:00:05.712662 521447 interface.go:437] Default route transits interface "wlp2s0"
I1213 17:00:05.713113 521447 interface.go:209] Interface wlp2s0 is up
I1213 17:00:05.713174 521447 interface.go:257] Interface "wlp2s0" has 2 addresses :[192.168.1.2/24 fe80::7a46:dd7e:145:d5e2/64].
I1213 17:00:05.713208 521447 interface.go:224] Checking addr 192.168.1.2/24.
I1213 17:00:05.713214 521447 interface.go:231] IP found 192.168.1.2
I1213 17:00:05.713240 521447 interface.go:263] Found valid IPv4 address 192.168.1.2 for interface "wlp2s0".
I1213 17:00:05.713244 521447 interface.go:443] Found active IP 192.168.1.2
I1213 17:00:05.713260 521447 kubelet.go:196] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"
I1213 17:00:05.716792 521447 version.go:187] fetching Kubernetes version from URL: https://dl.k8s.io/release/stable-1.txt
[init] Using Kubernetes version: v1.26.0
[preflight] Running pre-flight checks
I1213 17:00:05.945722 521447 checks.go:568] validating Kubernetes and kubeadm version
I1213 17:00:05.945753 521447 checks.go:168] validating if the firewall is enabled and active
I1213 17:00:05.955106 521447 checks.go:203] validating availability of port 6443
I1213 17:00:05.955356 521447 checks.go:203] validating availability of port 10259
I1213 17:00:05.955425 521447 checks.go:203] validating availability of port 10257
I1213 17:00:05.955500 521447 checks.go:280] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
I1213 17:00:05.955513 521447 checks.go:280] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
I1213 17:00:05.955536 521447 checks.go:280] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
I1213 17:00:05.955548 521447 checks.go:280] validating the existence of file /etc/kubernetes/manifests/etcd.yaml
I1213 17:00:05.955559 521447 checks.go:430] validating if the connectivity type is via proxy or direct
I1213 17:00:05.955586 521447 checks.go:469] validating http connectivity to first IP address in the CIDR
I1213 17:00:05.955597 521447 checks.go:469] validating http connectivity to first IP address in the CIDR
I1213 17:00:05.955605 521447 checks.go:104] validating the container runtime
I1213 17:00:05.980010 521447 checks.go:329] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I1213 17:00:05.980082 521447 checks.go:329] validating the contents of file /proc/sys/net/ipv4/ip_forward
I1213 17:00:05.980166 521447 checks.go:644] validating whether swap is enabled or not
I1213 17:00:05.980235 521447 checks.go:370] validating the presence of executable crictl
I1213 17:00:05.980269 521447 checks.go:370] validating the presence of executable conntrack
I1213 17:00:05.980297 521447 checks.go:370] validating the presence of executable ip
I1213 17:00:05.980350 521447 checks.go:370] validating the presence of executable iptables
I1213 17:00:05.980379 521447 checks.go:370] validating the presence of executable mount
I1213 17:00:05.980403 521447 checks.go:370] validating the presence of executable nsenter
I1213 17:00:05.980429 521447 checks.go:370] validating the presence of executable ebtables
I1213 17:00:05.980451 521447 checks.go:370] validating the presence of executable ethtool
I1213 17:00:05.980472 521447 checks.go:370] validating the presence of executable socat
I1213 17:00:05.980511 521447 checks.go:370] validating the presence of executable tc
I1213 17:00:05.980531 521447 checks.go:370] validating the presence of executable touch
I1213 17:00:05.980571 521447 checks.go:516] running all checks
I1213 17:00:05.992438 521447 checks.go:401] checking whether the given node name is valid and reachable using net.LookupHost
I1213 17:00:05.992475 521447 checks.go:610] validating kubelet version
I1213 17:00:06.045271 521447 checks.go:130] validating if the "kubelet" service is enabled and active
I1213 17:00:06.056454 521447 checks.go:203] validating availability of port 10250
I1213 17:00:06.056548 521447 checks.go:203] validating availability of port 2379
I1213 17:00:06.056582 521447 checks.go:203] validating availability of port 2380
I1213 17:00:06.056614 521447 checks.go:243] validating the existence and emptiness of directory /var/lib/etcd
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
I1213 17:00:06.056717 521447 checks.go:832] using image pull policy: IfNotPresent
I1213 17:00:06.080185 521447 checks.go:841] image exists: registry.k8s.io/kube-apiserver:v1.26.0
I1213 17:00:06.102194 521447 checks.go:841] image exists: registry.k8s.io/kube-controller-manager:v1.26.0
I1213 17:00:06.124531 521447 checks.go:841] image exists: registry.k8s.io/kube-scheduler:v1.26.0
I1213 17:00:06.147256 521447 checks.go:841] image exists: registry.k8s.io/kube-proxy:v1.26.0
I1213 17:00:06.170320 521447 checks.go:841] image exists: registry.k8s.io/pause:3.9
I1213 17:00:06.192792 521447 checks.go:841] image exists: registry.k8s.io/etcd:3.5.6-0
I1213 17:00:06.215664 521447 checks.go:841] image exists: registry.k8s.io/coredns/coredns:v1.9.3
[certs] Using certificateDir folder "/etc/kubernetes/pki"
I1213 17:00:06.215728 521447 certs.go:112] creating a new certificate authority for ca
[certs] Generating "ca" certificate and key
I1213 17:00:06.416819 521447 certs.go:519] validating certificate period for ca certificate
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [a kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.1.2]
[certs] Generating "apiserver-kubelet-client" certificate and key
I1213 17:00:06.890208 521447 certs.go:112] creating a new certificate authority for front-proxy-ca
[certs] Generating "front-proxy-ca" certificate and key
I1213 17:00:07.193396 521447 certs.go:519] validating certificate period for front-proxy-ca certificate
[certs] Generating "front-proxy-client" certificate and key
I1213 17:00:07.287405 521447 certs.go:112] creating a new certificate authority for etcd-ca
[certs] Generating "etcd/ca" certificate and key
I1213 17:00:07.443845 521447 certs.go:519] validating certificate period for etcd/ca certificate
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [a localhost] and IPs [192.168.1.2 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [a localhost] and IPs [192.168.1.2 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
I1213 17:00:08.693250 521447 certs.go:78] creating new public/private key files for signing service account users
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
I1213 17:00:08.903454 521447 kubeconfig.go:103] creating kubeconfig file for admin.conf
[kubeconfig] Writing "admin.conf" kubeconfig file
I1213 17:00:09.084882 521447 kubeconfig.go:103] creating kubeconfig file for kubelet.conf
[kubeconfig] Writing "kubelet.conf" kubeconfig file
I1213 17:00:09.323962 521447 kubeconfig.go:103] creating kubeconfig file for controller-manager.conf
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
I1213 17:00:09.400161 521447 kubeconfig.go:103] creating kubeconfig file for scheduler.conf
[kubeconfig] Writing "scheduler.conf" kubeconfig file
I1213 17:00:09.573083 521447 kubelet.go:67] Stopping the kubelet
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Starting the kubelet
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
I1213 17:00:10.068134 521447 manifests.go:99] [control-plane] getting StaticPodSpecs
I1213 17:00:10.068404 521447 certs.go:519] validating certificate period for CA certificate
I1213 17:00:10.068561 521447 manifests.go:125] [control-plane] adding volume "ca-certs" for component "kube-apiserver"
I1213 17:00:10.068569 521447 manifests.go:125] [control-plane] adding volume "etc-ca-certificates" for component "kube-apiserver"
I1213 17:00:10.068575 521447 manifests.go:125] [control-plane] adding volume "etc-pki" for component "kube-apiserver"
I1213 17:00:10.068580 521447 manifests.go:125] [control-plane] adding volume "k8s-certs" for component "kube-apiserver"
I1213 17:00:10.068603 521447 manifests.go:125] [control-plane] adding volume "usr-local-share-ca-certificates" for component "kube-apiserver"
I1213 17:00:10.068624 521447 manifests.go:125] [control-plane] adding volume "usr-share-ca-certificates" for component "kube-apiserver"
I1213 17:00:10.070556 521447 manifests.go:154] [control-plane] wrote static Pod manifest for component "kube-apiserver" to "/etc/kubernetes/manifests/kube-apiserver.yaml"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
I1213 17:00:10.070588 521447 manifests.go:99] [control-plane] getting StaticPodSpecs
I1213 17:00:10.070825 521447 manifests.go:125] [control-plane] adding volume "ca-certs" for component "kube-controller-manager"
I1213 17:00:10.070835 521447 manifests.go:125] [control-plane] adding volume "etc-ca-certificates" for component "kube-controller-manager"
I1213 17:00:10.070847 521447 manifests.go:125] [control-plane] adding volume "etc-pki" for component "kube-controller-manager"
I1213 17:00:10.070859 521447 manifests.go:125] [control-plane] adding volume "flexvolume-dir" for component "kube-controller-manager"
I1213 17:00:10.070870 521447 manifests.go:125] [control-plane] adding volume "k8s-certs" for component "kube-controller-manager"
I1213 17:00:10.070901 521447 manifests.go:125] [control-plane] adding volume "kubeconfig" for component "kube-controller-manager"
I1213 17:00:10.070926 521447 manifests.go:125] [control-plane] adding volume "usr-local-share-ca-certificates" for component "kube-controller-manager"
I1213 17:00:10.070939 521447 manifests.go:125] [control-plane] adding volume "usr-share-ca-certificates" for component "kube-controller-manager"
I1213 17:00:10.071767 521447 manifests.go:154] [control-plane] wrote static Pod manifest for component "kube-controller-manager" to "/etc/kubernetes/manifests/kube-controller-manager.yaml"
[control-plane] Creating static Pod manifest for "kube-scheduler"
I1213 17:00:10.071795 521447 manifests.go:99] [control-plane] getting StaticPodSpecs
I1213 17:00:10.072094 521447 manifests.go:125] [control-plane] adding volume "kubeconfig" for component "kube-scheduler"
I1213 17:00:10.072475 521447 manifests.go:154] [control-plane] wrote static Pod manifest for component "kube-scheduler" to "/etc/kubernetes/manifests/kube-scheduler.yaml"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
I1213 17:00:10.074184 521447 local.go:65] [etcd] wrote Static Pod manifest for a local etcd member to "/etc/kubernetes/manifests/etcd.yaml"
I1213 17:00:10.074198 521447 waitcontrolplane.go:83] [wait-control-plane] Waiting for the API server to be healthy
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 13.001692 seconds
I1213 17:00:23.077009 521447 uploadconfig.go:111] [upload-config] Uploading the kubeadm ClusterConfiguration to a ConfigMap
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
I1213 17:00:23.179127 521447 uploadconfig.go:125] [upload-config] Uploading the kubelet component config to a ConfigMap
[kubelet] Creating a ConfigMap "kubelet-config" in namespace kube-system with the configuration for the kubelets in the cluster
I1213 17:00:23.348491 521447 uploadconfig.go:130] [upload-config] Preserving the CRISocket information for the control-plane node
I1213 17:00:23.348515 521447 patchnode.go:31] [patchnode] Uploading the CRI Socket information "unix:///var/run/containerd/containerd.sock" to the Node API object "a" as an annotation
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node a as control-plane by adding the labels: [node-role.kubernetes.io/control-plane node.kubernetes.io/exclude-from-external-load-balancers]
[mark-control-plane] Marking the node a as control-plane by adding the taints [node-role.kubernetes.io/control-plane:NoSchedule]
[bootstrap-token] Using token: 9jiz6o.t21o06tt700624bj
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes
[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
I1213 17:00:24.848283 521447 clusterinfo.go:47] [bootstrap-token] loading admin kubeconfig
I1213 17:00:24.849139 521447 clusterinfo.go:58] [bootstrap-token] copying the cluster from admin.conf to the bootstrap kubeconfig
I1213 17:00:24.849419 521447 clusterinfo.go:70] [bootstrap-token] creating/updating ConfigMap in kube-public namespace
I1213 17:00:24.871820 521447 clusterinfo.go:84] creating the RBAC rules for exposing the cluster-info ConfigMap in the kube-public namespace
I1213 17:00:25.049727 521447 kubeletfinalize.go:90] [kubelet-finalize] Assuming that kubelet client certificate rotation is enabled: found "/var/lib/kubelet/pki/kubelet-client-current.pem"
[kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key
I1213 17:00:25.050942 521447 kubeletfinalize.go:134] [kubelet-finalize] Restarting the kubelet to enable client certificate rotation
I1213 17:00:27.099127 521447 with_retry.go:241] Got a Retry-After 1s response for attempt 1 to https://192.168.1.2:6443/api/v1/namespaces/kube-system/services/kube-dns?timeout=10s
Put "https://192.168.1.2:6443/api/v1/namespaces/kube-system/services/kube-dns?timeout=10s": dial tcp 192.168.1.2:6443: connect: connection refused
unable to create/update the DNS service
k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/dns.createDNSService
cmd/kubeadm/app/phases/addons/dns/dns.go:273
k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/dns.createCoreDNSAddon
cmd/kubeadm/app/phases/addons/dns/dns.go:255
k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/dns.coreDNSAddon
cmd/kubeadm/app/phases/addons/dns/dns.go:157
k8s.io/kubernetes/cmd/kubeadm/app/phases/addons/dns.EnsureDNSAddon
cmd/kubeadm/app/phases/addons/dns/dns.go:102
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/init.runCoreDNSAddon
cmd/kubeadm/app/cmd/phases/init/addons.go:112
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run.func1
cmd/kubeadm/app/cmd/phases/workflow/runner.go:259
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).visitAll
cmd/kubeadm/app/cmd/phases/workflow/runner.go:446
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run
cmd/kubeadm/app/cmd/phases/workflow/runner.go:232
k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdInit.func1
cmd/kubeadm/app/cmd/init.go:112
github.com/spf13/cobra.(*Command).execute
vendor/github.com/spf13/cobra/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
vendor/github.com/spf13/cobra/command.go:1040
github.com/spf13/cobra.(*Command).Execute
vendor/github.com/spf13/cobra/command.go:968
k8s.io/kubernetes/cmd/kubeadm/app.Run
cmd/kubeadm/app/kubeadm.go:50
main.main
cmd/kubeadm/kubeadm.go:25
runtime.main
/usr/local/go/src/runtime/proc.go:250
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1594
error execution phase addon/coredns
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run.func1
cmd/kubeadm/app/cmd/phases/workflow/runner.go:260
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).visitAll
cmd/kubeadm/app/cmd/phases/workflow/runner.go:446
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run
cmd/kubeadm/app/cmd/phases/workflow/runner.go:232
k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdInit.func1
cmd/kubeadm/app/cmd/init.go:112
github.com/spf13/cobra.(*Command).execute
vendor/github.com/spf13/cobra/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
vendor/github.com/spf13/cobra/command.go:1040
github.com/spf13/cobra.(*Command).Execute
vendor/github.com/spf13/cobra/command.go:968
k8s.io/kubernetes/cmd/kubeadm/app.Run
cmd/kubeadm/app/kubeadm.go:50
main.main
cmd/kubeadm/kubeadm.go:25
runtime.main
/usr/local/go/src/runtime/proc.go:250
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1594
Is this a BUG REPORT or FEATURE REQUEST?
BUG REPORT
Versions
kubeadm version: &version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:57:06Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/amd64"}
Environment:
- OS (e.g. from /etc/os-release):
Ubuntu 22.04 LTS
- Kernel (e.g.
uname -a
):Linux a 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
- Container runtime (CRI) (e.g. containerd, cri-o):
containerd
- Container networking plugin (CNI) (e.g. Calico, Cilium): 10-flannel.conflist
- Others:
This is the content of /etc/resolve.conf
:
# This is /run/systemd/resolve/stub-resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0 trust-ad
search .