refactor: remove namespace and configmap from Helm chart

Namespace and ConfigMap are managed manually (not by Helm).
This commit is contained in:
ZhenYi 2026-04-15 10:30:02 +08:00
parent fd724ca4ae
commit 650243510c
4 changed files with 0 additions and 104 deletions

View File

@ -102,7 +102,6 @@ steps:
helm upgrade --install gitdata deploy/ \
--namespace gitdataai \
-f deploy/values.yaml \
-f deploy/secrets.yaml \
--set image.registry=${REGISTRY} \
--set app.image.tag=${TAG} \
--set gitserver.image.tag=${TAG} \

View File

@ -1,51 +0,0 @@
{{- /* Application configuration - non-sensitive values */ -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "gitdata.fullname" . }}-config
namespace: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
data:
APP_NAME: {{ .Values.app.name | default "gitdata" | quote }}
APP_VERSION: {{ .Chart.AppVersion | quote }}
APP_STATIC_DOMAIN: {{ .Values.config.staticDomain | default "" | quote }}
APP_MEDIA_DOMAIN: {{ .Values.config.mediaDomain | default "" | quote }}
APP_GIT_HTTP_DOMAIN: {{ .Values.config.gitHttpDomain | default "" | quote }}
APP_AVATAR_PATH: {{ .Values.config.avatarPath | default "/data/avatar" | quote }}
APP_REPOS_ROOT: {{ .Values.config.reposRoot | default "/data/repos" | quote }}
APP_LOG_LEVEL: {{ .Values.config.logLevel | default "info" | quote }}
APP_LOG_FORMAT: {{ .Values.config.logFormat | default "json" | quote }}
APP_LOG_FILE_ENABLED: {{ .Values.config.logFileEnabled | default "false" | quote }}
APP_LOG_FILE_PATH: {{ .Values.config.logFilePath | default "/var/log/gitdata/app.log" | quote }}
APP_LOG_FILE_ROTATION: {{ .Values.config.logFileRotation | default "daily" | quote }}
APP_LOG_FILE_MAX_FILES: {{ .Values.config.logFileMaxFiles | default "7" | quote }}
APP_LOG_FILE_MAX_SIZE: {{ .Values.config.logFileMaxSize | default "100" | quote }}
APP_OTEL_ENABLED: {{ .Values.config.otelEnabled | default "false" | quote }}
APP_OTEL_ENDPOINT: {{ .Values.config.otelEndpoint | default "" | quote }}
APP_OTEL_SERVICE_NAME: {{ .Values.config.otelServiceName | default "gitdata" | quote }}
APP_OTEL_SERVICE_VERSION: {{ .Chart.AppVersion | quote }}
APP_DATABASE_MAX_CONNECTIONS: {{ .Values.config.databaseMaxConnections | default "100" | quote }}
APP_DATABASE_MIN_CONNECTIONS: {{ .Values.config.databaseMinConnections | default "5" | quote }}
APP_DATABASE_IDLE_TIMEOUT: {{ .Values.config.databaseIdleTimeout | default "600" | quote }}
APP_DATABASE_MAX_LIFETIME: {{ .Values.config.databaseMaxLifetime | default "3600" | quote }}
APP_DATABASE_CONNECTION_TIMEOUT: {{ .Values.config.databaseConnectionTimeout | default "30" | quote }}
APP_DATABASE_SCHEMA_SEARCH_PATH: {{ .Values.config.databaseSchemaSearchPath | default "public" | quote }}
APP_DATABASE_HEALTH_CHECK_INTERVAL: {{ .Values.config.databaseHealthCheckInterval | default "30" | quote }}
APP_DATABASE_RETRY_ATTEMPTS: {{ .Values.config.databaseRetryAttempts | default "3" | quote }}
APP_DATABASE_RETRY_DELAY: {{ .Values.config.databaseRetryDelay | default "1" | quote }}
APP_REDIS_POOL_SIZE: {{ .Values.config.redisPoolSize | default "16" | quote }}
APP_REDIS_CONNECT_TIMEOUT: {{ .Values.config.redisConnectTimeout | default "5" | quote }}
APP_REDIS_ACQUIRE_TIMEOUT: {{ .Values.config.redisAcquireTimeout | default "1" | quote }}
HOOK_POOL_MAX_CONCURRENT: {{ .Values.config.hookPoolMaxConcurrent | default "100" | quote }}
HOOK_POOL_CPU_THRESHOLD: {{ .Values.config.hookPoolCpuThreshold | default "80" | quote }}
HOOK_POOL_REDIS_LIST_PREFIX: {{ .Values.config.hookPoolRedisListPrefix | default "{hook}" | quote }}
HOOK_POOL_REDIS_LOG_CHANNEL: {{ .Values.config.hookPoolRedisLogChannel | default "hook:logs" | quote }}
HOOK_POOL_REDIS_BLOCK_TIMEOUT: {{ .Values.config.hookPoolRedisBlockTimeout | default "5" | quote }}
HOOK_POOL_REDIS_MAX_RETRIES: {{ .Values.config.hookPoolRedisMaxRetries | default "3" | quote }}
APP_SMTP_PORT: {{ .Values.config.smtpPort | default "587" | quote }}
APP_SMTP_TLS: {{ .Values.config.smtpTls | default "true" | quote }}
APP_SMTP_TIMEOUT: {{ .Values.config.smtpTimeout | default "30" | quote }}
APP_SSH_PORT: {{ .Values.config.sshPort | default "22" | quote }}

View File

@ -1,42 +0,0 @@
{{- if .Values.migrate.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "gitdata.fullname" . }}-migrate
namespace: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-migrate
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-delete-policy: before-hook-creation
spec:
backoffLimit: {{ .Values.migrate.backoffLimit }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-migrate
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
restartPolicy: OnFailure
containers:
- name: migrate
image: "{{ .Values.image.registry }}/{{ .Values.migrate.image.repository }}:{{ .Values.migrate.image.tag }}"
imagePullPolicy: {{ .Values.migrate.image.pullPolicy | default .Values.image.pullPolicy }}
command:
{{- if .Values.migrate.command }}
- {{ .Values.migrate.command }}
{{- else }}
- up
{{- end }}
env:
- name: APP_DATABASE_URL
valueFrom:
configMapKeyRef:
name: {{ include "gitdata.fullname" . }}-config
key: APP_DATABASE_URL
{{- range .Values.migrate.env }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}

View File

@ -1,10 +0,0 @@
{{- /* Unified namespace declaration */ -}}
apiVersion: v1
kind: Namespace
metadata:
name: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
helm.sh/resource-policy: keep