Search in sources :

Example 1 with KubernetesClusterClientFactory

use of org.apache.flink.kubernetes.KubernetesClusterClientFactory in project flink by apache.

the class KubernetesJobManagerFactoryWithPodTemplateTest method getResultPod.

@Override
protected Pod getResultPod(FlinkPod podTemplate) throws Exception {
    final KubernetesJobManagerParameters kubernetesJobManagerParameters = new KubernetesJobManagerParameters(flinkConfig, new KubernetesClusterClientFactory().getClusterSpecification(flinkConfig));
    final KubernetesJobManagerSpecification kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(podTemplate, kubernetesJobManagerParameters);
    final PodTemplateSpec podTemplateSpec = kubernetesJobManagerSpecification.getDeployment().getSpec().getTemplate();
    return new PodBuilder().withMetadata(podTemplateSpec.getMetadata()).withSpec(podTemplateSpec.getSpec()).build();
}
Also used : PodTemplateSpec(io.fabric8.kubernetes.api.model.PodTemplateSpec) KubernetesClusterClientFactory(org.apache.flink.kubernetes.KubernetesClusterClientFactory) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) KubernetesJobManagerParameters(org.apache.flink.kubernetes.kubeclient.parameters.KubernetesJobManagerParameters)

Example 2 with KubernetesClusterClientFactory

use of org.apache.flink.kubernetes.KubernetesClusterClientFactory in project flink by apache.

the class InitJobManagerDecoratorWithPodTemplateTest method getResultPod.

@Override
public FlinkPod getResultPod(FlinkPod podTemplate) {
    final KubernetesJobManagerParameters kubernetesJobManagerParameters = new KubernetesJobManagerParameters(flinkConfig, new KubernetesClusterClientFactory().getClusterSpecification(flinkConfig));
    final InitJobManagerDecorator initJobManagerDecorator = new InitJobManagerDecorator(kubernetesJobManagerParameters);
    return initJobManagerDecorator.decorateFlinkPod(podTemplate);
}
Also used : KubernetesClusterClientFactory(org.apache.flink.kubernetes.KubernetesClusterClientFactory) KubernetesJobManagerParameters(org.apache.flink.kubernetes.kubeclient.parameters.KubernetesJobManagerParameters)

Aggregations

KubernetesClusterClientFactory (org.apache.flink.kubernetes.KubernetesClusterClientFactory)2 KubernetesJobManagerParameters (org.apache.flink.kubernetes.kubeclient.parameters.KubernetesJobManagerParameters)2 PodBuilder (io.fabric8.kubernetes.api.model.PodBuilder)1 PodTemplateSpec (io.fabric8.kubernetes.api.model.PodTemplateSpec)1 KubernetesJobManagerSpecification (org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification)1