Skip to content

Commit dbdab0c

Browse files
authored
Merge pull request #41 from adhoc-dev/ta-49041
T-49041
2 parents 1128f6d + a8f12b0 commit dbdab0c

11 files changed

+63
-16
lines changed

charts/adhoc-odoo/v0.2.9/questions.yml

+18-11
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,21 @@ questions:
504504
type: "string"
505505
required: true
506506
default: "Unknown"
507-
507+
- variable: adhoc.dnsBannedHost
508+
group: "Adhoc"
509+
label: "no not resolve this host list"
510+
type: "listofstrings"
511+
default:
512+
- mercadolibre.com
513+
- mercadolibre.com.ar
514+
- mercadolibre.com.uy
515+
- mercadolibre.cl
516+
- mercadolibre.com.mx
517+
- api.pagos360.com
518+
- apis.andreani.com
519+
- api.mercadopago.com
520+
- stripe.api.odoo.com
521+
required: False
508522
# Cloud Native Postgres
509523
- variable: cloudNativePG.enabled
510524
group: "CloudNativePG"
@@ -531,17 +545,10 @@ questions:
531545
- variable: cloudNativePG.persistence.size
532546
group: "CloudNativePG"
533547
label: "Disk size"
534-
description: "size of pg disk"
535-
type: enum
548+
description: "size of pg disk (GB)"
549+
type: "int"
536550
required: false
537-
default: 5Gi
538-
options:
539-
- 1Gi
540-
- 5Gi
541-
- 10Gi
542-
- 20Gi
543-
- 50Gi
544-
- 100Gi
551+
default: 5
545552
show_if: "cloudNativePG.enabled=true"
546553
- variable: cloudNativePG.superUserPassword
547554
group: "CloudNativePG"

charts/adhoc-odoo/v0.2.9/templates/cnpg_pg.yaml charts/adhoc-odoo/v0.2.9/templates/cnpg/pgcluster.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ spec:
4646
topologyKey: kubernetes.io/hostname # Default value
4747
podAntiAffinityType: preferred # Default value
4848
storage:
49-
size: {{ .Values.cloudNativePG.persistence.size }}
49+
size: {{ .Values.cloudNativePG.persistence.size }}Gi
5050
{{- if .Values.cloudNativePG.persistence.storageClass }}
5151
storageClass: {{ .Values.cloudNativePG.persistence.storageClass }}
5252
{{- end }}
5353
{{/* Used to Separate WAL into a diferent volume */}}
5454
{{ if .Values.cloudNativePG.persistence.separateWAL }}
5555
walStorage:
5656
{{/* TODO: This need to be calculated considerating retention and backups frecuency */}}
57-
size: {{ .Values.cloudNativePG.persistence.size }}
57+
size: {{ .Values.cloudNativePG.persistence.size }}Gi
5858
{{- if .Values.cloudNativePG.persistence.storageClass }}
5959
storageClass: {{ .Values.cloudNativePG.persistence.storageClass }}
6060
{{- end }}

charts/adhoc-odoo/v0.2.9/templates/deployment.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,17 @@ spec:
9999
volumeMounts:
100100
{{- if eq .Values.storage.location "fuse" }}
101101
- name: gcs-fuse-csi-ephemeral
102+
readOnly: false
102103
{{- if .Values.cloudNativePG.enabled }}
103104
mountPath: /home/odoo/data/filestore/odoo
104105
{{- else }}
105106
mountPath: /home/odoo/data/filestore/{{ .Release.Name }}
106107
{{- end }}
107-
readOnly: false
108+
{{- end }}
109+
{{- if and .Values.adhoc.dnsBannedHost ( ne .Values.adhoc.appType "prod" ) }}
110+
- name: hosts
111+
mountPath: /etc/hosts
112+
subPath: hosts
108113
{{- end }}
109114
affinity:
110115
podAntiAffinity:
@@ -162,8 +167,13 @@ spec:
162167
{{- with .Values.nodeSelector }}
163168
{{- toYaml . | nindent 8 }}
164169
{{- end }}
165-
{{- if eq .Values.storage.location "fuse" }}
166170
volumes:
171+
{{- if and .Values.adhoc.dnsBannedHost ( ne .Values.adhoc.appType "prod" ) }}
172+
- name: hosts
173+
configMap:
174+
name: {{ include "adhoc-odoo.fullname" . }}-hosts
175+
{{- end }}
176+
{{- if eq .Values.storage.location "fuse" }}
167177
- name: gcs-fuse-csi-ephemeral
168178
csi:
169179
driver: gcsfuse.csi.storage.gke.io
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- if and .Values.adhoc.dnsBannedHost ( ne .Values.adhoc.appType "prod" ) }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "adhoc-odoo.fullname" . }}-hosts
6+
labels:
7+
{{- include "adhoc-odoo.labels" . | nindent 4 }}
8+
data:
9+
hosts: |
10+
# Kubernetes-managed hosts file.
11+
127.0.0.1 localhost
12+
::1 localhost ip6-localhost ip6-loopback
13+
fe00::0 ip6-localnet
14+
fe00::0 ip6-mcastprefix
15+
fe00::1 ip6-allnodes
16+
fe00::2 ip6-allrouters
17+
{{- range .Values.adhoc.dnsBannedHost }}
18+
127.0.0.1 {{ . }}
19+
{{- end }}
20+
{{- end }}

charts/adhoc-odoo/v0.2.9/values.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ adhoc:
177177
appType: prod
178178
clientAnalyticAccount: "Unknown"
179179
devMode: false
180+
dnsBannedHost:
181+
- mercadolibre.com
182+
- mercadolibre.com.ar
183+
- mercadolibre.com.uy
184+
- mercadolibre.cl
185+
- mercadolibre.com.mx
186+
- api.pagos360.com
187+
- apis.andreani.com
188+
- api.mercadopago.com
189+
- stripe.api.odoo.com
180190

181191
cloudNativePG:
182192
checkCRD: false
@@ -192,7 +202,7 @@ cloudNativePG:
192202
memory: 5000Mi
193203
instances: 1
194204
persistence:
195-
size: 10Gi
205+
size: 10
196206
separateWAL: false
197207
# options are:
198208
# - gcp-ssd-r (to create as retain )

0 commit comments

Comments
 (0)