Error when checking the kubernetes version - kubernetes

I am quite new to kubernetes and when i check the kubernetes version with kubectl version I am getting the following error.
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp 127.0.0.1:6443: connectex: No connection could be made because the target machine actively refused it.
Can you please help me with this?
Thanks in advance!

Seems you have setup kubernetes via kubeadm. Please verify if your kubernetes is running or not.
systemctl restart kubeadm
After that check if port is listening or not
netstat -an | grep :6443

Related

Kubernetes master server 6443 was refused issue

Kubernetes master server 6443 was refused issue
1.my eth0 inet is 192.168.40.6
telnet 192.168.40.6 6443 is no response
2.while
telnet 127.0.0.1 6443 is connected
3.kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.5", GitCommit:"6b1d87acf3c8253c123756b9e61dac642678305f", GitTreeState:"clean", BuildDate:"2021-03-18T01:08:27Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
4.docker -v
Docker version 1.13.1, build 0be3e21/1.13.1

who/where actually work liveness probe in kubernetes?

in my kubernetes cluster, http liveness probe always failed with this message
Liveness probe failed: Get http://10.233.90.72:8080/health: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
so, coredns and kubernetes-dashboard (any other using http liveness probe) pods being infinitely restart.
while pod running (between events start and restart), i check the endpoints for the pod with executing command curl http://10.233.90.72:8080/health on the busyboxplus pod.
this command are working normally, i can see OK return.
but liveness probe still failed. pod is restarting...
in this situation, i want to debug liveness probe, but i don't have any idea who/where actually work liveness probe in kubernetes?
is this pod? or node?
how can i debug liveness probe?
does anyone have same issue..?
please advice for me.
kubectl version:
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.3", GitCommit:"721bfa751924da8d1680787490c54b9179b1fed0", GitTreeState:"clean", BuildDate:"2019-02-01T20:00:57Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
version info:
OS: Ubuntu 18.04
Kubernetes: 1.13.3
Docker: 18.09.2
thanks in advance
Did you check the DNS already ? using the busybox:1.28 try to execute dns lookup to the pod and see what you get.
nslookup pod-ip-in-dash.pod.cluster.local
Another thing you can do which you might already did, check in kube-system if coredns pod is running.
Let me know how went,

kubectl losing connection to minikube

I am using
*$ minikube version
minikube version: v0.28.2
and
*$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T18:02:47Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
I am running a local cluster, while all of the sudden communication between the cluster and kubectl gets lost:
*$ kubectl get pods
No resources found.
Error from server (Timeout): the server was unable to return a response in the time allotted, but may still be processing the request (get pods)
The problem goes away after performing an explicit minikube stop && minikube start
Any ideas how to debug this?
It sounds to be a problem with your kubectl version.
When I have a server version too old, I usually download a kubectl of the same version.
Here the link (linux version):
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl
The problem had to do with resources.
Resolved by stopping minikube and then starting it like this:
minikube --memory 8192 --cpus 2 start
This thread was helpful.

minikube + kubernetes - unable to access the dashboard

I am new to kubernetes and I have been experimenting with docker & minkube + kubernetes for a few weeks...
Everything appears to be working properly except the dashboard...These are my investigation but I have no clue how to fix this.
It is an out-of-the-box configuration, even with kubectl proxy with port 8001 don't work.
me#DEV ~ $ minikube version
minikube version: v0.28.0
me#DEV ~ $ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
zollen#DEV ~ $ kubectl logs pod/kubernetes-dashboard-5498ccf677-hw574 --namespace=kube-system
2018/07/16 00:23:46 Starting overwatch
2018/07/16 00:23:46 Using in-cluster config to connect to apiserver
2018/07/16 00:23:46 Using service account token for csrf signing
2018/07/16 00:23:46 No request provided. Skipping authorization
2018/07/16 00:24:16 Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get https://10.96.0.1:443/version: dial tcp 10.96.0.1:443: i/o timeout
Refer to our FAQ and wiki pages for more information: https://github.com/kubernetes/dashboard/wiki/
me#DEV ~/Downloads $ minikube dashboard
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
me#DEV ~ $ curl https://10.96.0.1:443/version
curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
me#DEV ~ $ kubectl proxy &
Starting to serve on 127.0.0.1:8001
me#DEV ~/Downloads $ curl $(minikube ip):8001
curl: (7) Failed to connect to 10.0.2.15 port 8001: Connection refused
me#DEV ~/Downloads $ curl localhost:8001
{
"paths": [
"/api",
"/api/v1",
"/apis",
"/apis/",
"/apis/admissionregistration.k8s.io",
"/apis/admissionregistration.k8s.io/v1beta1",
"/apis/apiextensions.k8s.io",
"/apis/apiextensions.k8s.io/v1beta1",
"/apis/apiregistration.k8s.io",
"/apis/apiregistration.k8s.io/v1",
"/apis/apiregistration.k8s.io/v1beta1",
"/apis/apps",
"/apis/apps/v1",
"/apis/apps/v1beta1",
"/apis/apps/v1beta2",
"/apis/authentication.k8s.io",
"/apis/authentication.k8s.io/v1",
"/apis/authentication.k8s.io/v1beta1",
"/apis/authorization.k8s.io",
"/apis/authorization.k8s.io/v1",
"/apis/authorization.k8s.io/v1beta1",
"/apis/autoscaling",
"/apis/autoscaling/v1",
"/apis/autoscaling/v2beta1",
"/apis/batch",
"/apis/batch/v1",
"/apis/batch/v1beta1",
"/apis/certificates.k8s.io",
"/apis/certificates.k8s.io/v1beta1",
"/apis/events.k8s.io",
"/apis/events.k8s.io/v1beta1",
"/apis/extensions",
"/apis/extensions/v1beta1",
"/apis/networking.k8s.io",
"/apis/networking.k8s.io/v1",
"/apis/policy",
"/apis/policy/v1beta1",
"/apis/rbac.authorization.k8s.io",
"/apis/rbac.authorization.k8s.io/v1",
"/apis/rbac.authorization.k8s.io/v1beta1",
"/apis/storage.k8s.io",
"/apis/storage.k8s.io/v1",
"/apis/storage.k8s.io/v1beta1",
"/healthz",
"/healthz/autoregister-completion",
"/healthz/etcd",
"/healthz/ping",
"/healthz/poststarthook/apiservice-openapi-controller",
"/healthz/poststarthook/apiservice-registration-controller",
"/healthz/poststarthook/apiservice-status-available-controller",
"/healthz/poststarthook/bootstrap-controller",
"/healthz/poststarthook/ca-registration",
"/healthz/poststarthook/generic-apiserver-start-informers",
"/healthz/poststarthook/kube-apiserver-autoregistration",
"/healthz/poststarthook/rbac/bootstrap-roles",
"/healthz/poststarthook/start-apiextensions-controllers",
"/healthz/poststarthook/start-apiextensions-informers",
"/healthz/poststarthook/start-kube-aggregator-informers",
"/healthz/poststarthook/start-kube-apiserver-informers",
"/logs",
"/metrics",
"/openapi/v2",
"/swagger-2.0.0.json",
"/swagger-2.0.0.pb-v1",
"/swagger-2.0.0.pb-v1.gz",
"/swagger.json",
"/swaggerapi",
"/version"
]
}
.

kubectl describe nodes, reports some error

I am gettting this error in kubectl describe nodes nodename. I just did a google search but nothing useful found , what does this mean.
Failed to update Node Allocatable Limits "": failed to set supported cgroup subsystems for cgroup : Failed to set config for supported subsystems : failed to write 3783778304 to memory.limit_in_bytes: write /rootfs/sys/fs/cgroup/memory/memory.limit_in_bytes: invalid argument
Do I need to change some kernel settings using sysctl ?
[iahmad#lxplus000 ~]$ kubectl --version
Kubernetes v1.5.2
[iahmad#lxplus000 ~]$
[iahmad#lxplus000 ~]$
[iahmad#lxplus000 ~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"269f928217957e7126dc87e6adfa82242bfe5b1e", GitTreeState:"clean", BuildDate:"2017-07-03T15:31:10Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.6", GitCommit:"4bc5e7f9a6c25dc4c03d4d656f2cefd21540e28c", GitTreeState:"clean", BuildDate:"2017-09-18T08:52:26Z", GoVersion:"go1.9", Compiler:"gc", Platform:"linux/amd64"}
[iahmad#lxplus000 ~]$
It depends on the kubectl/kubernetes version: this was seen (and fixed) in kubernetes issue 42701
1.6 should have been patched.
If this is not the same bug, the error message was also seen in issue 29166:
I just forgot to active back disk.uuid after creating back my new VMs!