clintropolis commented on code in PR #13156:
URL: https://github.com/apache/druid/pull/13156#discussion_r1008566692


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunner.java:
##########
@@ -135,4 +135,24 @@ default TaskLocation getTaskLocation(String taskId)
   Map<String, Long> getLazyTaskSlotCount();
 
   Map<String, Long> getBlacklistedTaskSlotCount();
+
+  /**
+   * Beacause the k8s task runner is an extension, we need to know the task 
runner type in the overlord resource
+   */
+  default boolean isK8sTaskRunner()

Review Comment:
   since this class is marked `@PublicApi`, I think we should consider naming 
this something less specific, like `isDirectTaskRunner` or 
`isWorkerFreeTaskRunner` something to indicate that it is worker free but can 
still run up to `getTotalTaskSlotCount` tasks (based on how its being used in 
`OverlordResource`)



##########
services/src/test/java/org/apache/druid/cli/MainTest.java:
##########
@@ -29,9 +29,6 @@
 
 import java.util.Properties;
 
-/**
- * This test verifies injection for {@link ServerRunnable}s which are 
discoverable Druid servers.
- */

Review Comment:
   nit: intended change?



##########
docs/development/extensions-contrib/k8s-jobs.md:
##########
@@ -0,0 +1,129 @@
+---
+id: k8s-jobs
+title: "MM-less Druid in K8s"
+---
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+Apache Druid Extension to enable using Kubernetes for launching and managing 
tasks instead of the Middle Managers.  This extension allows you to launch 
tasks as kubernetes jobs removing the need for your middle manager.  
+
+Consider this an [EXPERIMENTAL](../experimental.md) feature mostly because it 
has not been tested yet on a wide variety of long-running Druid clusters.
+
+## How it works
+
+The K8s extension takes the podSpec of your `Overlord` pod and creates a 
kubernetes job from this podSpec.  Thus if you have sidecars such as Splunk or 
Istio it can optionally launch a task as a K8s job.  All jobs are natively 
restorable, they are decoupled from the druid deployment, thus restarting pods 
or doing upgrades has no affect on tasks in flight.  They will continue to run 
and when the overlord comes back up it will start tracking them again.  
+
+## Configuration
+
+To use this extension please make sure to  
[include](../extensions.md#loading-extensions)`druid-kubernetes-overlord-extensions`
 in the extensions load list for your overlord process.
+
+The extension uses the task queue to limit how many concurrent tasks (K8s 
jobs) are in flight so it is required you have a reasonable value for 
`druid.indexer.queue.maxSize`.  Additionally set the variable 
`druid.indexer.runner.namespace` to the namespace in which you are running 
druid.
+
+Other configurations required are: 
+`druid.indexer.runner.type: k8s` and `druid.indexer.task.encapsulatedTask: 
true`

Review Comment:
   `druid.indexer.task.encapsulatedTask` doesn't seem documented anywhere (or 
in javadocs), do we need to elaborate on what it does?



##########
services/src/main/java/org/apache/druid/cli/CliPeon.java:
##########
@@ -218,14 +218,22 @@ public void configure(Binder binder)
 
             binder.bind(ExecutorLifecycle.class).in(ManageLifecycle.class);
             LifecycleModule.register(binder, ExecutorLifecycle.class);
-            binder.bind(ExecutorLifecycleConfig.class).toInstance(
-                new ExecutorLifecycleConfig()
-                    .setTaskFile(new File(taskLogPath))
-                    .setStatusFile(new File(taskStatusPath))
-            );
+            ExecutorLifecycleConfig executorLifecycleConfig = new 
ExecutorLifecycleConfig()
+                .setTaskFile(Paths.get(taskDirPath, "task.json").toFile())
+                .setStatusFile(Paths.get(taskDirPath, "attempt", attemptId, 
"status.json").toFile());
+
+            if 
("k8s".equals(properties.getProperty("druid.indexer.runner.type", null))) {
+              log.info("Running peon in k8s mode");
+              executorLifecycleConfig.setParentStreamDefined(false);
+            }

Review Comment:
   nit: this also seems a bit strange and special caseish for a specific thing, 
though i'm not sure introducing another property here is the solution...



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to