Class ServiceType
java.lang.Object
org.apache.flink.kubernetes.kubeclient.services.ServiceType
- Direct Known Subclasses:
ClusterIPService,LoadBalancerService,NodePortService
An abstract class represents the service type that flink supported.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.fabric8.kubernetes.api.model.ServicebuildUpExternalRestService(KubernetesJobManagerParameters kubernetesJobManagerParameters) Build up the external rest service template, according to the jobManager parameters.abstract io.fabric8.kubernetes.api.model.ServicebuildUpInternalService(KubernetesJobManagerParameters kubernetesJobManagerParameters) Build up the internal service template, according to the jobManager parameters.classify(io.fabric8.kubernetes.api.model.Service service) getRestEndpoint(io.fabric8.kubernetes.api.model.Service targetService, io.fabric8.kubernetes.client.NamespacedKubernetesClient internalClient, KubernetesConfigOptions.NodePortAddressType nodePortAddressType) Gets the rest endpoint from the kubernetes service.abstract intgetRestPort(io.fabric8.kubernetes.api.model.ServicePort port) Gets the rest port from the service port.intgetRestPortFromExternalService(io.fabric8.kubernetes.api.model.Service externalService) Get rest port from the external Service.abstract StringgetType()Gets the type of the target kubernetes service.
-
Constructor Details
-
ServiceType
public ServiceType()
-
-
Method Details
-
buildUpExternalRestService
public io.fabric8.kubernetes.api.model.Service buildUpExternalRestService(KubernetesJobManagerParameters kubernetesJobManagerParameters) Build up the external rest service template, according to the jobManager parameters.- Parameters:
kubernetesJobManagerParameters- the parameters of jobManager.- Returns:
- the external rest service
-
buildUpInternalService
public abstract io.fabric8.kubernetes.api.model.Service buildUpInternalService(KubernetesJobManagerParameters kubernetesJobManagerParameters) Build up the internal service template, according to the jobManager parameters.- Parameters:
kubernetesJobManagerParameters- the parameters of jobManager.- Returns:
- the internal service
-
getRestEndpoint
public abstract Optional<Endpoint> getRestEndpoint(io.fabric8.kubernetes.api.model.Service targetService, io.fabric8.kubernetes.client.NamespacedKubernetesClient internalClient, KubernetesConfigOptions.NodePortAddressType nodePortAddressType) Gets the rest endpoint from the kubernetes service.- Parameters:
targetService- the target service to retrieve from.internalClient- the client to interact with api server.nodePortAddressType- the target address type of the node.- Returns:
- the rest endpoint.
-
getRestPort
public abstract int getRestPort(io.fabric8.kubernetes.api.model.ServicePort port) Gets the rest port from the service port.- Parameters:
port- the target service port.- Returns:
- the rest port.
-
getType
Gets the type of the target kubernetes service.- Returns:
- the type of the target kubernetes service.
-
getRestPortFromExternalService
public int getRestPortFromExternalService(io.fabric8.kubernetes.api.model.Service externalService) Get rest port from the external Service. -
classify
public static KubernetesConfigOptions.ServiceExposedType classify(io.fabric8.kubernetes.api.model.Service service)
-