service.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. # This service only exists to create DNS entries for each pod in the stateful
  5. # set such that they can resolve each other's IP addresses. It does not
  6. # create a load-balanced ClusterIP and should not be used directly by clients
  7. # in most circumstances.
  8. name: cockroachdb
  9. labels:
  10. app: cockroachdb
  11. annotations:
  12. # Enable automatic monitoring of all instances when Prometheus is running in the cluster.
  13. prometheus.io/scrape: "true"
  14. prometheus.io/path: "_status/vars"
  15. prometheus.io/port: "8080"
  16. spec:
  17. ports:
  18. - port: 26257
  19. targetPort: 26257
  20. name: grpc
  21. - port: 8080
  22. targetPort: 8080
  23. name: http
  24. clusterIP: None
  25. selector:
  26. app: cockroachdb
  27. # This is needed to make the peer-finder work properly and to help avoid
  28. # edge cases where instance 0 comes up after losing its data and needs to
  29. # decide whether it should create a new cluster or try to join an existing
  30. # one. If it creates a new cluster when it should have joined an existing
  31. # one, we'd end up with two separate clusters listening at the same service
  32. # endpoint, which would be very bad.
  33. publishNotReadyAddresses: true