From 5c0c8ff8034add38cb295476084d966bcd6de877 Mon Sep 17 00:00:00 2001 From: Janne Mareike Koschinski <janne@kuschku.de> Date: Wed, 27 Dec 2023 14:05:16 +0100 Subject: [PATCH] feat: sync recent updates --- actual/Chart.yaml | 6 --- actual/templates/configmap.yaml | 16 ------- actual/templates/service.yaml | 15 ------ jellyfin/Chart.yaml | 4 +- mastodon/Chart.yaml | 4 +- ...t-tootctl.yaml => deployment-tootctl.yaml} | 12 +++-- mastodon/values.yaml | 6 +-- postgresql/Chart.yaml | 2 +- postgresql/templates/secret.yaml | 11 +---- postgresql/templates/service.yaml | 12 +++++ postgresql/templates/statefulset.yaml | 39 ++++++++++++++- postgresql/values.yaml | 9 +++- powerdns/Chart.yaml | 4 +- quassel-search/Chart.yaml | 6 +++ {actual => quassel-search}/pipeline.yml | 14 +++--- .../templates/_helpers.tpl | 18 +++---- .../templates/deployment.yaml | 48 +++++++++++-------- .../templates/ingress.yaml | 6 +-- quassel-search/templates/secret.yaml | 28 +++++++++++ quassel-search/templates/service.yaml | 15 ++++++ {actual => quassel-search}/values.yaml | 22 +++++---- 21 files changed, 184 insertions(+), 113 deletions(-) delete mode 100644 actual/Chart.yaml delete mode 100644 actual/templates/configmap.yaml delete mode 100644 actual/templates/service.yaml rename mastodon/templates/{replicaset-tootctl.yaml => deployment-tootctl.yaml} (84%) create mode 100644 quassel-search/Chart.yaml rename {actual => quassel-search}/pipeline.yml (66%) rename {actual => quassel-search}/templates/_helpers.tpl (72%) rename {actual => quassel-search}/templates/deployment.yaml (60%) rename {actual => quassel-search}/templates/ingress.yaml (68%) create mode 100644 quassel-search/templates/secret.yaml create mode 100644 quassel-search/templates/service.yaml rename {actual => quassel-search}/values.yaml (63%) diff --git a/actual/Chart.yaml b/actual/Chart.yaml deleted file mode 100644 index 76e16bc..0000000 --- a/actual/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: actual -description: Helm Chart for actual -type: application -version: 1.1.0 -appVersion: "sha-529c42c-alpine" diff --git a/actual/templates/configmap.yaml b/actual/templates/configmap.yaml deleted file mode 100644 index 1a53ff3..0000000 --- a/actual/templates/configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "actual-helm.fullname" . }} - labels: - {{- include "actual-helm.labels" . | nindent 4 }} -data: - "config.json": |- - { - "mode": "production", - "port": 8080, - "hostname": "0.0.0.0", - "serverFiles": "/data/server-files", - "userFiles": "/data/user-files", - "sync": "{{ .Values.syncMode }}" - } diff --git a/actual/templates/service.yaml b/actual/templates/service.yaml deleted file mode 100644 index 0f89c2e..0000000 --- a/actual/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "actual-helm.fullname" . }} - labels: - {{- include "actual-helm.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: 80 - targetPort: http - protocol: TCP - name: http - selector: - {{- include "actual-helm.selectorLabels" . | nindent 4 }} diff --git a/jellyfin/Chart.yaml b/jellyfin/Chart.yaml index bc1c7f9..b5acde4 100644 --- a/jellyfin/Chart.yaml +++ b/jellyfin/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: jellyfin description: Helm Chart for Jellyfin type: application -version: 1.2.0 -appVersion: "10.8.7" +version: 1.3.0 +appVersion: "10.8.10" diff --git a/mastodon/Chart.yaml b/mastodon/Chart.yaml index eb6c614..e122deb 100644 --- a/mastodon/Chart.yaml +++ b/mastodon/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: mastodon description: Helm Chart for mastodon type: application -version: 0.4.0 -appVersion: "v4.0" +version: 0.4.2 +appVersion: "v4.1" diff --git a/mastodon/templates/replicaset-tootctl.yaml b/mastodon/templates/deployment-tootctl.yaml similarity index 84% rename from mastodon/templates/replicaset-tootctl.yaml rename to mastodon/templates/deployment-tootctl.yaml index f9544bf..c839a5c 100644 --- a/mastodon/templates/replicaset-tootctl.yaml +++ b/mastodon/templates/deployment-tootctl.yaml @@ -1,21 +1,25 @@ apiVersion: apps/v1 -kind: ReplicaSet +kind: Deployment metadata: name: {{ include "mastodon-helm.fullname" . }}-tootctl labels: component: tootctl {{- include "mastodon-helm.labels" . | nindent 4 }} spec: + replicas: {{ .Values.replicaCount }} selector: matchLabels: component: tootctl - {{- include "mastodon-helm.labels" . | nindent 6 }} + {{- include "mastodon-helm.selectorLabels" . | nindent 6 }} template: metadata: - name: {{ include "mastodon-helm.fullname" . }}-tootctl + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} labels: component: tootctl - {{- include "mastodon-helm.labels" . | nindent 8 }} + {{- include "mastodon-helm.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/mastodon/values.yaml b/mastodon/values.yaml index 442bdbe..125d5ec 100644 --- a/mastodon/values.yaml +++ b/mastodon/values.yaml @@ -6,7 +6,7 @@ fullnameOverride: "" web: repository: tootsuite/mastodon - pullPolicy: IfNotPresent + pullPolicy: Always tag: "" resources: limits: @@ -18,7 +18,7 @@ web: streaming: repository: tootsuite/mastodon - pullPolicy: IfNotPresent + pullPolicy: Always tag: "" resources: limits: @@ -30,7 +30,7 @@ streaming: sidekiq: repository: tootsuite/mastodon - pullPolicy: IfNotPresent + pullPolicy: Always tag: "" resources: limits: diff --git a/postgresql/Chart.yaml b/postgresql/Chart.yaml index 65074a0..b61c383 100644 --- a/postgresql/Chart.yaml +++ b/postgresql/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: postgresql description: Helm Chart for postgresql type: application -version: 1.3.0 +version: 1.4.0 appVersion: "15" diff --git a/postgresql/templates/secret.yaml b/postgresql/templates/secret.yaml index 03682e9..12d4513 100644 --- a/postgresql/templates/secret.yaml +++ b/postgresql/templates/secret.yaml @@ -8,14 +8,5 @@ metadata: labels: {{- include "postgresql-helm.labels" . | nindent 4 }} type: Opaque -data: - {{ if empty .Values.postgresPassword }} - # retrieve the secret data using lookup function and when not exists, return an empty dictionary / map as result - {{- $secretObj := (lookup "v1" "Secret" .Release.Namespace $fullname) | default dict }} - {{- $secretData := (get $secretObj "data") | default dict }} - # set $secret to existing secret data or generate a random one when not exists - {{- $secretValue := (get $secretData $fullname) | default (randAlphaNum 48 | b64enc) }} - postgres-password: {{ $secretValue | quote }} - {{ else }} +stringData: postgres-password: "{{ .Values.postgresPassword }}" - {{ end }} diff --git a/postgresql/templates/service.yaml b/postgresql/templates/service.yaml index fd32707..cebf99c 100644 --- a/postgresql/templates/service.yaml +++ b/postgresql/templates/service.yaml @@ -2,6 +2,12 @@ apiVersion: v1 kind: Service metadata: name: {{ include "postgresql-helm.fullname" . }} + {{ if .Values.exporter.enabled }} + annotations: + prometheus.io/path: "/metrics" + prometheus.io/port: "9187" + prometheus.io/scrape: "true" + {{ end }} labels: {{- include "postgresql-helm.labels" . | nindent 4 }} spec: @@ -11,5 +17,11 @@ spec: targetPort: sql protocol: TCP name: sql + {{ if .Values.exporter.enabled }} + - port: 9187 + targetPort: metrics + protocol: TCP + name: metrics + {{ end }} selector: {{- include "postgresql-helm.selectorLabels" . | nindent 4 }} diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index 0e684ed..ff4496b 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -62,7 +62,7 @@ spec: command: - sh - -c - - exec pg_isready --host localhost + - pg_isready --host localhost && psql -c "ALTER USER postgres WITH PASSWORD '${POSTGRES_PASSWORD}';" livenessProbe: exec: command: @@ -93,6 +93,43 @@ spec: name: certs subPath: tls.key {{- end }} + {{ if .Values.exporter.enabled }} + - name: exporter + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.exporter.repository }}:{{ .Values.exporter.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: PG_EXPORTER_AUTO_DISCOVER_DATABASES + value: "true" + - name: DATA_SOURCE_URI + value: "localhost" + - name: DATA_SOURCE_USER + value: "postgres" + - name: DATA_SOURCE_PASS + valueFrom: + secretKeyRef: + key: "postgres-password" + name: {{ include "postgresql-helm.fullname" . }} + ports: + - name: metrics + containerPort: 9187 + protocol: TCP + startupProbe: + httpGet: + port: metrics + path: /metrics + livenessProbe: + httpGet: + port: metrics + path: /metrics + readinessProbe: + httpGet: + port: metrics + path: /metrics + resources: + {{- toYaml .Values.exporter.resources | nindent 12 }} + {{ end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/postgresql/values.yaml b/postgresql/values.yaml index 84b1c63..68115af 100644 --- a/postgresql/values.yaml +++ b/postgresql/values.yaml @@ -12,8 +12,7 @@ fullnameOverride: "" volume: |- emptyDir: {} -# if left empty, one will be auto-generated -postgresPassword: "" +postgresPassword: "hunter2" tls: enabled: false @@ -29,6 +28,12 @@ securityContext: runAsUser: 70 runAsGroup: 70 +exporter: + enabled: true + repository: quay.io/prometheuscommunity/postgres-exporter + tag: "v0.12.0" + resources: {} + resources: {} # limits: # cpu: 500m diff --git a/powerdns/Chart.yaml b/powerdns/Chart.yaml index 7dd77ff..a947170 100644 --- a/powerdns/Chart.yaml +++ b/powerdns/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: powerdns description: Helm Chart for powerdns-Core type: application -version: 1.0.2 -appVersion: "4.7.3" +version: 1.0.3 +appVersion: "4.7.4" diff --git a/quassel-search/Chart.yaml b/quassel-search/Chart.yaml new file mode 100644 index 0000000..1782f89 --- /dev/null +++ b/quassel-search/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: quassel-search +description: Helm Chart for quassel-search +type: application +version: 1.0.0 +appVersion: "014d624e" diff --git a/actual/pipeline.yml b/quassel-search/pipeline.yml similarity index 66% rename from actual/pipeline.yml rename to quassel-search/pipeline.yml index a245712..8703f0d 100644 --- a/actual/pipeline.yml +++ b/quassel-search/pipeline.yml @@ -1,21 +1,21 @@ -lint-actual: +lint-quassel-search: stage: lint rules: - changes: - - actual/**/* + - quassel-search/**/* script: - - helm lint actual + - helm lint quassel-search -release-actual: +release-quassel-search: stage: release needs: - - lint-actual + - lint-quassel-search rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' changes: - - actual/**/* + - quassel-search/**/* script: - apk add --no-cache git - helm plugin install https://github.com/chartmuseum/helm-push.git - helm repo add --username gitlab-ci-token --password $CI_JOB_TOKEN repo ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable - - helm cm-push actual repo + - helm cm-push quassel-search repo diff --git a/actual/templates/_helpers.tpl b/quassel-search/templates/_helpers.tpl similarity index 72% rename from actual/templates/_helpers.tpl rename to quassel-search/templates/_helpers.tpl index 65f41dc..96ce364 100644 --- a/actual/templates/_helpers.tpl +++ b/quassel-search/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "actual-helm.name" -}} +{{- define "quassel-search-helm.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ 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 "actual-helm.fullname" -}} +{{- define "quassel-search-helm.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "actual-helm.chart" -}} +{{- define "quassel-search-helm.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "actual-helm.labels" -}} -helm.sh/chart: {{ include "actual-helm.chart" . }} -{{ include "actual-helm.selectorLabels" . }} +{{- define "quassel-search-helm.labels" -}} +helm.sh/chart: {{ include "quassel-search-helm.chart" . }} +{{ include "quassel-search-helm.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,12 +45,12 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "actual-helm.selectorLabels" -}} -app.kubernetes.io/name: {{ include "actual-helm.name" . }} +{{- define "quassel-search-helm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "quassel-search-helm.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{- define "actual-helm.sslPath" -}} +{{- define "quassel-search-helm.sslPath" -}} /certs {{- end }} diff --git a/actual/templates/deployment.yaml b/quassel-search/templates/deployment.yaml similarity index 60% rename from actual/templates/deployment.yaml rename to quassel-search/templates/deployment.yaml index cd4919e..ae0ca47 100644 --- a/actual/templates/deployment.yaml +++ b/quassel-search/templates/deployment.yaml @@ -1,14 +1,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "actual-helm.fullname" . }} + name: {{ include "quassel-search-helm.fullname" . }} labels: - {{- include "actual-helm.labels" . | nindent 4 }} + {{- include "quassel-search-helm.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - {{- include "actual-helm.selectorLabels" . | nindent 6 }} + {{- include "quassel-search-helm.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -16,7 +16,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "actual-helm.selectorLabels" . | nindent 8 }} + {{- include "quassel-search-helm.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -25,11 +25,11 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} volumes: - - name: data - {{- .Values.volume | nindent 10 }} + - name: tmp + emptyDir: {} - name: config - configMap: - name: {{ include "actual-helm.fullname" . }} + secret: + secretName: {{ include "quassel-search-helm.fullname" . }} containers: - name: {{ .Chart.Name }} securityContext: @@ -41,25 +41,31 @@ spec: containerPort: 8080 protocol: TCP startupProbe: - httpGet: - path: / - port: http + exec: + command: + - curl + - "--fail" + - http://127.0.0.1:8080/fpm-ping livenessProbe: - httpGet: - path: / - port: http + exec: + command: + - curl + - "--fail" + - http://127.0.0.1:8080/fpm-ping readinessProbe: - httpGet: - path: / - port: http + exec: + command: + - curl + - "--fail" + - http://127.0.0.1:8080/fpm-ping resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: - - mountPath: "/app/config.json" + - mountPath: "/run" + name: tmp + - mountPath: "/var/www/html/qrs_config.php" name: config - subPath: "config.json" - - mountPath: "/data" - name: data + subPath: "config.php" {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/actual/templates/ingress.yaml b/quassel-search/templates/ingress.yaml similarity index 68% rename from actual/templates/ingress.yaml rename to quassel-search/templates/ingress.yaml index 5d57e50..fec0aab 100644 --- a/actual/templates/ingress.yaml +++ b/quassel-search/templates/ingress.yaml @@ -1,9 +1,9 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "actual-helm.fullname" . }} + name: {{ include "quassel-search-helm.fullname" . }} labels: - {{- include "actual-helm.labels" . | nindent 4 }} + {{- include "quassel-search-helm.labels" . | nindent 4 }} annotations: {{- .Values.ingress.annotations | toYaml | nindent 4 }} spec: @@ -14,7 +14,7 @@ spec: - path: "{{ .Values.ingress.path }}" backend: service: - name: {{ include "actual-helm.fullname" . }} + name: {{ include "quassel-search-helm.fullname" . }} port: name: http pathType: Prefix diff --git a/quassel-search/templates/secret.yaml b/quassel-search/templates/secret.yaml new file mode 100644 index 0000000..86d9fb4 --- /dev/null +++ b/quassel-search/templates/secret.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "quassel-search-helm.fullname" . }} + labels: + {{- include "quassel-search-helm.labels" . | nindent 4 }} +stringData: + "config.php": |- + <?php + define('qrs_db_host', '{{ .Values.config.postgres.hostname }}'); + define('qrs_db_port', {{ .Values.config.postgres.port }}); + define('qrs_db_name', '{{ .Values.config.postgres.database }}'); + + // Only change this if you know what you are doing + define('qrs_db_connector', null); + + define('qrs_db_user', '{{ .Values.config.postgres.username }}'); + define('qrs_db_pass', '{{ .Values.config.postgres.password }}'); + + define('qrs_db_option_tsqueryfunction', "websearchto_tsquery_multilang(:query)"); + // Timeout in milliseconds + define('qrs_db_option_timeout', 5000); + + define('qrs_backend', 'pgsql-smart'); + define('qrs_enable_ranking', false); + + define('qrs_path_prefix', '{{ .Values.ingress.path }}'); + diff --git a/quassel-search/templates/service.yaml b/quassel-search/templates/service.yaml new file mode 100644 index 0000000..7d9faec --- /dev/null +++ b/quassel-search/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "quassel-search-helm.fullname" . }} + labels: + {{- include "quassel-search-helm.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + {{- include "quassel-search-helm.selectorLabels" . | nindent 4 }} diff --git a/actual/values.yaml b/quassel-search/values.yaml similarity index 63% rename from actual/values.yaml rename to quassel-search/values.yaml index 253f364..b3f0b0c 100644 --- a/actual/values.yaml +++ b/quassel-search/values.yaml @@ -1,7 +1,7 @@ replicaCount: 1 image: - repository: jlongster/actual-server + repository: k8r.eu/justjanne/quassel-rest-search pullPolicy: IfNotPresent tag: "" @@ -9,10 +9,13 @@ imagePullSecrets: [ ] nameOverride: "" fullnameOverride: "" -syncMode: simple - -volume: |- - emptyDir: {} +config: + postgres: + hostname: "localhost" + port: 5432 + database: "quassel" + username: "quassel" + password: "hunter2" service: type: ClusterIP @@ -20,6 +23,7 @@ service: ingress: host: "example.com" path: "/" + origins: [ ] annotations: { } podAnnotations: { } @@ -36,11 +40,11 @@ securityContext: resources: limits: - cpu: 500m - memory: 512Mi + cpu: 200m + memory: 128M requests: - cpu: 10m - memory: 64Mi + cpu: 50m + memory: 64M nodeSelector: { } -- GitLab