Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

I get "The connection to the server localhost:8080 was refused - did you specify the right host or port" error while trying to use Kubernetes?

$
0
0

I am using Ubuntu 22.04LTS and just installed Kubernetes following this instruction: https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/ on my Ubuntu desktop machine.

When I try this command sudo kubectl cluster-info for example, I get this result:

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.The connection to the server localhost:8080 was refused - did you specify the right host or port?

So I searched through the internet and found this command kubectl config view and this is the result:

apiVersion: v1clusters: nullcontexts: nullcurrent-context: ""kind: Configpreferences: {}users: null

Moreover in this directory /etc/kubernetes there is only an empty folder named manifest.

So I tried sudo kubeadm init but I got:

[init] Using Kubernetes version: v1.25.4[preflight] Running pre-flight checks    [WARNING Swap]: swap is enabled; production deployments should disable swap unless testing the NodeSwap feature gate of the kubelet    [WARNING SystemVerification]: missing optional cgroups: blkioerror execution phase preflight: [preflight] Some fatal errors occurred:    [ERROR CRI]: container runtime is not running: output: E1207 13:27:13.819798   50381 remote_runtime.go:948] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"time="2022-12-07T13:27:13-08:00" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService", error: exit status 1[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

I also tried sudo kubeadm config images pull --v=5 and got the following result/error:

I1207 17:14:06.585276   62896 initconfiguration.go:116] detected and using CRI socket: unix:///var/run/containerd/containerd.sockI1207 17:14:06.585610   62896 interface.go:432] Looking for default routes with IPv4 addressesI1207 17:14:06.585617   62896 interface.go:437] Default route transits interface "wlp2s0"I1207 17:14:06.585904   62896 interface.go:209] Interface wlp2s0 is upI1207 17:14:06.585979   62896 interface.go:257] Interface "wlp2s0" has 2 addresses :[192.168.1.2/24 fe80::7a46:dd7e:145:d5e2/64].I1207 17:14:06.586002   62896 interface.go:224] Checking addr  192.168.1.2/24.I1207 17:14:06.586008   62896 interface.go:231] IP found 192.168.1.2I1207 17:14:06.586032   62896 interface.go:263] Found valid IPv4 address 192.168.1.2 for interface "wlp2s0".I1207 17:14:06.586037   62896 interface.go:443] Found active IP 192.168.1.2 I1207 17:14:06.586088   62896 kubelet.go:196] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"I1207 17:14:06.589640   62896 version.go:187] fetching Kubernetes version from URL: https://dl.k8s.io/release/stable-1.txtexit status 1output: E1207 17:14:07.075957   62948 remote_image.go:222] "PullImage from image service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.ImageService" image="registry.k8s.io/kube-apiserver:v1.25.4"time="2022-12-07T17:14:07-08:00" level=fatal msg="pulling image: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.ImageService", errork8s.io/kubernetes/cmd/kubeadm/app/util/runtime.(*CRIRuntime).PullImage    cmd/kubeadm/app/util/runtime/runtime.go:138k8s.io/kubernetes/cmd/kubeadm/app/cmd.PullControlPlaneImages    cmd/kubeadm/app/cmd/config.go:326k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdConfigImagesPull.func1    cmd/kubeadm/app/cmd/config.go:312github.com/spf13/cobra.(*Command).execute    vendor/github.com/spf13/cobra/command.go:856github.com/spf13/cobra.(*Command).ExecuteC    vendor/github.com/spf13/cobra/command.go:974github.com/spf13/cobra.(*Command).Execute    vendor/github.com/spf13/cobra/command.go:902k8s.io/kubernetes/cmd/kubeadm/app.Run    cmd/kubeadm/app/kubeadm.go:50main.main    cmd/kubeadm/kubeadm.go:25runtime.main    /usr/local/go/src/runtime/proc.go:250runtime.goexit    /usr/local/go/src/runtime/asm_amd64.s:1594failed to pull image "registry.k8s.io/kube-apiserver:v1.25.4"k8s.io/kubernetes/cmd/kubeadm/app/cmd.PullControlPlaneImages    cmd/kubeadm/app/cmd/config.go:327k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdConfigImagesPull.func1    cmd/kubeadm/app/cmd/config.go:312github.com/spf13/cobra.(*Command).execute    vendor/github.com/spf13/cobra/command.go:856github.com/spf13/cobra.(*Command).ExecuteC    vendor/github.com/spf13/cobra/command.go:974github.com/spf13/cobra.(*Command).Execute    vendor/github.com/spf13/cobra/command.go:902k8s.io/kubernetes/cmd/kubeadm/app.Run    cmd/kubeadm/app/kubeadm.go:50main.main    cmd/kubeadm/kubeadm.go:25runtime.main    /usr/local/go/src/runtime/proc.go:250runtime.goexit    /usr/local/go/src/runtime/asm_amd64.s:1594

I don't know what is the problem and how can I resolve it?please let me know if there is more information good to add.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>