wangyang0918 commented on a change in pull request #11323: [FLINK-16439][k8s] Make KubernetesResourceManager starts workers using WorkerResourceSpec requested by SlotManager URL: https://github.com/apache/flink/pull/11323#discussion_r409966657
########## File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/KubernetesResourceManager.java ########## @@ -237,57 +230,73 @@ private void recoverWorkerNodesFromPreviousAttempts() throws ResourceManagerExce ++currentMaxAttemptId); } - private void requestKubernetesPod() { - numPendingPodRequests++; + private void requestKubernetesPod(WorkerResourceSpec workerResourceSpec) { + final KubernetesTaskManagerParameters parameters = + createKubernetesTaskManagerParameters(workerResourceSpec); + + final KubernetesPod taskManagerPod = + KubernetesTaskManagerFactory.createTaskManagerComponent(parameters); + kubeClient.createTaskManagerPod(taskManagerPod); Review comment: @tillrohrmann Sorry to jump to here. I want to add some additional explanations here. Why i name it to `createTaskManagerPod` instead of `startTaskManagerPod`? * we usually use `create` in K8s commands(e.g. `kubectl create -f taskmanager.yaml`). The start process will be done internally and automatically in K8s `kubelet`. Why do not return a `Pod` for `createTaskManagerPod`? * Of cause we could return a created `Pod`. However, it is not a final or stable state. Since the K8s will do some updates for the `Pod`, the ip address, the status. So i do not return the `Pod` to avoid it may be used incorrectly. For the `KubernetesJobManagerFactory#createJobManagerComponent` and `KubernetesTaskManagerFactory#createTaskManagerComponent`, maybe we could rename them to `KubernetesJobManagerFactory#createJobManagerSpecification` and `KubernetesTaskManagerFactory#createTaskManagerPod`. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services