Search in sources :

Example 1 with EnvSecretsDecorator

use of org.apache.flink.kubernetes.kubeclient.decorators.EnvSecretsDecorator 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)

Example 2 with EnvSecretsDecorator

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

the class KubernetesTaskManagerFactory method buildTaskManagerKubernetesPod.

public static KubernetesPod buildTaskManagerKubernetesPod(FlinkPod podTemplate, KubernetesTaskManagerParameters kubernetesTaskManagerParameters) {
    FlinkPod flinkPod = Preconditions.checkNotNull(podTemplate).copy();
    final KubernetesStepDecorator[] stepDecorators = new KubernetesStepDecorator[] { new InitTaskManagerDecorator(kubernetesTaskManagerParameters), new EnvSecretsDecorator(kubernetesTaskManagerParameters), new MountSecretsDecorator(kubernetesTaskManagerParameters), new CmdTaskManagerDecorator(kubernetesTaskManagerParameters), new HadoopConfMountDecorator(kubernetesTaskManagerParameters), new KerberosMountDecorator(kubernetesTaskManagerParameters), new FlinkConfMountDecorator(kubernetesTaskManagerParameters) };
    for (KubernetesStepDecorator stepDecorator : stepDecorators) {
        flinkPod = stepDecorator.decorateFlinkPod(flinkPod);
    }
    final Pod resolvedPod = new PodBuilder(flinkPod.getPodWithoutMainContainer()).editOrNewSpec().addToContainers(flinkPod.getMainContainer()).endSpec().build();
    return new KubernetesPod(resolvedPod);
}
Also used : KubernetesStepDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KubernetesStepDecorator) EnvSecretsDecorator(org.apache.flink.kubernetes.kubeclient.decorators.EnvSecretsDecorator) Pod(io.fabric8.kubernetes.api.model.Pod) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) KubernetesPod(org.apache.flink.kubernetes.kubeclient.resources.KubernetesPod) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) InitTaskManagerDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InitTaskManagerDecorator) PodBuilder(io.fabric8.kubernetes.api.model.PodBuilder) CmdTaskManagerDecorator(org.apache.flink.kubernetes.kubeclient.decorators.CmdTaskManagerDecorator) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) MountSecretsDecorator(org.apache.flink.kubernetes.kubeclient.decorators.MountSecretsDecorator) KubernetesPod(org.apache.flink.kubernetes.kubeclient.resources.KubernetesPod)

Aggregations

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