You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You should not trust the Pod IP to remain the same in a Kubernetes cluster due to the way the Pod IPs are allocated. You could however create an ingress with a static IP if that's the plan and just route that traffic to the pods.
Though I'm still wondering, why not just use the hostname inside Kubernetes if you're not connecting from outside?
@burmanm Do you mean the service hostname, like cassandra-solo-service..svc?
I use it, the use case: we have a lot of test k8s namespaces with single-node cassandra on board. And sometimes something happens, and the cassandra pods break. We test service with clusterIP (no None), and our app reconnects successfully, which does not happen with cluster IP = None.
Of course I can improve the app, but if it's just for testing, why shouldn't I use a service name and a clusterIP?
Well, I think the simplest way is to just create such service if the test requires it. Or, add a Endpoint to the existing service, so you can always find the IP address.
Additionally, in this test case, other options include using host networking (and using the node's IP) or adding the pod IP to the additional-seeds service's EndpointSlice (we don't remove it even if pod goes down).
What is missing?
Ability to create cassandra-solo-service with a non None cluster IP address. Or is it possible? Or why is this not possible/bad practice?
Why is this needed?
In a 1-node Cassandra environment (test), it's easy to reconnect after a restart/failure. Because the ip remains the same.
The text was updated successfully, but these errors were encountered: