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:
@@ -0,0 +1,71 @@
|
||||
{{- if .Values.elasticsearch.enabled }}
|
||||
{{- $name := include "cloudhost-app.name" . -}}
|
||||
{{- $ns := include "cloudhost-app.namespace" . -}}
|
||||
{{- $logPaths := .Values.elasticsearch.logPaths -}}
|
||||
{{- $defaultPaths := include "cloudhost-app.defaultLogPaths" . | trim -}}
|
||||
{{- $paths := ternary ($logPaths | join ",") $defaultPaths (and $logPaths (gt (len $logPaths) 0)) -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ $name }}-fluent-bit-config
|
||||
namespace: {{ $ns }}
|
||||
labels:
|
||||
{{- include "cloudhost-app.labels" . | nindent 4 }}
|
||||
data:
|
||||
fluent-bit.conf: |
|
||||
[SERVICE]
|
||||
Flush 5
|
||||
Daemon Off
|
||||
Log_Level info
|
||||
Parsers_File /fluent-bit/etc/parsers.conf
|
||||
|
||||
[INPUT]
|
||||
Name tail
|
||||
Path {{ $paths }}
|
||||
Tag app.{{ $name }}
|
||||
Refresh_Interval 5
|
||||
Mem_Buf_Limit 5MB
|
||||
Skip_Long_Lines On
|
||||
|
||||
[FILTER]
|
||||
Name record_modifier
|
||||
Match *
|
||||
Record app {{ $name }}
|
||||
Record namespace {{ $ns }}
|
||||
Record runtime {{ .Values.app.runtime }}
|
||||
|
||||
[FILTER]
|
||||
Name parser
|
||||
Match *
|
||||
Key_Name log
|
||||
Parser json
|
||||
Reserve_Data On
|
||||
Preserve_Key On
|
||||
|
||||
[OUTPUT]
|
||||
Name es
|
||||
Match *
|
||||
Host ${ES_HOST}
|
||||
Port ${ES_PORT}
|
||||
HTTP_User elastic
|
||||
HTTP_Passwd ${ES_PASSWORD}
|
||||
Index logs-{{ $ns }}-{{ $name }}
|
||||
Logstash_Format On
|
||||
Logstash_Prefix logs-{{ $ns }}
|
||||
Suppress_Type_Name On
|
||||
tls Off
|
||||
Retry_Limit 3
|
||||
|
||||
parsers.conf: |
|
||||
[PARSER]
|
||||
Name json
|
||||
Format json
|
||||
Time_Key time
|
||||
Time_Format %Y-%m-%dT%H:%M:%S.%L
|
||||
|
||||
[PARSER]
|
||||
Name docker
|
||||
Format json
|
||||
Time_Key time
|
||||
Time_Format %Y-%m-%dT%H:%M:%S.%L
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user