You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/02/24 11:15:25 UTC

[GitHub] [flink] xintongsong commented on a change in pull request #11110: [FLINK-16111][k8s] Fix Kubernetes deployment not respecting 'taskmanager.cpu.cores'.

xintongsong commented on a change in pull request #11110: [FLINK-16111][k8s] Fix Kubernetes deployment not respecting 'taskmanager.cpu.cores'.
URL: https://github.com/apache/flink/pull/11110#discussion_r383207491
 
 

 ##########
 File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManager.java
 ##########
 @@ -338,6 +339,7 @@ protected FlinkKubeClient createFlinkKubeClient() {
 
 	@Override
 	protected double getCpuCores(Configuration configuration) {
-		return flinkConfig.getDouble(KubernetesConfigOptions.TASK_MANAGER_CPU, numSlotsPerTaskManager);
+		double fallback = configuration.getDouble(KubernetesConfigOptions.TASK_MANAGER_CPU);
+		return TaskExecutorProcessUtils.getCpuCoresWithFallback(configuration, fallback).getValue().doubleValue();
 
 Review comment:
   I agree with @azagrebin that it is difficult to unify Yarn with K8s/Mesos. We cannot easily get the type of the config option, which means it's hard to properly read the config option into a double value.
   
   I'll create a util method share by K8s/Mesos.
   
   Regarding testing, I think we need this test for each deployment anyway, to test the proper fallback of different config options on different deployment.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services