fix: resolve critical deployment issues across Helm charts, Dockerfile, and K8s fallback

- Add helm/kubectl binaries and chart directory to backend Dockerfile
- Extend Helm templates for MongoDB/MariaDB database support (env vars, probes, ports)
- Add Redis and RabbitMQ Helm templates (deployment, service, secret, PVC)
- Add generic app-storage PVC and Fluent Bit sidecar with ES authentication
- Fix imagePullSecrets in K8s API fallback, prevent secret regeneration on redeploy
- Clean up Redis/RabbitMQ/FluentBit resources on app deletion without removing shared secrets
- Fix HelmService chartPath resolution for production Docker builds

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-13 19:16:07 +03:30
parent 38748b0827
commit 9937ee457d
11 changed files with 665 additions and 55 deletions
@@ -44,6 +44,37 @@ spec:
secretKeyRef:
name: {{ $name }}-db-secret
key: password
{{- else if eq .Values.database.type "mariadb" }}
- name: MARIADB_DATABASE
value: {{ include "cloudhost-app.dbName" . }}
- name: MARIADB_USER
valueFrom:
secretKeyRef:
name: {{ $name }}-db-secret
key: username
- name: MARIADB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ $name }}-db-secret
key: password
- name: MARIADB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ $name }}-db-secret
key: password
{{- else if eq .Values.database.type "mongodb" }}
- name: MONGO_INITDB_DATABASE
value: {{ include "cloudhost-app.dbName" . }}
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: {{ $name }}-db-secret
key: username
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ $name }}-db-secret
key: password
{{- else }}
- name: MYSQL_DATABASE
value: {{ include "cloudhost-app.dbName" . }}
@@ -77,6 +108,12 @@ spec:
{{- if eq .Values.database.type "postgresql" }}
exec:
command: ["pg_isready", "-U", {{ .Values.database.username | quote }}]
{{- else if eq .Values.database.type "mariadb" }}
exec:
command: ["healthcheck.sh", "--connect", "--innodb_initialized"]
{{- else if eq .Values.database.type "mongodb" }}
exec:
command: ["mongosh", "--eval", "db.adminCommand('ping')"]
{{- else }}
exec:
command: ["mysqladmin", "ping", "-h", "127.0.0.1"]
@@ -88,6 +125,12 @@ spec:
{{- if eq .Values.database.type "postgresql" }}
exec:
command: ["pg_isready", "-U", {{ .Values.database.username | quote }}]
{{- else if eq .Values.database.type "mariadb" }}
exec:
command: ["healthcheck.sh", "--connect", "--innodb_initialized"]
{{- else if eq .Values.database.type "mongodb" }}
exec:
command: ["mongosh", "--eval", "db.adminCommand('ping')"]
{{- else }}
exec:
command: ["mysqladmin", "ping", "-h", "127.0.0.1"]