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_r410233011
##########
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:
Thanks for your explanation. From your suggestion guideline, the following
two interfaces are already in good shape.
```
// Create the Master components, this can include the Deployment, the
ConfigMap(s), and the Service(s).
void createJobManagerComponent(KubernetesJobManagerSpecification
kubernetesJMSpec);
CompletableFuture<Void> createTaskManagerPod(KubernetesPod kubernetesPod);
```
And the following two methods could be renamed.
```
public static KubernetesJobManagerSpecification
createJobManagerComponent(KubernetesJobManagerParameters
kubernetesJobManagerParameters)
public static KubernetesPod
createTaskManagerComponent(KubernetesTaskManagerParameters
kubernetesTaskManagerParameters)
```
===>
```
public static KubernetesJobManagerSpecification
buildKubernetesJobManagerSpecification(KubernetesJobManagerParameters
kubernetesJobManagerParameters)
public static KubernetesPod
buildTaskManagerKubernetesPod(KubernetesTaskManagerParameters
kubernetesTaskManagerParameters)
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services