Search in sources :

Example 31 with FlinkPod

use of org.apache.flink.kubernetes.kubeclient.FlinkPod in project flink by apache.

the class KubernetesJobManagerFactoryTest method testFlinkConfConfigMap.

@Test
public void testFlinkConfConfigMap() throws IOException {
    kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(flinkPod, kubernetesJobManagerParameters);
    final ConfigMap resultConfigMap = (ConfigMap) this.kubernetesJobManagerSpecification.getAccompanyingResources().stream().filter(x -> x instanceof ConfigMap && x.getMetadata().getName().equals(FlinkConfMountDecorator.getFlinkConfConfigMapName(CLUSTER_ID))).collect(Collectors.toList()).get(0);
    assertEquals(2, resultConfigMap.getMetadata().getLabels().size());
    final Map<String, String> resultDatas = resultConfigMap.getData();
    assertEquals(3, resultDatas.size());
    assertEquals("some data", resultDatas.get(CONFIG_FILE_LOG4J_NAME));
    assertEquals("some data", resultDatas.get(CONFIG_FILE_LOGBACK_NAME));
    assertTrue(resultDatas.get(FLINK_CONF_FILENAME).contains(KubernetesConfigOptionsInternal.ENTRY_POINT_CLASS.key() + ": " + ENTRY_POINT_CLASS));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) SecurityOptions(org.apache.flink.configuration.SecurityOptions) KubernetesTestUtils(org.apache.flink.kubernetes.KubernetesTestUtils) KubernetesJobManagerTestBase(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase) CONFIG_FILE_LOG4J_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOG4J_NAME) Map(java.util.Map) ExternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator) DeploymentSpec(io.fabric8.kubernetes.api.model.apps.DeploymentSpec) KubernetesUtils(org.apache.flink.kubernetes.utils.KubernetesUtils) KubernetesConfigOptions(org.apache.flink.kubernetes.configuration.KubernetesConfigOptions) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) Collectors(java.util.stream.Collectors) Base64(java.util.Base64) List(java.util.List) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Secret(io.fabric8.kubernetes.api.model.Secret) Matchers.is(org.hamcrest.Matchers.is) Constants(org.apache.flink.kubernetes.utils.Constants) Container(io.fabric8.kubernetes.api.model.Container) KubernetesConfigOptionsInternal(org.apache.flink.kubernetes.configuration.KubernetesConfigOptionsInternal) HashMap(java.util.HashMap) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) KubernetesHaServicesFactory(org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) Service(io.fabric8.kubernetes.api.model.Service) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) KubernetesDeploymentTarget(org.apache.flink.kubernetes.configuration.KubernetesDeploymentTarget) FLINK_CONF_FILENAME(org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME) InternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) Matchers(org.hamcrest.Matchers) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) KubernetesSessionClusterEntrypoint(org.apache.flink.kubernetes.entrypoint.KubernetesSessionClusterEntrypoint) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) Assert.assertNull(org.junit.Assert.assertNull) HeadlessClusterIPService(org.apache.flink.kubernetes.kubeclient.services.HeadlessClusterIPService) CONFIG_FILE_LOGBACK_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOGBACK_NAME) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) Collections(java.util.Collections) HighAvailabilityOptions(org.apache.flink.configuration.HighAvailabilityOptions) Assert.assertEquals(org.junit.Assert.assertEquals) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) Test(org.junit.Test)

Example 32 with FlinkPod

use of org.apache.flink.kubernetes.kubeclient.FlinkPod in project flink by apache.

the class KubernetesJobManagerFactoryTest method testPodSpec.

@Test
public void testPodSpec() throws IOException {
    kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(flinkPod, kubernetesJobManagerParameters);
    final PodSpec resultPodSpec = this.kubernetesJobManagerSpecification.getDeployment().getSpec().getTemplate().getSpec();
    assertEquals(1, resultPodSpec.getContainers().size());
    assertEquals(SERVICE_ACCOUNT_NAME, resultPodSpec.getServiceAccountName());
    assertEquals(3, resultPodSpec.getVolumes().size());
    final Container resultedMainContainer = resultPodSpec.getContainers().get(0);
    assertEquals(Constants.MAIN_CONTAINER_NAME, resultedMainContainer.getName());
    assertEquals(CONTAINER_IMAGE, resultedMainContainer.getImage());
    assertEquals(CONTAINER_IMAGE_PULL_POLICY.name(), resultedMainContainer.getImagePullPolicy());
    assertEquals(3, resultedMainContainer.getEnv().size());
    assertTrue(resultedMainContainer.getEnv().stream().anyMatch(envVar -> envVar.getName().equals("key1")));
    assertEquals(3, resultedMainContainer.getPorts().size());
    final Map<String, Quantity> requests = resultedMainContainer.getResources().getRequests();
    assertEquals(Double.toString(JOB_MANAGER_CPU), requests.get("cpu").getAmount());
    assertEquals(String.valueOf(JOB_MANAGER_MEMORY), requests.get("memory").getAmount());
    assertEquals(1, resultedMainContainer.getCommand().size());
    // The args list is [bash, -c, 'java -classpath $FLINK_CLASSPATH ...'].
    assertEquals(3, resultedMainContainer.getArgs().size());
    assertEquals(3, resultedMainContainer.getVolumeMounts().size());
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) SecurityOptions(org.apache.flink.configuration.SecurityOptions) KubernetesTestUtils(org.apache.flink.kubernetes.KubernetesTestUtils) KubernetesJobManagerTestBase(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase) CONFIG_FILE_LOG4J_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOG4J_NAME) Map(java.util.Map) ExternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator) DeploymentSpec(io.fabric8.kubernetes.api.model.apps.DeploymentSpec) KubernetesUtils(org.apache.flink.kubernetes.utils.KubernetesUtils) KubernetesConfigOptions(org.apache.flink.kubernetes.configuration.KubernetesConfigOptions) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) Collectors(java.util.stream.Collectors) Base64(java.util.Base64) List(java.util.List) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Secret(io.fabric8.kubernetes.api.model.Secret) Matchers.is(org.hamcrest.Matchers.is) Constants(org.apache.flink.kubernetes.utils.Constants) Container(io.fabric8.kubernetes.api.model.Container) KubernetesConfigOptionsInternal(org.apache.flink.kubernetes.configuration.KubernetesConfigOptionsInternal) HashMap(java.util.HashMap) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) KubernetesHaServicesFactory(org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) Service(io.fabric8.kubernetes.api.model.Service) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) KubernetesDeploymentTarget(org.apache.flink.kubernetes.configuration.KubernetesDeploymentTarget) FLINK_CONF_FILENAME(org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME) InternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) Matchers(org.hamcrest.Matchers) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) KubernetesSessionClusterEntrypoint(org.apache.flink.kubernetes.entrypoint.KubernetesSessionClusterEntrypoint) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) Assert.assertNull(org.junit.Assert.assertNull) HeadlessClusterIPService(org.apache.flink.kubernetes.kubeclient.services.HeadlessClusterIPService) CONFIG_FILE_LOGBACK_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOGBACK_NAME) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) Collections(java.util.Collections) HighAvailabilityOptions(org.apache.flink.configuration.HighAvailabilityOptions) Assert.assertEquals(org.junit.Assert.assertEquals) Container(io.fabric8.kubernetes.api.model.Container) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) Quantity(io.fabric8.kubernetes.api.model.Quantity) Test(org.junit.Test)

Example 33 with FlinkPod

use of org.apache.flink.kubernetes.kubeclient.FlinkPod in project flink by apache.

the class KubernetesJobManagerFactoryTest method testExistingHadoopConfigMap.

@Test
public void testExistingHadoopConfigMap() throws IOException {
    flinkConfig.set(KubernetesConfigOptions.HADOOP_CONF_CONFIG_MAP, EXISTING_HADOOP_CONF_CONFIG_MAP);
    kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(flinkPod, kubernetesJobManagerParameters);
    assertFalse(kubernetesJobManagerSpecification.getAccompanyingResources().stream().anyMatch(resource -> resource.getMetadata().getName().equals(HadoopConfMountDecorator.getHadoopConfConfigMapName(CLUSTER_ID))));
    final PodSpec podSpec = kubernetesJobManagerSpecification.getDeployment().getSpec().getTemplate().getSpec();
    assertTrue(podSpec.getVolumes().stream().anyMatch(volume -> volume.getConfigMap().getName().equals(EXISTING_HADOOP_CONF_CONFIG_MAP)));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) SecurityOptions(org.apache.flink.configuration.SecurityOptions) KubernetesTestUtils(org.apache.flink.kubernetes.KubernetesTestUtils) KubernetesJobManagerTestBase(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase) CONFIG_FILE_LOG4J_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOG4J_NAME) Map(java.util.Map) ExternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator) DeploymentSpec(io.fabric8.kubernetes.api.model.apps.DeploymentSpec) KubernetesUtils(org.apache.flink.kubernetes.utils.KubernetesUtils) KubernetesConfigOptions(org.apache.flink.kubernetes.configuration.KubernetesConfigOptions) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) Collectors(java.util.stream.Collectors) Base64(java.util.Base64) List(java.util.List) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Secret(io.fabric8.kubernetes.api.model.Secret) Matchers.is(org.hamcrest.Matchers.is) Constants(org.apache.flink.kubernetes.utils.Constants) Container(io.fabric8.kubernetes.api.model.Container) KubernetesConfigOptionsInternal(org.apache.flink.kubernetes.configuration.KubernetesConfigOptionsInternal) HashMap(java.util.HashMap) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) KubernetesHaServicesFactory(org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) Service(io.fabric8.kubernetes.api.model.Service) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) KubernetesDeploymentTarget(org.apache.flink.kubernetes.configuration.KubernetesDeploymentTarget) FLINK_CONF_FILENAME(org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME) InternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) Matchers(org.hamcrest.Matchers) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) KubernetesSessionClusterEntrypoint(org.apache.flink.kubernetes.entrypoint.KubernetesSessionClusterEntrypoint) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) Assert.assertNull(org.junit.Assert.assertNull) HeadlessClusterIPService(org.apache.flink.kubernetes.kubeclient.services.HeadlessClusterIPService) CONFIG_FILE_LOGBACK_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOGBACK_NAME) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) Collections(java.util.Collections) HighAvailabilityOptions(org.apache.flink.configuration.HighAvailabilityOptions) Assert.assertEquals(org.junit.Assert.assertEquals) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) Test(org.junit.Test)

Example 34 with FlinkPod

use of org.apache.flink.kubernetes.kubeclient.FlinkPod in project flink by apache.

the class KubernetesJobManagerFactoryTest method testHadoopConfConfigMap.

@Test
public void testHadoopConfConfigMap() throws IOException {
    setHadoopConfDirEnv();
    generateHadoopConfFileItems();
    kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(flinkPod, kubernetesJobManagerParameters);
    final ConfigMap resultConfigMap = (ConfigMap) kubernetesJobManagerSpecification.getAccompanyingResources().stream().filter(x -> x instanceof ConfigMap && x.getMetadata().getName().equals(HadoopConfMountDecorator.getHadoopConfConfigMapName(CLUSTER_ID))).collect(Collectors.toList()).get(0);
    assertEquals(2, resultConfigMap.getMetadata().getLabels().size());
    final Map<String, String> resultDatas = resultConfigMap.getData();
    assertEquals(2, resultDatas.size());
    assertEquals("some data", resultDatas.get("core-site.xml"));
    assertEquals("some data", resultDatas.get("hdfs-site.xml"));
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) SecurityOptions(org.apache.flink.configuration.SecurityOptions) KubernetesTestUtils(org.apache.flink.kubernetes.KubernetesTestUtils) KubernetesJobManagerTestBase(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase) CONFIG_FILE_LOG4J_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOG4J_NAME) Map(java.util.Map) ExternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator) DeploymentSpec(io.fabric8.kubernetes.api.model.apps.DeploymentSpec) KubernetesUtils(org.apache.flink.kubernetes.utils.KubernetesUtils) KubernetesConfigOptions(org.apache.flink.kubernetes.configuration.KubernetesConfigOptions) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) Collectors(java.util.stream.Collectors) Base64(java.util.Base64) List(java.util.List) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Secret(io.fabric8.kubernetes.api.model.Secret) Matchers.is(org.hamcrest.Matchers.is) Constants(org.apache.flink.kubernetes.utils.Constants) Container(io.fabric8.kubernetes.api.model.Container) KubernetesConfigOptionsInternal(org.apache.flink.kubernetes.configuration.KubernetesConfigOptionsInternal) HashMap(java.util.HashMap) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) KubernetesHaServicesFactory(org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) Service(io.fabric8.kubernetes.api.model.Service) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) KubernetesDeploymentTarget(org.apache.flink.kubernetes.configuration.KubernetesDeploymentTarget) FLINK_CONF_FILENAME(org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME) InternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) Matchers(org.hamcrest.Matchers) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) KubernetesSessionClusterEntrypoint(org.apache.flink.kubernetes.entrypoint.KubernetesSessionClusterEntrypoint) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) Assert.assertNull(org.junit.Assert.assertNull) HeadlessClusterIPService(org.apache.flink.kubernetes.kubeclient.services.HeadlessClusterIPService) CONFIG_FILE_LOGBACK_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOGBACK_NAME) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) Collections(java.util.Collections) HighAvailabilityOptions(org.apache.flink.configuration.HighAvailabilityOptions) Assert.assertEquals(org.junit.Assert.assertEquals) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) Test(org.junit.Test)

Example 35 with FlinkPod

use of org.apache.flink.kubernetes.kubeclient.FlinkPod in project flink by apache.

the class KubernetesJobManagerFactoryTest method testServices.

@Test
public void testServices() throws IOException {
    kubernetesJobManagerSpecification = KubernetesJobManagerFactory.buildKubernetesJobManagerSpecification(flinkPod, kubernetesJobManagerParameters);
    final List<Service> resultServices = this.kubernetesJobManagerSpecification.getAccompanyingResources().stream().filter(x -> x instanceof Service).map(x -> (Service) x).collect(Collectors.toList());
    assertEquals(2, resultServices.size());
    final List<Service> internalServiceCandidates = resultServices.stream().filter(x -> x.getMetadata().getName().equals(InternalServiceDecorator.getInternalServiceName(CLUSTER_ID))).collect(Collectors.toList());
    assertEquals(1, internalServiceCandidates.size());
    final List<Service> restServiceCandidates = resultServices.stream().filter(x -> x.getMetadata().getName().equals(ExternalServiceDecorator.getExternalServiceName(CLUSTER_ID))).collect(Collectors.toList());
    assertEquals(1, restServiceCandidates.size());
    final Service resultInternalService = internalServiceCandidates.get(0);
    assertEquals(2, resultInternalService.getMetadata().getLabels().size());
    assertNull(resultInternalService.getSpec().getType());
    assertEquals(HeadlessClusterIPService.HEADLESS_CLUSTER_IP, resultInternalService.getSpec().getClusterIP());
    assertEquals(2, resultInternalService.getSpec().getPorts().size());
    assertEquals(3, resultInternalService.getSpec().getSelector().size());
    final Service resultRestService = restServiceCandidates.get(0);
    assertEquals(2, resultRestService.getMetadata().getLabels().size());
    assertEquals("ClusterIP", resultRestService.getSpec().getType());
    assertEquals(1, resultRestService.getSpec().getPorts().size());
    assertEquals(3, resultRestService.getSpec().getSelector().size());
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) SecurityOptions(org.apache.flink.configuration.SecurityOptions) KubernetesTestUtils(org.apache.flink.kubernetes.KubernetesTestUtils) KubernetesJobManagerTestBase(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase) CONFIG_FILE_LOG4J_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOG4J_NAME) Map(java.util.Map) ExternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.ExternalServiceDecorator) DeploymentSpec(io.fabric8.kubernetes.api.model.apps.DeploymentSpec) KubernetesUtils(org.apache.flink.kubernetes.utils.KubernetesUtils) KubernetesConfigOptions(org.apache.flink.kubernetes.configuration.KubernetesConfigOptions) FlinkPod(org.apache.flink.kubernetes.kubeclient.FlinkPod) HasMetadata(io.fabric8.kubernetes.api.model.HasMetadata) Collectors(java.util.stream.Collectors) Base64(java.util.Base64) List(java.util.List) Assert.assertFalse(org.junit.Assert.assertFalse) Matchers.equalTo(org.hamcrest.Matchers.equalTo) Secret(io.fabric8.kubernetes.api.model.Secret) Matchers.is(org.hamcrest.Matchers.is) Constants(org.apache.flink.kubernetes.utils.Constants) Container(io.fabric8.kubernetes.api.model.Container) KubernetesConfigOptionsInternal(org.apache.flink.kubernetes.configuration.KubernetesConfigOptionsInternal) HashMap(java.util.HashMap) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) KubernetesHaServicesFactory(org.apache.flink.kubernetes.highavailability.KubernetesHaServicesFactory) PodSpec(io.fabric8.kubernetes.api.model.PodSpec) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) FlinkConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator) Service(io.fabric8.kubernetes.api.model.Service) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) KubernetesDeploymentTarget(org.apache.flink.kubernetes.configuration.KubernetesDeploymentTarget) FLINK_CONF_FILENAME(org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME) InternalServiceDecorator(org.apache.flink.kubernetes.kubeclient.decorators.InternalServiceDecorator) Assert.assertNotNull(org.junit.Assert.assertNotNull) KubernetesJobManagerSpecification(org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification) Matchers(org.hamcrest.Matchers) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) KubernetesSessionClusterEntrypoint(org.apache.flink.kubernetes.entrypoint.KubernetesSessionClusterEntrypoint) HadoopConfMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator) ConfigMap(io.fabric8.kubernetes.api.model.ConfigMap) KerberosMountDecorator(org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator) Assert.assertNull(org.junit.Assert.assertNull) HeadlessClusterIPService(org.apache.flink.kubernetes.kubeclient.services.HeadlessClusterIPService) CONFIG_FILE_LOGBACK_NAME(org.apache.flink.kubernetes.utils.Constants.CONFIG_FILE_LOGBACK_NAME) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) Collections(java.util.Collections) HighAvailabilityOptions(org.apache.flink.configuration.HighAvailabilityOptions) Assert.assertEquals(org.junit.Assert.assertEquals) Service(io.fabric8.kubernetes.api.model.Service) HeadlessClusterIPService(org.apache.flink.kubernetes.kubeclient.services.HeadlessClusterIPService) Test(org.junit.Test)

Aggregations

FlinkPod (org.apache.flink.kubernetes.kubeclient.FlinkPod)54 Test (org.junit.Test)35 Container (io.fabric8.kubernetes.api.model.Container)15 List (java.util.List)14 Constants (org.apache.flink.kubernetes.utils.Constants)13 HashMap (java.util.HashMap)12 Collectors (java.util.stream.Collectors)12 KubernetesConfigOptions (org.apache.flink.kubernetes.configuration.KubernetesConfigOptions)12 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)11 ConfigMap (io.fabric8.kubernetes.api.model.ConfigMap)10 Volume (io.fabric8.kubernetes.api.model.Volume)10 IOException (java.io.IOException)10 Collections (java.util.Collections)10 Map (java.util.Map)10 KubernetesJobManagerSpecification (org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerSpecification)9 KubernetesJobManagerTestBase (org.apache.flink.kubernetes.kubeclient.KubernetesJobManagerTestBase)9 FlinkConfMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.FlinkConfMountDecorator)9 HadoopConfMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.HadoopConfMountDecorator)9 KerberosMountDecorator (org.apache.flink.kubernetes.kubeclient.decorators.KerberosMountDecorator)9 Assert.assertEquals (org.junit.Assert.assertEquals)9