Search in sources :

Example 1 with InitTaskManagerDecorator

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

Pod (io.fabric8.kubernetes.api.model.Pod)1 PodBuilder (io.fabric8.kubernetes.api.model.PodBuilder)1 FlinkPod (org.apache.flink.kubernetes.kubeclient.FlinkPod)1 CmdTaskManagerDecorator (org.apache.flink.kubernetes.kubeclient.decorators.CmdTaskManagerDecorator)1 EnvSecretsDecorator (org.apache.flink.kubernetes.kubeclient.decorators.EnvSecretsDecorator)1 FlinkConfMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator)1 HadoopConfMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator)1 InitTaskManagerDecorator (org.apache.flink.kubernetes.kubeclient.decorators.InitTaskManagerDecorator)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 KubernetesPod (org.apache.flink.kubernetes.kubeclient.resources.KubernetesPod)1