dyrnq / kubeadm-vagrant

Run kubernetes cluster with kubeadm on vagrant.
1 stars 5 forks source link

error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to decode cluster configuration data #49

Closed dyrnq closed 2 years ago

dyrnq commented 2 years ago
    worker2: [preflight] Running pre-flight checks
    worker2: [reset] No etcd config found. Assuming external etcd
    worker2: [reset] Please, manually reset etcd to prevent further issues
    worker2: [reset] Stopping the kubelet service
    worker2: W0903 16:05:22.761211   31025 removeetcdmember.go:79] [reset] No kubeadm config, using etcd pod spec to get data directory
    worker2: [reset] Unmounting mounted directories in "/var/lib/kubelet"
    worker2: W0903 16:05:22.768592   31025 cleanupnode.go:99] [reset] Failed to evaluate the "/var/lib/kubelet" directory. Skipping its unmount and cleanup: lstat /var/lib/kubelet: no such file or directory
    worker2: [reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
    worker2: [reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
    worker2: [reset] Deleting contents of stateful directories: [/var/lib/dockershim /var/run/kubernetes /var/lib/cni]
    worker2: 
    worker2: The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
    worker2: 
    worker2: The reset process does not reset or clean up iptables rules or IPVS tables.
    worker2: If you wish to reset iptables, you must do so manually by using the "iptables" command.
    worker2: 
    worker2: If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
    worker2: to reset your system's IPVS tables.
    worker2: 
    worker2: The reset process does not clean your kubeconfig files and you must remove them manually.
    worker2: Please, check the contents of the $HOME/.kube/config file.
    worker2: apiVersion: kubeadm.k8s.io/v1beta2
    worker2: kind: JoinConfiguration
    worker2: discovery:
    worker2:   bootstrapToken:
    worker2:     apiServerEndpoint: 192.168.26.11:6443
    worker2:     caCertHashes: ["sha256:7095173f28c4952dbe897490f1dea0e026cf8653a943c5ca08f87f3c81d5f583"]
    worker2:     token: ayngk7.m1555duk5x2i3ctt
    worker2: 
    worker2: [preflight] Running pre-flight checks
    worker2: [preflight] Reading configuration from the cluster...
    worker2: [preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
    worker2: error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to decode cluster configuration data: no kind "ClusterConfiguration" is registered for version "kubeadm.k8s.io/v1beta3" in scheme "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go:31"
    worker2: To see the stack trace of this error execute with --v=5 or higher
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
dyrnq commented 2 years ago
kubeadm join --config=/tmp/kubeadm-config.yaml -v5
I0903 16:08:33.202729   31194 join.go:395] [preflight] found NodeName empty; using OS hostname as NodeName
I0903 16:08:33.202934   31194 joinconfiguration.go:74] loading configuration from "/tmp/kubeadm-config.yaml"
I0903 16:08:33.205163   31194 initconfiguration.go:115] detected and using CRI socket: /run/containerd/containerd.sock
[preflight] Running pre-flight checks
I0903 16:08:33.205353   31194 preflight.go:90] [preflight] Running general checks
I0903 16:08:33.205463   31194 checks.go:250] validating the existence and emptiness of directory /etc/kubernetes/manifests
I0903 16:08:33.205554   31194 checks.go:287] validating the existence of file /etc/kubernetes/kubelet.conf
I0903 16:08:33.205583   31194 checks.go:287] validating the existence of file /etc/kubernetes/bootstrap-kubelet.conf
I0903 16:08:33.205605   31194 checks.go:103] validating the container runtime
I0903 16:08:33.228310   31194 checks.go:377] validating the presence of executable crictl
I0903 16:08:33.228396   31194 checks.go:336] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I0903 16:08:33.228452   31194 checks.go:336] validating the contents of file /proc/sys/net/ipv4/ip_forward
I0903 16:08:33.228509   31194 checks.go:654] validating whether swap is enabled or not
I0903 16:08:33.228756   31194 checks.go:377] validating the presence of executable conntrack
I0903 16:08:33.228875   31194 checks.go:377] validating the presence of executable ip
I0903 16:08:33.229036   31194 checks.go:377] validating the presence of executable iptables
I0903 16:08:33.229089   31194 checks.go:377] validating the presence of executable mount
I0903 16:08:33.229108   31194 checks.go:377] validating the presence of executable nsenter
I0903 16:08:33.229138   31194 checks.go:377] validating the presence of executable ebtables
I0903 16:08:33.229164   31194 checks.go:377] validating the presence of executable ethtool
I0903 16:08:33.229186   31194 checks.go:377] validating the presence of executable socat
I0903 16:08:33.229210   31194 checks.go:377] validating the presence of executable tc
I0903 16:08:33.229230   31194 checks.go:377] validating the presence of executable touch
I0903 16:08:33.229252   31194 checks.go:525] running all checks
I0903 16:08:33.245274   31194 checks.go:408] checking whether the given node name is valid and reachable using net.LookupHost
I0903 16:08:33.245421   31194 checks.go:623] validating kubelet version
I0903 16:08:33.325535   31194 checks.go:129] validating if the "kubelet" service is enabled and active
I0903 16:08:33.336302   31194 checks.go:202] validating availability of port 10250
I0903 16:08:33.336530   31194 checks.go:287] validating the existence of file /etc/kubernetes/pki/ca.crt
I0903 16:08:33.336553   31194 checks.go:437] validating if the connectivity type is via proxy or direct
I0903 16:08:33.336584   31194 join.go:465] [preflight] Discovering cluster-info
I0903 16:08:33.336604   31194 token.go:78] [discovery] Created cluster-info discovery client, requesting info from "192.168.26.11:6443"
I0903 16:08:33.365397   31194 token.go:116] [discovery] Requesting info from "192.168.26.11:6443" again to validate TLS against the pinned public key
I0903 16:08:33.375209   31194 token.go:133] [discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "192.168.26.11:6443"
I0903 16:08:33.375614   31194 discovery.go:51] [discovery] Using provided TLSBootstrapToken as authentication credentials for the join process
I0903 16:08:33.375639   31194 join.go:479] [preflight] Fetching init configuration
I0903 16:08:33.375644   31194 join.go:517] [preflight] Retrieving KubeConfig objects
[preflight] Reading configuration from the cluster...
[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
no kind "ClusterConfiguration" is registered for version "kubeadm.k8s.io/v1beta3" in scheme "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/scheme/scheme.go:31"
failed to decode cluster configuration data
k8s.io/kubernetes/cmd/kubeadm/app/util/config.getInitConfigurationFromCluster
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/util/config/cluster.go:99
k8s.io/kubernetes/cmd/kubeadm/app/util/config.FetchInitConfigurationFromCluster
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/util/config/cluster.go:69
k8s.io/kubernetes/cmd/kubeadm/app/cmd.fetchInitConfiguration
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:548
k8s.io/kubernetes/cmd/kubeadm/app/cmd.fetchInitConfigurationFromJoinConfiguration
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:518
k8s.io/kubernetes/cmd/kubeadm/app/cmd.(*joinData).InitCfg
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:480
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/join.runPreflight
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/join/preflight.go:95
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run.func1
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:234
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).visitAll
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:421
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:207
k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdJoin.func1
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:172
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:850
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:958
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:895
k8s.io/kubernetes/cmd/kubeadm/app.Run
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:50
main.main
    _output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
    /usr/local/go/src/runtime/proc.go:225
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1371
unable to fetch the kubeadm-config ConfigMap
k8s.io/kubernetes/cmd/kubeadm/app/cmd.fetchInitConfiguration
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:550
k8s.io/kubernetes/cmd/kubeadm/app/cmd.fetchInitConfigurationFromJoinConfiguration
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:518
k8s.io/kubernetes/cmd/kubeadm/app/cmd.(*joinData).InitCfg
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:480
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/join.runPreflight
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/join/preflight.go:95
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run.func1
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:234
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).visitAll
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:421
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:207
k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdJoin.func1
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:172
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:850
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:958
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:895
k8s.io/kubernetes/cmd/kubeadm/app.Run
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:50
main.main
    _output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
    /usr/local/go/src/runtime/proc.go:225
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1371
error execution phase preflight
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run.func1
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:235
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).visitAll
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:421
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow/runner.go:207
k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdJoin.func1
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/cmd/join.go:172
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:850
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:958
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:895
k8s.io/kubernetes/cmd/kubeadm/app.Run
    /workspace/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/app/kubeadm.go:50
main.main
    _output/dockerized/go/src/k8s.io/kubernetes/cmd/kubeadm/kubeadm.go:25
runtime.main
    /usr/local/go/src/runtime/proc.go:225
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1371
dyrnq commented 2 years ago

version not match, master1 version is 1.24.4, worker2 version is 1.21.14