Add chart for rust-synapse-compress-state.
All checks were successful
ci/woodpecker/push/rust-synapse-compress-state Pipeline was successful

This commit is contained in:
Alex Manning 2023-09-27 23:00:52 +01:00
parent 703481bced
commit ec49865574
7 changed files with 247 additions and 0 deletions

View file

@ -0,0 +1,12 @@
---
when:
path: "charts/rust-synapse-compress-state/**"
branch: main
steps:
package:
image: "docker.io/alpine/helm:latest"
secrets: [helm_user, helm_password, helm_repo]
commands:
- helm plugin install https://github.com/chartmuseum/helm-push
- helm repo add therepo $HELM_REPO --username $HELM_USER --password $HELM_PASSWORD
- helm cm-push charts/rust-synapse-compress-state therepo

View file

@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View file

@ -0,0 +1,24 @@
apiVersion: v2
name: rust-synapse-compress-state
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "3956e0f6be3a58c50f14146d78c30a74fcb3cca9"

View file

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

View file

@ -0,0 +1,69 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "rust-synapse-compress-state.fullname" . }}
labels:
{{- include "rust-synapse-compress-state.labels" . | nindent 4 }}
# The cronjob spec.
spec:
schedule: {{ .Values.schedule }}
concurrencyPolicy: Forbid
startingDeadlineSeconds: 3600
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
# The job spec
spec:
backoffLimit: 1
# The pod template.
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 14 }}
{{- end }}
labels:
{{- include "rust-synapse-compress-state.selectorLabels" . | nindent 14 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 14 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 14 }}
restartPolicy: Never
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 18 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 18 }}
command:
- /usr/local/bin/synapse_auto_compressor
args:
- -p
- "$(POSTGRES_CONNECTION_STRING)"
- -c
- {{ .Values.chunkSize | quote }}
- -n
- {{ .Values.numChunks | quote }}
env:
- name: POSTGRES_CONNECTION_STRING
valueFrom:
secretKeyRef:
name: {{ include "rust-synapse-compress-state.fullname" . }}
key: postgres-connection-string
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 14 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 14 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 14 }}
{{- end }}

View file

@ -0,0 +1,9 @@
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "rust-synapse-compress-state.fullname" . }}
labels:
{{- include "rust-synapse-compress-state.labels" . | nindent 4 }}
stringData:
postgres-connection-string: {{ .Values.postgresConnectionString }}

View file

@ -0,0 +1,48 @@
---
image:
repository: git.a09.uk/alex/rust-synapse-compress-state
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
schedule: "5 4 * * *"
postgresConnectionString: ""
chunkSize: "500"
chunkCount: "100"