I am a newbie to Kubernetes and trying to set up a cluster that runs Cassandra in my local machine. I have used kind to create a cluster that was successful. After that when I try to run kubectl cluster-info, I am getting the below error:
Unable to connect to the server: dial tcp 127.0.0.1:45451: connectex: No connection could be made because the target machine actively refused it.
On docker container ls, I could see the control-plane running on the container using the port as below:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1c4b6101b8ff kindest/node:v1.18.2 "/usr/local/bin/entr" 3 hours ago Up 2 hours 127.0.0.1:45451->6443/tcp kind-cassandra-control-plane
625fee22e0e6 kindest/node:v1.18.2 "/usr/local/bin/entr" 3 hours ago Up 2 hours kind-cassandra-worker
Am able to view the config file by executing kubectl config view as below, which confirms the kubectl is able to read the correct config file:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://127.0.0.1:45451
name: kind-kind-cassandra
contexts:
- context:
cluster: kind-kind-cassandra
user: kind-kind-cassandra
name: kind-kind-cassandra
current-context: kind-kind-cassandra
kind: Config
preferences: {}
users:
- name: kind-kind-cassandra
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
UPDATE:
When I run netstat, I could see below as the active connections on 127.0.0.1
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:2869
TCP 127.0.0.1:5354
TCP 127.0.0.1:5354
TCP 127.0.0.1:27015
TCP 127.0.0.1:49157
TCP 127.0.0.1:49158
TCP 127.0.0.1:49174
Any help is really appreciated. TIA