Move ClickHouse credentials to K8s Secret and add health probes
All checks were successful
CI / build (push) Successful in 41s
CI / docker (push) Successful in 13s
CI / deploy (push) Successful in 38s

- ClickHouse user/password now injected via `clickhouse-credentials` Secret
  instead of hardcoded plaintext in deploy manifests (#33)
- CI deploy step creates the secret idempotently from Gitea CI secrets
- Added liveness/readiness probes: server uses /api/v1/health, ClickHouse
  uses /ping (#35)
- Updated HOWTO.md and CLAUDE.md with new secrets and probe details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-13 10:59:15 +01:00
parent d229365eaf
commit 9c2391e5d4
5 changed files with 59 additions and 6 deletions

View File

@@ -24,9 +24,15 @@ spec:
name: native
env:
- name: CLICKHOUSE_USER
value: cameleer
valueFrom:
secretKeyRef:
name: clickhouse-credentials
key: CLICKHOUSE_USER
- name: CLICKHOUSE_PASSWORD
value: cameleer_dev
valueFrom:
secretKeyRef:
name: clickhouse-credentials
key: CLICKHOUSE_PASSWORD
- name: CLICKHOUSE_DB
value: cameleer3
volumeMounts:
@@ -39,6 +45,22 @@ spec:
limits:
memory: "2Gi"
cpu: "1000m"
livenessProbe:
httpGet:
path: /ping
port: 8123
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
httpGet:
path: /ping
port: 8123
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
volumeClaimTemplates:
- metadata:
name: data

View File

@@ -24,9 +24,15 @@ spec:
- name: SPRING_DATASOURCE_URL
value: "jdbc:ch://clickhouse:8123/cameleer3"
- name: SPRING_DATASOURCE_USERNAME
value: "cameleer"
valueFrom:
secretKeyRef:
name: clickhouse-credentials
key: CLICKHOUSE_USER
- name: SPRING_DATASOURCE_PASSWORD
value: "cameleer_dev"
valueFrom:
secretKeyRef:
name: clickhouse-credentials
key: CLICKHOUSE_PASSWORD
- name: CAMELEER_AUTH_TOKEN
valueFrom:
secretKeyRef:
@@ -39,6 +45,22 @@ spec:
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /api/v1/health
port: 8081
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
httpGet:
path: /api/v1/health
port: 8081
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
---
apiVersion: v1
kind: Service