From c3a39973cf567543f11626f9cee0bfeef82ca882 Mon Sep 17 00:00:00 2001 From: "Ruben L. Mendoza" Date: Thu, 18 Jul 2024 01:15:17 -0500 Subject: [PATCH] Increase ingress timeout for web api and db api configmap (#336) * Update values for ingress * Add config for postgres configmap * Update comment for postgresqlConfig * Remove LOG_STATEMENT from db env vars --- osm-seed/templates/db/db-mapconfig.yaml | 14 +++++++++++ osm-seed/templates/db/db-statefulset.yaml | 19 +++++++++++--- osm-seed/templates/web/web-ingress.yaml | 8 +++--- osm-seed/values.yaml | 30 +++++++++++++++++++---- 4 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 osm-seed/templates/db/db-mapconfig.yaml diff --git a/osm-seed/templates/db/db-mapconfig.yaml b/osm-seed/templates/db/db-mapconfig.yaml new file mode 100644 index 00000000..9f5daff1 --- /dev/null +++ b/osm-seed/templates/db/db-mapconfig.yaml @@ -0,0 +1,14 @@ +{{- if .Values.db.enabled -}} +{{- if .Values.db.postgresqlConfig.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-db-postgresql-config + labels: + app: {{ template "osm-seed.name" . }} + release: {{ .Release.Name }} +data: + postgresql.conf: | +{{ .Values.db.postgresqlConfig.values | indent 4 }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/osm-seed/templates/db/db-statefulset.yaml b/osm-seed/templates/db/db-statefulset.yaml index 5320f969..5b4fbe4b 100644 --- a/osm-seed/templates/db/db-statefulset.yaml +++ b/osm-seed/templates/db/db-statefulset.yaml @@ -49,8 +49,12 @@ spec: value: {{ .Values.db.persistenceDisk.mountPath }} - name: POD_IP valueFrom: { fieldRef: { fieldPath: status.podIP } } - - name: LOG_STATEMENT - value: {{ default "none" .Values.db.env.LOG_STATEMENT | quote }} + {{- if .Values.db.postgresqlConfig.enabled }} + command: + - "sh" + - "-c" + - "su postgres -c 'postgres -c config_file=/etc/postgresql/postgresql.conf'" + {{- end }} livenessProbe: exec: command: @@ -71,10 +75,14 @@ spec: periodSeconds: 5 volumeMounts: - name: postgres-storage - mountPath: {{ .Values.db.persistenceDisk.mountPath }} + mountPath: /var/lib/postgresql/data subPath: {{ .Values.db.persistenceDisk.subPath }} - name: shared-memory mountPath: /dev/shm + {{- if .Values.db.postgresqlConfig.enabled }} + - name: db-postgresql-config + mountPath: /etc/postgresql/ + {{- end }} {{- if .Values.db.resources.enabled }} resources: requests: @@ -96,6 +104,11 @@ spec: emptyDir: medium: Memory sizeLimit: {{ .Values.db.sharedMemorySize }} + {{- if .Values.db.postgresqlConfig.enabled }} + - name: db-postgresql-config + configMap: + name: {{ .Release.Name }}-db-postgresql-config + {{- end }} {{- if .Values.db.nodeSelector.enabled }} nodeSelector: {{ .Values.db.nodeSelector.label_key }} : {{ .Values.db.nodeSelector.label_value }} diff --git a/osm-seed/templates/web/web-ingress.yaml b/osm-seed/templates/web/web-ingress.yaml index 8b4067af..e45cf645 100644 --- a/osm-seed/templates/web/web-ingress.yaml +++ b/osm-seed/templates/web/web-ingress.yaml @@ -6,10 +6,10 @@ metadata: annotations: kubernetes.io/ingress.class: nginx cert-manager.io/cluster-issuer: letsencrypt-prod-issuer - nginx.ingress.kubernetes.io/proxy-body-size: 100m - nginx.ingress.kubernetes.io/proxy-connect-timeout: "600" - nginx.ingress.kubernetes.io/proxy-read-timeout: "600" - nginx.ingress.kubernetes.io/proxy-send-timeout: "600" + nginx.ingress.kubernetes.io/proxy-body-size: 200m + nginx.ingress.kubernetes.io/proxy-connect-timeout: "1200" + nginx.ingress.kubernetes.io/proxy-read-timeout: "1200" + nginx.ingress.kubernetes.io/proxy-send-timeout: "1200" spec: ingressClassName: nginx tls: diff --git a/osm-seed/values.yaml b/osm-seed/values.yaml index 63637377..d7e303b6 100644 --- a/osm-seed/values.yaml +++ b/osm-seed/values.yaml @@ -76,7 +76,6 @@ db: POSTGRES_USER: postgres POSTGRES_PASSWORD: "1234" ENVIRONMENT: "production" - LOG_STATEMENT: "all" persistenceDisk: enabled: false mountPath: /var/lib/postgresql/data @@ -85,8 +84,8 @@ db: localVolumeHostPath: /mnt/db-data localVolumeSize: 10Gi # AWS - AWS_ElasticBlockStore_volumeID: vol-1234bcd - AWS_ElasticBlockStore_size: 500Gi + AWS_ElasticBlockStore_volumeID: vol-06a278f66b15d4b3c + AWS_ElasticBlockStore_size: 50Gi # GCP GCP_gcePersistentDisk_pdName: osmseed-disk-db-v1 GCP_gcePersistentDisk_size: 50Gi @@ -105,11 +104,32 @@ db: nodeSelector: enabled: false sharedMemorySize: 64Mi + # To use postgresqlConfig, you need to have already $PGDATA set up + postgresqlConfig: + enabled: false + values: | + listen_addresses = '*' + max_connections = 100 + shared_buffers = 128MB + effective_cache_size = 256MB + maintenance_work_mem = 64MB + checkpoint_completion_target = 0.7 + wal_buffers = 16MB + default_statistics_target = 100 + random_page_cost = 1.1 + effective_io_concurrency = 200 + work_mem = 4MB + min_wal_size = 80MB + max_wal_size = 1GB + max_worker_processes = 4 + max_parallel_workers_per_gather = 2 + max_parallel_workers = 4 + # ==================================================================================================== # Variables for osm-seed website # ==================================================================================================== web: - enabled: true + enabled: false image: name: "" tag: "" @@ -152,7 +172,7 @@ web: # Variables for memcached. Memcached is used to store session cookies # ==================================================================================================== memcached: - enabled: true + enabled: false nodeSelector: enabled: false label_key: nodegroup_type