surahman edited a comment on issue #3707:
URL:
https://github.com/apache/incubator-heron/issues/3707#issuecomment-911959524
A quick review of the code in the
`heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/` directory,
and some other related code:
* `KubernetesConstants`: namespaced constants for configurations.
* `KubernetesContext`: child class of `Context` with Kubernetes specific
keys used to lookup values (no "setters", only "getters") stored in the
supplied `Config` object.
* `KubernetesController`: the basic interface with Kubernetes to recover
info about the topology configs as well as submit/kill/restart them.
* `KubernetesLauncher`: used to submit a topology to the Kubernetes cluster.
* `KubernetesScheduler`: the interface to manage the cluster, get info,
kill, restart, resize, and update the cluster size based on the topology. It
contains a `KubernetesController` object which facilitates the comms with the
cluster.
* `KubernetesUtils`: various logging utilities.
* `V1Controller`: child class of the `KubernetesController` which contains
the actual logic to interface with the Kubernetes cluster. The `PackingPlan`
for the instances is central to operations with configurations stored in a
`ContainerPlan` object.
* `Volumes`: utilities used to configure the clusters storage volumes.
* `PackingPlan`: `heron/spi/src/java/org/apache/heron/spi/packing/` has the
classes for `PackingPlan`, `InstancePlan` and `ContainerPlan`.
I have very quickly compiled two basic `ConfigMap`s and I am now wondering
if it is simply a case of parsing the `YAML` file and extracting the contents
of the `template` section into the structure where the `container` configs are
placed:
```YAML
# CONFIGMAP 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: busybox
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
```
```YAML
# CONFIGMAP WITHOUT TEMPLATE:
apiVersion: v1
kind: Pod
metadata:
name: heron-node
spec:
containers:
- name: heron-node
image: busybox
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
```
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 code
base.
--
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]