FrankChen021 commented on code in PR #17701:
URL: https://github.com/apache/druid/pull/17701#discussion_r1961087957
##########
extensions-core/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/DynamicConfigPodTemplateSelector.java:
##########
@@ -43,8 +43,8 @@ public class DynamicConfigPodTemplateSelector implements
PodTemplateSelector
+ ".k8s.podTemplate.";
private final Properties properties;
- private HashMap<String, PodTemplate> podTemplates;
- private Supplier<KubernetesTaskRunnerDynamicConfig> dynamicConfigRef;
+ private final Supplier<KubernetesTaskRunnerDynamicConfig> dynamicConfigRef;
+ private HashMap<String, Supplier<PodTemplate>> podTemplates;
Review Comment:
add a one line comment to explain why the Supplier is defined here
##########
docs/development/extensions-core/k8s-jobs.md:
##########
@@ -494,8 +496,107 @@ data:
```
</details>
+#### Example 2: Using a ConfigMap to upload the Pod Template file
+
+Alternatively, we can mount the ConfigMap onto the Overlord services, and use
the ConfigMap to generate the pod template files we want.
+
+<details>
+<summary>Mounting to Overlord deployment</summary>
+
+```yaml
+ volumeMounts:
+ - name: druid-pod-templates
+ mountPath: /path/to/podTemplate/directory
+
+ volumes:
+ - name: druid-pod-templates
+ configMap:
+ name: druid-pod-templates
+```
+</details>
+
+<details>
+<summary>Example ConfigMap that generates the Base Pod Template</summary>
+
+```yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: druid-pod-templates
+data:
+ basePodSpec.yaml: |-
+ apiVersion: "v1"
+ kind: "PodTemplate"
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/name: "druid-realtime-backend"
+ annotations:
+ sidecar.istio.io/proxyCPU: "512m"
+ spec:
+ containers:
+ - name: main
+ image: apache/druid:{{DRUIDVERSION}}
+ command:
+ - sh
+ - -c
+ - |
+ /peon.sh /druid/data 1
+ env:
+ - name: druid_port
+ value: 8100
+ - name: druid_plaintextPort
+ value: 8100
+ - name: druid_tlsPort
+ value: 8091
+ - name: druid_peon_mode
+ value: remote
+ - name: druid_service
+ value: "druid/peon"
+ - name: druid_indexer_task_baseTaskDir
+ value: /druid/data
+ - name: druid_indexer_runner_type
+ value: k8s
+ - name: druid_indexer_task_encapsulatedTask
+ value: true
+ ports:
+ - containerPort: 8091
+ name: druid-tls-port
+ protocol: TCP
+ - containerPort: 8100
+ name: druid-port
+ protocol: TCP
+ resources:
+ limits:
+ cpu: "1"
+ memory: 2400M
+ requests:
+ cpu: "1"
+ memory: 2400M
+ restartPolicy: "Never"
+ securityContext:
+ fsGroup: 1000
+ runAsGroup: 1000
+ runAsUser: 1000
+ tolerations:
+ - effect: NoExecute
+ key: node.kubernetes.io/not-ready
+ operator: Exists
+ tolerationSeconds: 300
+ - effect: NoExecute
+ key: node.kubernetes.io/unreachable
+ operator: Exists
+ tolerationSeconds: 300
+
+```
+</details>
+
+#### Lazy Loading of Pod Templates
+
+Whenever the Overlord wants to spin up a Kubernetes task pod, it will first
read the relevant pod template files, and then create a task pod according to
the specifications of the pod template file. This is helpful when you want to
make configuration changes to the task pods (e.g. increase/decrease CPU limit
or resources). You can edit the pod template files directly, and the next task
pod spun up by the Overlord will reflect these changes in its configurations.
Review Comment:
```suggestion
Whenever the Overlord wants to spin up a Kubernetes task pod, it will first
read the relevant pod template file, and then create a task pod according to
the specifications of the pod template file. This is helpful when you want to
make configuration changes to the task pods (e.g. increase/decrease CPU limit
or resources). You can edit the pod template files directly, and the next task
pod spun up by the Overlord will reflect these changes in its configurations.
```
##########
docs/development/extensions-core/k8s-jobs.md:
##########
@@ -494,8 +496,107 @@ data:
```
</details>
+#### Example 2: Using a ConfigMap to upload the Pod Template file
+
+Alternatively, we can mount the ConfigMap onto the Overlord services, and use
the ConfigMap to generate the pod template files we want.
Review Comment:
```suggestion
Alternatively, we can mount the ConfigMap onto Overlord services, and use
the ConfigMap to generate the pod template files we want.
```
--
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]