k8s-for-greeks / gpmr

Greek Pet Monster Race - K8s and Cassandra at scale
Apache License 2.0
43 stars 9 forks source link

K8s Snitch and Provider #37

Open chrislovecnm opened 8 years ago

chrislovecnm commented 8 years ago

KubernetesSeedProvider java class KubernetesSnitch java class

Please submit a PR to https://github.com/k8s-for-greeks/cassandra. The https://github.com/k8s-for-greeks/cassandra/tree/removed-10731-migration-task-wait branch should probably be merged into a main offshoot that we maintain.

Rack should be based on GCE Availzone, and DC should probably be ENV props. Thoughts? We could also do rack and DC off of node tags ... Your choice ... I like to do it off of k8s, so @mward29 can use it in aws :)

GCE K8s instances already have the az tagged so that is super easy to pick-up. You should be able to access the k8s api for the node tag. I cannot find the example for a po access its nodes api ... but it should be pretty easy :)

chrislovecnm commented 8 years ago

We will need a secret for each K8s instance. And mount that secret in the Pod.

mward29 commented 8 years ago

The tags should be Kubernetes tags. The attributes are the same regardless of IaaS platform. kubectl label nodes $PRIVATE_IP failure-domain.beta.kubernetes.io/region=$REGION kubectl label nodes $PRIVATE_IP failure-domain.beta.kubernetes.io/zone=$AVAIL_ZONE