use of org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME in project flink by apache.
the class FlinkConfMountDecorator method decoratePod.
private Pod decoratePod(Pod pod) {
final List<KeyToPath> keyToPaths = getLocalLogConfFiles().stream().map(file -> new KeyToPathBuilder().withKey(file.getName()).withPath(file.getName()).build()).collect(Collectors.toList());
keyToPaths.add(new KeyToPathBuilder().withKey(FLINK_CONF_FILENAME).withPath(FLINK_CONF_FILENAME).build());
final Volume flinkConfVolume = new VolumeBuilder().withName(FLINK_CONF_VOLUME).withNewConfigMap().withName(getFlinkConfConfigMapName(kubernetesComponentConf.getClusterId())).withItems(keyToPaths).endConfigMap().build();
return new PodBuilder(pod).editSpec().addNewVolumeLike(flinkConfVolume).endVolume().endSpec().build();
}
use of org.apache.flink.configuration.GlobalConfiguration.FLINK_CONF_FILENAME 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));
}
Aggregations