Skip to content

Commit

Permalink
updated control plane helm chart for local environment (functional) a…
Browse files Browse the repository at this point in the history
…nd added values-aws.yaml for AWS environment (in progress)
  • Loading branch information
rajadoui committed Jan 9, 2025
1 parent 93c26ee commit 0fc25e8
Show file tree
Hide file tree
Showing 11 changed files with 444 additions and 502 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ spec:
labels:
app: {{ $.Values.computePlane.metadata.labels.app }}
service: {{ $.Values.computePlane.metadata.labels.service }}
partition: {{ $partitionName }}
partition: {{ $partitionName }}
{{if $config.annotations}}
annotations:
{{- range $key, $value := $config.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
spec:
nodeSelector:
#{{- toYaml $config.nodeSelector | nindent 8 }}
{{- range $key, $value := $config.nodeSelector }}
{{ $key }}: {{ $value | quote }}
{{- end }}
Expand All @@ -43,17 +44,18 @@ spec:
{{- end }}
terminationGracePeriodSeconds: {{ $config.terminationGracePeriodSeconds }}
shareProcessNamespace: {{ $.Values.shareProcessNamespace }}
{{if $config.imagePullSecrets }}
imagePullSecrets:
{{- range $key, $value := $config.imagePullSecrets }}
{{- range $key, $value := $config.imagePullSecrets }}
- name: {{ $value }}
{{- end }}
{{- end }}
restartPolicy: {{ $.Values.restartPolicy }}
restartPolicy: {{ $.Values.restartPolicy }}
serviceAccountName: {{ $config.serviceAccountName }}

containers:
- name: {{ $.Values.pollingAgent.name }}
{{ if (ne $config.pollingAgent.tag "") }}
image: {{ $config.pollingAgent.image }}
image: {{ $config.pollingAgent.image }}:{{ $config.pollingAgent.tag }}
{{ else }}
image: {{ $config.pollingAgent.image }}
{{ end }}
Expand All @@ -65,9 +67,20 @@ spec:
requests:
cpu: "{{ $config.pollingAgent.requests.cpu }}"
memory: "{{ $config.pollingAgent.requests.memory }}"
{{- toYaml $config.pollingAgent.securityContext | nindent 8}}
ports:
- name: {{$.Values.pollingAgent.ports.name}}
containerPort: {{$.Values.pollingAgent.ports.containerPort}}
protocol: TCP
{{if $config.pollingAgent.readinessProbe }}
readinessProbe:
httpGet:
path: {{$.Values.pollingAgent.readinessProbe.httpGet.path}}
port: {{$.Values.pollingAgent.readinessProbe.httpGet.port}}
periodSeconds: {{$.Values.pollingAgent.readinessProbe.periodSeconds}}
timeoutSeconds: {{$.Values.pollingAgent.readinessProbe.timeoutSeconds}}
successThreshold: {{$.Values.pollingAgent.readinessProbe.successThreshold}}
failureThreshold: {{$.Values.pollingAgent.readinessProbe.failureThreshold}}
livenessProbe:
httpGet:
path: {{$.Values.pollingAgent.livenessProbe.httpGet.path}}
Expand All @@ -86,19 +99,31 @@ spec:
timeoutSeconds: {{$.Values.pollingAgent.startupProbe.timeoutSeconds}}
successThreshold: {{$.Values.pollingAgent.startupProbe.successThreshold}}
failureThreshold: {{$.Values.pollingAgent.startupProbe.failureThreshold}}
{{-if $config.envFrom }}
envFrom:
{{- range $key, $value := $.Values.pollingAgentConfigmaps }}
- configMapRef:
name: {{ $value }}
{{- end}}
{{- range $index, $item := $config.envFrom }}
{{- range $key, $value := $item }}
- {{ $key }}:
name: {{ $value }}
optional: false
{{- end }}
{{- end }}
{{- end }}
{{- if or .Values.pollingAgent.envHardValue .Values.pollingAgent.envSecretValue}}
env:
{{- range $i, $value := $.Values.credentials }}
- name: {{ $i | quote }}
{{- if .Values.pollingAgent.envHardValue }}
{{- range $index, $item := .Values.pollingAgent.envHardValue }}
- name: {{ $item.name }}
value: {{ $item.value }}
{{- end }}
{{- end }}
{{- if .Values.pollingAgent.envSecretValue }}
{{- range .Values.pollingAgent.envSecretValue }}
- name: {{ .name }}
valueFrom:
secretKeyRef:
key: {{ $value.key | quote }}
name: {{ $value.name | quote }}
optional: false
{{- toYaml .valueFrom | nindent 14 }}
{{- end }}
{{- end }}
{{- end }}
volumeMounts:
- name: {{$.Values.volumeMount.name}}
Expand Down
40 changes: 38 additions & 2 deletions charts/armonik/charts/compute-plane/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
nameOverride: "armonik-compute-plane"
replicaCount: 1

namespace: armonik
#image:
# tag: ""
#imagePullSecrets: []
Expand All @@ -17,14 +17,31 @@ computePlane:
replicas: 0
pollingAgent:
image: "dockerhubaneo/armonik_pollingagent"
#tag: ""
tag: ""
imagePullPolicy: "IfNotPresent"
limits:
cpu: "2000m"
memory: "2048Mi"
requests:
cpu: "50m"
memory: "50Mi"
securityContext:
drop: ["SYS_PTRACE"]

annotations: {}
nodeSelector: {}
tolerations: []
terminationGracePeriodSeconds: 30
ImagePullSecrets:
- name: "IfNotPresent"
serviceAccountName: ""
readinessProbe: {}
envFrom:
- secretRef: "activemq-user-credentials"
- secretRef: "redis-user-credentials"
- configMapRef: "control-plane-configmap"
- configMapRef: "core-configmap"
- configMapRef: "log-configmap"
# ArmoniK workers
worker:
- name: "default-worker"
Expand Down Expand Up @@ -197,6 +214,25 @@ pollingAgent:
failureThreshold: 20
workerCheckRetries: "10"
workerCheckDelay: "00:00:10"

envHardValue:
- name: Amqp__PartitionId
value: default
- name: PubSub__PartitionId
value: default
- name: SQS__PartitionId
value: default
envSecretValue:
- name: MongoDB__Password
valueFrom:
secretKeyRef:
key: MONGO_PASSWORD
name: mongodb-sharded-admin
- name: MongoDB__User
valueFrom:
secretKeyRef:
key: MONGO_USERNAME
name: mongodb-sharded-admin

supportedQueues:
- Amqp__PartitionId
Expand Down
64 changes: 6 additions & 58 deletions charts/armonik/charts/control-plane/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,65 +1,13 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "control-plane.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "control-plane.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "control-plane.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "control-plane.labels" -}}
helm.sh/chart: {{ include "control-plane.chart" . }}
{{ include "control-plane.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.extraLabels }}
{{ toYaml . }}
{{- end }}
app: {{ .Values.namespace | default "armonik" }}
service: {{ .Values.name | default "control-plane" }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "control-plane.selectorLabels" -}}
app.kubernetes.io/name: {{ include "control-plane.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app: {{ .Values.namespace | default "armonik" }}
service: {{ .Values.name | default "control-plane" }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "control-plane.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "control-plane.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- define "control-plane.name" -}}
{{ .Values.name | default "control-plane" }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{{ if .Values.controlPlanConfigmap.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ first .Values.configmaps }}
name: {{ .Values.config.controlPlane.name }}
namespace: {{ .Values.namespace }}
data:
{{ if or (not .Values.defaultPartition) (eq .Values.defaultPartition "") (not (has .Values.defaultPartition .Values.partitionNames ))}}
{{ if gt (len .Values.partitionNames) 0 }}
Submitter__DefaultPartition: {{ first .Values.partitionNames }}
{{ else }}
{{- $defaultPartition := .Values.config.controlPlane.defaultPartition }}
{{- $partitionNames := keys .Values.config.computePlane.partitions | default list }}

{{- if and $defaultPartition (has $defaultPartition $partitionNames) }}
Submitter__DefaultPartition: {{ $defaultPartition }}
{{- else if gt (len $partitionNames) 0 }}
Submitter__DefaultPartition: {{ index $partitionNames 0 }}
{{- else }}
Submitter__DefaultPartition: ""
{{ end }}
{{ else }}
Submitter__DefaultPartition: {{ .Values.defaultPartition }}
{{ end}}
{{ toYaml .Values.extraConf.control | indent 2 }}
{{ end }}
{{- end }}

{{- range $key, $value := .Values.config.controlPlane.data }}
{{ $key }}: "{{ $value }}"
{{- end }}

Loading

0 comments on commit 0fc25e8

Please sign in to comment.