Skip to content

Commit 41f61bc

Browse files
committed
feat: dev multi env
1 parent 9424934 commit 41f61bc

4 files changed

Lines changed: 57 additions & 17 deletions

File tree

helm/mapas/Chart.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: mapas
33
description: Helm chart for Mapas Culturais - a platform for cultural mapping
44
type: application
5-
version: 1.0.3
5+
version: 1.0.4
66
appVersion: "7.7.5"
77

88
keywords:
@@ -43,4 +43,5 @@ dependencies:
4343
version: "2.2.1"
4444
repository: https://groundhog2k.github.io/helm-charts/
4545
alias: redis-sessions
46-
condition: redis-sessions.enabled
46+
condition: redis-sessions.enabled
47+

helm/mapas/templates/_helpers.tpl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@ Create a default fully qualified app name.
2121
{{- end }}
2222
{{- end }}
2323

24+
{{/*
25+
Return ingress hostname based on namespace
26+
Uses mapas.ingress.host as base domain (e.g., mapas.tec.br)
27+
*/}}
28+
{{- define "mapas.ingress.host" -}}
29+
{{- if .Values.ingress.hosts }}
30+
{{- range .Values.ingress.hosts }}
31+
{{- if .host }}
32+
{{- /* Use explicit host if defined */}}
33+
{{- .host }}
34+
{{- end }}
35+
{{- end }}
36+
{{- else }}
37+
{{- /* Fallback: dynamic host based on namespace */}}
38+
{{- $baseDomain := .Values.ingress.baseDomain | default "mapas.tec.br" }}
39+
{{- $subdomain := .Release.Namespace }}
40+
{{- printf "%s.%s" $subdomain $baseDomain }}
41+
{{- end }}
42+
{{- end }}
43+
2444
{{/*
2545
Create chart name and version as used by the chart label.
2646
*/}}

helm/mapas/templates/ingress.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ spec:
2424
{{- end }}
2525
{{- end }}
2626
rules:
27+
{{- if .Values.ingress.hosts }}
2728
{{- range .Values.ingress.hosts }}
2829
- host: {{ .host | quote }}
2930
http:
@@ -38,4 +39,16 @@ spec:
3839
number: {{ $.Values.service.port }}
3940
{{- end }}
4041
{{- end }}
42+
{{- else }}
43+
- host: {{ include "mapas.ingress.host" . | quote }}
44+
http:
45+
paths:
46+
- path: /
47+
pathType: Prefix
48+
backend:
49+
service:
50+
name: {{ include "mapas.fullname" . }}
51+
port:
52+
number: {{ .Values.service.port }}
53+
{{- end }}
4154
{{- end }}

helm/mapas/values-dev.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,30 @@ mapas:
2020
appDebug: "true"
2121

2222
database:
23-
host: "" # uses internal postgresql subchart
23+
host: "" # uses internal postgresql subchart
2424
port: 5432
2525
name: mapas
2626
user: mapas
2727
password: ""
2828

2929
mailer:
30-
transport: "smtp://mailhog:1025"
31-
from: "noreply@mapas.local"
30+
transport: "smtp://naoresponda%40cultura.org.br:%5DOwjq%2A4%25cjHJqLD9%40mail.cultura.org.br:465"
31+
from: "não responda<naoresponda@cultura.org.br>"
32+
33+
recaptcha:
34+
siteKey: "6LfU2CEqAAAAACrGVDj6Vw3GF16RbBap1uTUG2aE"
35+
secret: "6LfU2CEqAAAAAApmAVs3ZDHmCIgdaYEgFanKxNDl"
3236

3337
buildAssets: "0"
3438
pendingPcacheRecreationInterval: "60"
3539
jobsInterval: "60"
3640
numProcesses: "2"
3741
mcUpdatesProcesses: "4"
42+
redirectNotFoundAssetsTo: ""
43+
44+
extraEnv:
45+
- name: MAPAS_HTTPS
46+
value: "true"
3847

3948
postgresql:
4049
enabled: true
@@ -44,7 +53,7 @@ postgresql:
4453
userDatabase:
4554
name: mapas
4655
storage:
47-
requestedSize: 5Gi
56+
requestedSize: 1Gi
4857

4958
redis-cache:
5059
enabled: true
@@ -64,23 +73,20 @@ redis-sessions:
6473
persistence:
6574
assets:
6675
enabled: true
67-
size: 5Gi
76+
size: 1Gi
6877
publicFiles:
6978
enabled: true
70-
size: 10Gi
79+
size: 1Gi
7180
privateFiles:
7281
enabled: true
73-
size: 5Gi
82+
size: 1Gi
7483
varFiles:
7584
enabled: true
76-
size: 2Gi
85+
size: 1Gi
7786

7887
ingress:
7988
enabled: true
80-
className: "nginx"
81-
hosts:
82-
- host: dev.mapas.local
83-
paths:
84-
- path: /
85-
pathType: Prefix
86-
tls: []
89+
className: traefik
90+
baseDomain: "mapas.tec.br"
91+
annotations:
92+
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure

0 commit comments

Comments
 (0)