-
Notifications
You must be signed in to change notification settings - Fork 593
Add support for Pod Templates which are read from a ConfigMap. The ConfigMap name can be passed in as a config-property #3707
Comments
This is the Spark Scala step that is used to create the Pod spec based on a ConfigMap PodTemplate. |
Hi @nicknezis, I have started poking around in the code base for
This appears to be setting up the Lines 57 to 83 in 4d9a7de
The following code block appears to be creating the YAML config based on the required record structures: I am trying to figure out what my starting point for this should be on the The following utility is preparing the incubator-heron/heron/api/src/java/org/apache/heron/api/utils/TopologyUtils.java Lines 295 to 323 in 4d9a7de
|
A quick review of the code in the
I have very quickly compiled a basic # POD CONFIG WITH TEMPLATE:
apiVersion: v1
kind: Pod
metadata:
name: heron-node
spec:
replicas: 2
selector:
matchLabels:
app: heron-node
template:
metadata:
labels:
app: heron-node
spec:
containers:
- name: heron-node
image: centos:8
command: ['sh', '-c', 'echo "Heron Kubernetes node." && sleep 3600']
resources:
requests:
memory: "1Gb"
cpu: "250m"
limits:
memory: "5Gb"
cpu: "500m"
securityContext:
allowPrivilegeEscalation: false
capabilities:
add: ["NET_ADMIN", "SYS_TIME"]
restartPolicy: OnFailure The code snippet from Spark is appending the following to the pod config, which creates a volumes:
- name: pod-template-name # from <POD_TEMPLATE_VOLUME>.
configMap:
name: configmap-name # from <configmapName>.
items:
- key: pod-template-key # from <POD_TEMPLATE_KEY>.
path: executor-pod-spec-template-file-name # from <EXECUTOR_POD_SPEC_TEMPLATE_FILE_NAME>. This code snippet is adding the volumes:
- name: pod-template-name # from <POD_TEMPLATE_VOLUME>.
path: executor-pod-spec-template-mount-path # from <EXECUTOR_POD_SPEC_TEMPLATE_MOUNTPATH>. The constants (caps naming convention) are defined here. If we are to follow what Spark is doing, we will need to declare these constants as conventions and document them. The most prudent place for these constants is The remaining two routines in the Spark code appear to be extracting information from the configs - they are not modifying them. The question now is what functionality exists within Heron to modify the The following are client API components to interface with Kubernetes:
I have never used Heron and am learning about the workflow and setup as I go, so please bear with me. I am also still getting familiar with the vast codebase. |
Hi @nicknezis, I have a plan put together 🤔 and will start to hammer things out. I shall generate a WIP PR into the Heron repo once I have some of the more substantial components put together. |
This feature request is to enhance the Kubernetes Scheduler to add support for Pod Templates (similar to Spark's Kubernetes feature)
By providing a Pod Template as a ConfigMap, the Heron Kubernetes Scheduler can retrieve the template and provide it as a base starting point for Pod definition.
The text was updated successfully, but these errors were encountered: