class ExternalServiceDecorator extends AbstractKubernetesStepDecorator {

	@Override
	public List<HasMetadata> buildAccompanyingKubernetesResources() throws IOException {
		final String serviceName =
			getExternalServiceName(kubernetesJobManagerParameters.getClusterId());

		final Service externalService = new ServiceBuilder()
			.withApiVersion(Constants.API_VERSION)
			.withNewMetadata()
				.withName(serviceName)
				.withLabels(kubernetesJobManagerParameters.getCommonLabels())
				.withAnnotations(kubernetesJobManagerParameters.getRestServiceAnnotations())
				.endMetadata()
			.withNewSpec()
				.withType(kubernetesJobManagerParameters.getRestServiceExposedType().name())
				.withSelector(kubernetesJobManagerParameters.getLabels())
				.addNewPort()
					.withName(Constants.REST_PORT_NAME)
					.withPort(kubernetesJobManagerParameters.getRestPort())
					.withNewTargetPort(kubernetesJobManagerParameters.getRestBindPort())
					.endPort()
				.endSpec()
			.build();

		return Collections.singletonList(externalService);
	}

	public  ExternalServiceDecorator(KubernetesJobManagerParameters kubernetesJobManagerParameters);

}