use of io.kubernetes.client.openapi.models.V1ServiceSpec in project heron by twitter.
the class V1Controller method createTopologyService.
/**
* Creates a headless <code>Service</code> to facilitate communication between Pods in a <code>topology</code>.
* @return A fully configured <code>Service</code> to be used by a <code>topology</code>.
*/
private V1Service createTopologyService() {
final String topologyName = getTopologyName();
final V1Service service = new V1Service();
// Setup service metadata.
final V1ObjectMeta objectMeta = new V1ObjectMeta().name(topologyName).annotations(getServiceAnnotations()).labels(getServiceLabels());
service.setMetadata(objectMeta);
// Create the headless service.
final V1ServiceSpec serviceSpec = new V1ServiceSpec().clusterIP("None").selector(getPodMatchLabels(topologyName));
service.setSpec(serviceSpec);
return service;
}
Aggregations