Search in sources :

Example 1 with ExternalServiceDecorator

use of org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator in project flink by apache.

the class KubernetesJobManagerFactory method buildKubernetesJobManagerSpecification.

public static KubernetesJobManagerSpecification buildKubernetesJobManagerSpecification(FlinkPod podTemplate, KubernetesJobManagerParameters kubernetesJobManagerParameters) throws IOException {
    FlinkPod flinkPod = Preconditions.checkNotNull(podTemplate).copy();
    List<HasMetadata> accompanyingResources = new ArrayList<>();
    final KubernetesStepDecorator[] stepDecorators = new KubernetesStepDecorator[] { new InitJobManagerDecorator(kubernetesJobManagerParameters), new EnvSecretsDecorator(kubernetesJobManagerParameters), new MountSecretsDecorator(kubernetesJobManagerParameters), new CmdJobManagerDecorator(kubernetesJobManagerParameters), new InternalServiceDecorator(kubernetesJobManagerParameters), new ExternalServiceDecorator(kubernetesJobManagerParameters), new HadoopConfMountDecorator(kubernetesJobManagerParameters), new KerberosMountDecorator(kubernetesJobManagerParameters), new FlinkConfMountDecorator(kubernetesJobManagerParameters), new PodTemplateMountDecorator(kubernetesJobManagerParameters) };
    for (KubernetesStepDecorator stepDecorator : stepDecorators) {
        flinkPod = stepDecorator.decorateFlinkPod(flinkPod);
        accompanyingResources.addAll(stepDecorator.buildAccompanyingKubernetesResources());
    }
    final Deployment deployment = createJobManagerDeployment(flinkPod, kubernetesJobManagerParameters);
    return new KubernetesJobManagerSpecification(deployment, accompanyingResources);
}
Also used : InternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) KubernetesStepDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KubernetesStepDecorator) EnvSecretsDecorator(org.apache.flink.kubernetes.kubeclient.decorators.EnvSecretsDecorator) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) InitJobManagerDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InitJobManagerDecorator) ArrayList(java.util.ArrayList) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) PodTemplateMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.PodTemplateMountDecorator) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) CmdJobManagerDecorator(org.apache.flink.kubernetes.kubeclient.decorators.CmdJobManagerDecorator) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) ExternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) MountSecretsDecorator(org.apache.flink.kubernetes.kubeclient.decorators.MountSecretsDecorator)

Aggregations

HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)1 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)1 ArrayList (java.util.ArrayList)1 FlinkPod (org.apache.flink.kubernetes.kubeclient.FlinkPod)1 KubernetesJobManagerSpecification (org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification)1 CmdJobManagerDecorator (org.apache.flink.kubernetes.kubeclient.decorators.CmdJobManagerDecorator)1 EnvSecretsDecorator (org.apache.flink.kubernetes.kubeclient.decorators.EnvSecretsDecorator)1 ExternalServiceDecorator (org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator)1 FlinkConfMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator)1 HadoopConfMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator)1 InitJobManagerDecorator (org.apache.flink.kubernetes.kubeclient.decorators.InitJobManagerDecorator)1 InternalServiceDecorator (org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator)1 KerberosMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator)1 KubernetesStepDecorator (org.apache.flink.kubernetes.kubeclient.decorators.KubernetesStepDecorator)1 MountSecretsDecorator (org.apache.flink.kubernetes.kubeclient.decorators.MountSecretsDecorator)1 PodTemplateMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.PodTemplateMountDecorator)1