not able to access statefulset headless service from kubernetes

8/25/2017

I have created a headless statefull service in kubernates. and cassandra db is running fine.

PS C:> .\kubectl.exe get svc NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
cassandra None 9042/TCP 50m
kubernetes 10.0.0.1 443/TCP 6d

PS C:> .\kubectl.exe get pods
NAME READY STATUS RESTARTS AGE
cassandra-0 1/1 Running 0 49m
cassandra-1 1/1 Running 0 48m
cassandra-2 1/1 Running 0 48m

I am running all this on minikube. From my laptop i am trying to connect to 192.168.99.100:9402 using a java program. But it is not able to connect.

-- parag mangal
cassandra
kubernetes

1 Answer

8/26/2017

Looks like your service not defined with NodePort. can you change service type to NodePort and test it.

when we define svc to NodePort we should get two port number for the service.

-- sfgroups
Source: StackOverflow