Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra Statefulset: How to expose the cluster? #48

Closed
ashwinipatankar opened this issue Aug 3, 2017 · 1 comment
Closed

Cassandra Statefulset: How to expose the cluster? #48

ashwinipatankar opened this issue Aug 3, 2017 · 1 comment

Comments

@ashwinipatankar
Copy link

ashwinipatankar commented Aug 3, 2017

I am trying out the cassandra -statefulset example. And can see all the three pods joined the cluster:

kubectl exec cassandra-0 -- nodetool status
Datacenter: DC1-K8Demo
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address    Load       Tokens       Owns (effective)  Host ID                               Rack
UN  10.44.0.4  65.63 KiB  32           59.3%             91152a3e-c802-45bf-a4a9-33187a97b4c4  Rack1-K8Demo
UN  10.45.0.1  65.63 KiB  32           68.9%             ca7d39f4-341a-43d6-a180-23f89b124334  Rack1-K8Demo
UN  10.44.0.3  65.59 KiB  32           71.9%             b9075133-61ed-4fde-97c7-c2fd8d2b4234  Rack1-K8Demo

The out put of kubectl get service is:

kubectl get services
NAME         CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE
cassandra    None         <none>        9042/TCP   10s
kubernetes   10.96.0.1    <none>        443/TCP    50m

Now, I want to expose it and use from out side the cluster.

Any help will be highly appreciated.

@ahmetb
Copy link
Member

ahmetb commented Aug 3, 2017

@ashwinipatankar consider taking a look at type:NodePort and type:LoadBalancer documentation here:

You can see how to expose a service externally at frontend-service.yaml on the guestbook example: https://github.com/kubernetes/examples/tree/master/guestbook

However it's not recommended to expose applications such as database to the outside world from a security perspective as anyone who can discover your IP address can try to break in or DDoS your database. If you have further questions, consider asking them on kubernetes-users@googlegroups.com mailing list.

@ahmetb ahmetb closed this as completed Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants