Exposing cassandra cluster on minikube to access externally Exposing cassandra cluster on minikube to access externally kubernetes kubernetes

Exposing cassandra cluster on minikube to access externally


Just for anyone with this problem:After reading docs on datastax I realized that DataStax Studio is meant for use with DataStax Enterprise, for local development and the community edition of cassanda I'm using DataStax DevCenter and it works.

For spring boot (Cassandra cluster running on minikube):

spring.data.cassandra.keyspacename=mykeyspacenamespring.data.cassandra.contactpoints=cassandra-0.cassandra.default.svc.cluster.localspring.data.cassandra.port=9042spring.data.cassandra.schemaaction=create_if_not_exists

For DataStax DevCenter(Cassandra cluster running on minikube):

ContactHost = 192.168.99.100NativeProtocolPort: 300042

Updated cassandra-service

# ------------------- Cassandra Service ------------------- #apiVersion: v1kind: Servicemetadata:  labels:    app: cassandra  name: cassandraspec:  type: NodePort  ports:  - port: 9042    nodePort: 30042  selector:    app: cassandra


If we just want to connect cqlsh, what you neeed is following command

kubectl exec -it cassandra-0 -- cqlsh

On the other hand, if we want to connect from external point, command can be used to get cassandra url (I use DBever to connect cassandra cluster)

minikube service cassandra --url