-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(teutoportal-worker): initial implementation
fix: rename chart fix: remove duplicated chart fix: add new line fix: remove new line at eof fix: maintainer names
- Loading branch information
Showing
9 changed files
with
422 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dependencies: | ||
- name: common | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 2.11.1 | ||
digest: sha256:a49deb9114cec3a3aa67de5f3183afc07e63eda9d3fdd12c42822c509d84e3c2 | ||
generated: "2023-09-18T16:19:04.662258662+02:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v2 | ||
name: teuto-portal | ||
description: A Helm chart for deploying the portal worker application to k8s | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "1.0.0" | ||
|
||
maintainers: | ||
- name: cwrau | ||
email: [email protected] | ||
- name: marvinWolff | ||
email: [email protected] | ||
- name: tasches | ||
email: [email protected] | ||
|
||
dependencies: | ||
- name: common | ||
version: 2.11.1 | ||
repository: https://charts.bitnami.com/bitnami |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{{- define "portalworker.image" -}} | ||
{{ include "common.images.image" (dict "imageRoot" .Values.worker.image "global" .Values.global) }} | ||
{{- end -}} | ||
|
||
{{- define "portalworker.jdbc" -}} | ||
{{- $portString := .Values.worker.database.port | int -}} | ||
{{ printf "jdbc:postgresql://%s:%d/teuto_domain?currentSchema=app_public" .Values.worker.database.host $portString }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: {{- include "common.labels.standard" $ | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }} | ||
template: | ||
metadata: | ||
labels: {{- include "common.labels.standard" $ | nindent 8 }} | ||
spec: | ||
{{- include "common.images.renderPullSecrets" ( dict "images" (list .Values.worker.image) "context" $) | indent 6 }} | ||
securityContext: {{- toYaml .Values.global.securityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: {{- toYaml .Values.global.podSecurityContext | nindent 12 }} | ||
image: {{ template "portalworker.image". }} | ||
{{- if .Values.worker.image.digest }} | ||
imagePullPolicy: IfNotPresent | ||
{{- else }} | ||
imagePullPolicy: Always | ||
{{- end }} | ||
env: | ||
- name: JDBC_URL | ||
value: {{ include "portalworker.jdbc" . | quote }} | ||
- name: DB_PORT | ||
value: {{ .Values.worker.database.port | quote }} | ||
- name: DB_USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.worker.existingSecret "defaultNameSuffix" "db-credentials" "context" $) }} | ||
key: username | ||
- name: DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.worker.existingSecret "defaultNameSuffix" "db-credentials" "context" $) }} | ||
key: password | ||
|
||
{{- range $k, $v := .Values.worker.config }} | ||
{{- if or (typeIs "bool" $v) ($v) }} | ||
- name: {{ regexReplaceAll `_(\d+)` ($k | snakecase | upper) "$1" }} | ||
value: {{ $v | quote }} | ||
{{- end -}} | ||
{{- end }} | ||
ports: | ||
- name: metrics | ||
containerPort: 9090 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /-/healthy | ||
port: metrics | ||
resources: {{- toYaml .Values.worker.resources | nindent 12 }} | ||
volumeMounts: | ||
- mountPath: /kubeconfig | ||
name: clusterconfig | ||
readOnly: true | ||
- mountPath: /tmp | ||
name: tmp | ||
volumes: | ||
- name: tmp | ||
emptyDir: {} | ||
- name: clusterconfig | ||
secret: | ||
secretName: {{ required "k8s access token for the management cluster must be provided" .Values.worker.kubeconfig.secret.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{- if not .Values.worker.existingSecret }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.worker.existingSecret "defaultNameSuffix" "db-credentials" "context" $) }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: {{- include "common.labels.standard" $ | nindent 4}} | ||
type: Opaque | ||
data: | ||
username: {{ .Values.worker.database.user | b64enc }} | ||
password: {{ required "You have to specify a password for the database user" .Values.worker.database.password | b64enc }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "common.names.fullname" . }}-service | ||
namespace: {{ .Release.Namespace }} | ||
labels: {{- include "common.labels.standard" $ | nindent 4 }} | ||
spec: | ||
selector: {{- include "common.labels.matchLabels" $ | nindent 4 }} | ||
ports: | ||
- name: metrics | ||
protocol: TCP | ||
port: 9090 | ||
targetPort: metrics | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
labels: {{- include "common.labels.standard" $ | nindent 4 }} | ||
name: "{{ include "common.names.fullname" . }}-service" | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
endpoints: | ||
- path: /metrics | ||
port: metrics | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace | quote }} | ||
selector: | ||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"type": "object", | ||
"title": "portal worker helmchart", | ||
"properties": { | ||
"global": { | ||
"imageRegistry": { | ||
"type": "string" | ||
}, | ||
"imagePullSecrets": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"podSecurityContext": { | ||
"type": "object", | ||
"properties": { | ||
"runAsNonRoot": { | ||
"type": "boolean" | ||
}, | ||
"readOnlyRootFilesystem": { | ||
"type": "boolean" | ||
}, | ||
"allowPrivilegeEscalation": { | ||
"type": "boolean" | ||
}, | ||
"privileged": { | ||
"type": "boolean" | ||
}, | ||
"capabilities": { | ||
"type": "object", | ||
"properties": { | ||
"drop": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"runAsGroup": { | ||
"type": "integer" | ||
}, | ||
"runAsUser": { | ||
"type": "integer" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"securityContext": { | ||
"type": "object", | ||
"properties": { | ||
"fsGroup": { | ||
"type": "integer" | ||
}, | ||
"runAsUser": { | ||
"type": "integer" | ||
}, | ||
"runAsGroup": { | ||
"type": "integer" | ||
}, | ||
"runAsNonRoot": { | ||
"type": "boolean" | ||
}, | ||
"fsGroupChangePolicy": { | ||
"type": "string", | ||
"enum": [ | ||
"Always", | ||
"OnRootMismatch" | ||
] | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"worker": { | ||
"type": "object", | ||
"properties": { | ||
"image": { | ||
"type": "object", | ||
"properties": { | ||
"registry": { | ||
"type": "string", | ||
"description": "The host of the registry", | ||
"examples": [ | ||
"docker.io" | ||
] | ||
}, | ||
"repository": { | ||
"type": "string", | ||
"description": "The image path in the registry", | ||
"examples": [ | ||
"bitnami/kubectl" | ||
] | ||
}, | ||
"tag": { | ||
"type": "string" | ||
}, | ||
"digest": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"database": { | ||
"type": "object", | ||
"properties": { | ||
"user": { | ||
"type": "string" | ||
}, | ||
"password": { | ||
"type": "string" | ||
}, | ||
"host": { | ||
"type": "string" | ||
}, | ||
"port": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 65535 | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"user", | ||
"password", | ||
"host" | ||
] | ||
}, | ||
"kubeconfig": { | ||
"type": "object", | ||
"properties": { | ||
"secret": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false, | ||
"required": [ | ||
"name" | ||
] | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"config": { | ||
"type": "object", | ||
"properties": { | ||
"dryRun": { | ||
"type": "boolean" | ||
}, | ||
"singleRun": { | ||
"type": "boolean" | ||
}, | ||
"otelExporterTracesEndpoint": { | ||
"type": "string" | ||
}, | ||
"syncInterval": { | ||
"type": "string", | ||
"pattern": "(^(\\d+[h,m,s] *){1,3}$)" | ||
}, | ||
"watchK8sEvents": { | ||
"type": "boolean" | ||
}, | ||
"minimumCPUFlavour": { | ||
"type": "integer", | ||
"minimum": 1 | ||
}, | ||
"flavourPrefixFilter": { | ||
"type": "string" | ||
}, | ||
"clusterNamespace": { | ||
"type": "string" | ||
}, | ||
"k8sVersion": { | ||
"type": "string", | ||
"pattern": "^(\\d+.*){1,3}$" | ||
}, | ||
"loggingFormat": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"resources": { | ||
"type": "object", | ||
"properties": { | ||
"limits": { | ||
"type": "object", | ||
"properties": { | ||
"cpu": { | ||
"type": "string" | ||
}, | ||
"memory": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"request": { | ||
"type": "object", | ||
"properties": { | ||
"cpu": { | ||
"type": "string" | ||
}, | ||
"memory": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
Oops, something went wrong.