You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by sa...@apache.org on 2022/07/21 03:25:52 UTC
[incubator-heron] 02/05: [KubernetesShim] wired in Stateful Set factory
This is an automated email from the ASF dual-hosted git repository.
saadurrahman pushed a commit to branch saadurrahman/3846-Refactoring-K8s-Shim-dev
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
commit 6722ee7bf8d41419079988ca610feaa9e5677aa0
Author: Saad Ur Rahman <sa...@apache.org>
AuthorDate: Wed Jul 20 23:02:37 2022 -0400
[KubernetesShim] wired in Stateful Set factory
---
.../apache/heron/scheduler/kubernetes/KubernetesShim.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/KubernetesShim.java b/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/KubernetesShim.java
index ca339b8320a..c122ff5cda3 100644
--- a/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/KubernetesShim.java
+++ b/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/KubernetesShim.java
@@ -150,8 +150,18 @@ public class KubernetesShim extends KubernetesController {
for (PackingPlan.ContainerPlan containerPlan : packingPlan.getContainers()) {
numberOfInstances = Math.max(numberOfInstances, containerPlan.getInstances().size());
}
- final V1StatefulSet executors = createStatefulSet(containerResource, numberOfInstances, true);
- final V1StatefulSet manager = createStatefulSet(containerResource, numberOfInstances, false);
+
+ final StatefulSet.Configs clusterConfigs = new StatefulSet.Configs(
+ getConfiguration(),
+ getRuntimeConfiguration(),
+ loadPodFromTemplate(false),
+ loadPodFromTemplate(true)
+ );
+
+ final V1StatefulSet executors = StatefulSet.get()
+ .create(StatefulSet.Type.Executor, clusterConfigs, containerResource, numberOfInstances);
+ final V1StatefulSet manager = StatefulSet.get()
+ .create(StatefulSet.Type.Manager, clusterConfigs, containerResource, numberOfInstances);
try {
appsClient.createNamespacedStatefulSet(getNamespace(), executors, null,