Initial submission

This commit is contained in:
2023-09-23 22:49:42 -06:00
commit 3fc058e820
19 changed files with 671 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "conversion-engine.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 "conversion-engine.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 "conversion-engine.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "conversion-engine.labels" -}}
helm.sh/chart: {{ include "conversion-engine.chart" . }}
{{ include "conversion-engine.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "conversion-engine.selectorLabels" -}}
app.kubernetes.io/name: {{ include "conversion-engine.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "conversion-engine.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "conversion-engine.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.pvc.name }}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: {{ .Values.pvc.size }}
storageClassName: {{ .Values.pvc.storageClassName }}

View File

@@ -0,0 +1,72 @@
apiVersion: keda.sh/v1alpha1
kind: ScaledJob
metadata:
name: {{ include "conversion-engine.fullname" . }}
labels:
{{- include "conversion-engine.labels" . | nindent 4 }}
spec:
failedJobsHistoryLimit: 5
jobTargetRef:
activeDeadlineSeconds: 86400
completions: 1
parallelism: 1
template:
metadata:
creationTimestamp: null
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: scaledjob.keda.sh/name
operator: In
values:
- conversion-engine-consumer
topologyKey: kubernetes.io/hostname
weight: 100
{{- if .Values.cicd.enabled }}
initContainers:
- name: init-storage
image: quay01.ipa.endofday.com/goghvideo/rockylinux:9-ubi
env:
- name: sourcefile
value: "{{ uuidv4 }}"
command: ['sh', '-c', "cd {{ .Values.mount.path }} && curl -o ${sourcefile} {{ .Values.cicd.testFile }}"]
volumeMounts:
- mountPath: "{{ .Values.mount.path }}"
name: "{{ .Values.mount.name }}"
{{- end }}
containers:
- env:
- name: amqp
valueFrom:
secretKeyRef:
key: url
name: amqp
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: Always
name: transcode-job
resources:
requests:
cpu: "4"
memory: 2Gi
volumeMounts:
- mountPath: "{{ .Values.mount.path }}"
name: "{{ .Values.mount.name }}"
volumes:
- name: "{{ .Values.volumes.name }}"
persistentVolumeClaim:
claimName: "{{ .Values.volumes.claimName }}"
maxReplicaCount: 4
pollingInterval: 60
successfulJobsHistoryLimit: 5
triggers:
- authenticationRef:
name: "{{ .Values.keda.authenticationRef }}"
metadata:
includeUnacked: "false"
queueLength: "1"
queueName: "{{ .Values.keda.queueName }}"
type: rabbitmq

View File

@@ -0,0 +1,10 @@
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: "{{ .Values.keda.authenticationRef }}"
namespace: "{{ .Release.Namespace }}"
spec:
secretTargetRef:
- key: "{{ .Values.keda.triggerSecretKey }}"
name: "{{ .Values.keda.triggerSecretRef }}"
parameter: host