ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Canceled after 5m11s
ci / test (pull_request) Canceled after 5m11s
ci / build (pull_request) Canceled after 0s
ci / image (pull_request) Canceled after 0s
deploy/helm/uptimesebi runs the console and API (Deployment, Service, PodDisruptionBudget, Ingress) and optionally an in-cluster checker and status page servers. PostgreSQL and Redis are your own: by URL, from an existing secret, or Redis through Sentinel; Redis is not bundled. For trying it out, a single TimescaleDB can be bundled; its volume and password survive an uninstall and are picked up again by a reinstall. Migrations run as a pre-install/pre-upgrade hook with its own short-lived copy of the secrets; with the bundled database, which does not exist before the install, as an init container (runs serialize on the migration lock). Pods run as 65532 with a read-only root filesystem, no capabilities and RuntimeDefault seccomp; checkers get the safe ping sysctl. Missing settings fail rendering with a message. CI lints and renders the chart in several configurations; releases package it with the release version, sign it with the checksums and push it to the Gitea Helm registry. Closes #35 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
115 lines
3.3 KiB
YAML
115 lines
3.3 KiB
YAML
{{- if .Values.database.bundled.enabled }}
|
|
{{- $name := printf "%s-db" (include "uptimesebi.fullname" .) }}
|
|
{{- $existing := lookup "v1" "Secret" .Release.Namespace $name }}
|
|
{{- $password := .Values.database.bundled.password }}
|
|
{{- if and (not $password) $existing }}{{ $password = index $existing.data "password" | b64dec }}{{ end }}
|
|
{{- if not $password }}{{ $password = randAlphaNum 32 }}{{ end }}
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ $name }}
|
|
labels:
|
|
{{- include "uptimesebi.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: db
|
|
annotations:
|
|
# Uninstalling keeps the password, which the kept volume still needs.
|
|
helm.sh/resource-policy: keep
|
|
type: Opaque
|
|
stringData:
|
|
password: {{ $password | quote }}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ $name }}
|
|
labels:
|
|
{{- include "uptimesebi.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: db
|
|
spec:
|
|
clusterIP: None
|
|
selector:
|
|
{{- include "uptimesebi.selector" (list . "db") | nindent 4 }}
|
|
ports:
|
|
- name: postgres
|
|
port: 5432
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: {{ $name }}
|
|
labels:
|
|
{{- include "uptimesebi.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: db
|
|
spec:
|
|
serviceName: {{ $name }}
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
{{- include "uptimesebi.selector" (list . "db") | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "uptimesebi.selector" (list . "db") | nindent 8 }}
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 70
|
|
runAsGroup: 70
|
|
fsGroup: 70
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: timescaledb
|
|
image: {{ printf "%s:%s" .Values.database.bundled.image.repository .Values.database.bundled.image.tag }}
|
|
env:
|
|
- name: POSTGRES_USER
|
|
value: uptime
|
|
- name: POSTGRES_DB
|
|
value: uptime
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ $name }}
|
|
key: password
|
|
- name: PGDATA
|
|
value: /var/lib/postgresql/data/pgdata
|
|
ports:
|
|
- name: postgres
|
|
containerPort: 5432
|
|
readinessProbe:
|
|
exec:
|
|
command: [pg_isready, -U, uptime, -d, uptime]
|
|
periodSeconds: 5
|
|
livenessProbe:
|
|
exec:
|
|
command: [pg_isready, -U, uptime, -d, uptime]
|
|
periodSeconds: 20
|
|
failureThreshold: 6
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop: [ALL]
|
|
resources:
|
|
{{- toYaml .Values.database.bundled.resources | nindent 12 }}
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /var/lib/postgresql/data
|
|
- name: run
|
|
mountPath: /var/run/postgresql
|
|
volumes:
|
|
- name: run
|
|
emptyDir: {}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
spec:
|
|
accessModes: [ReadWriteOnce]
|
|
{{- with .Values.database.bundled.persistence.storageClass }}
|
|
storageClassName: {{ . }}
|
|
{{- end }}
|
|
resources:
|
|
requests:
|
|
storage: {{ .Values.database.bundled.persistence.size }}
|
|
{{- end }}
|