From d32bf2d1c8b2baf2336e7f0d35b00ce3792cdb68 Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Tue, 19 Dec 2023 16:13:55 +0000 Subject: [PATCH] chore: remove PostgreSQL dependency --- charts/rollups-node/Chart.lock | 6 ----- charts/rollups-node/Chart.yaml | 6 ----- charts/rollups-node/ci/test-values.yaml.tpl | 11 +++++----- charts/rollups-node/templates/_helpers.tpl | 12 ---------- .../templates/database-secret.yaml | 16 -------------- .../templates/graphql-server-deployment.yaml | 6 ----- .../templates/indexer-deployment.yaml | 6 ----- charts/rollups-node/values.yaml | 22 ------------------- 8 files changed, 6 insertions(+), 79 deletions(-) delete mode 100644 charts/rollups-node/Chart.lock delete mode 100644 charts/rollups-node/templates/database-secret.yaml diff --git a/charts/rollups-node/Chart.lock b/charts/rollups-node/Chart.lock deleted file mode 100644 index bf43593..0000000 --- a/charts/rollups-node/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: postgresql - repository: https://charts.bitnami.com/bitnami - version: 12.1.9 -digest: sha256:becf42e73c2aac0b2200698e1aaeee1be13507db2f882e5713c91833351a94e6 -generated: "2023-12-19T17:04:03.940923863Z" diff --git a/charts/rollups-node/Chart.yaml b/charts/rollups-node/Chart.yaml index 4f00ba7..bae1e98 100644 --- a/charts/rollups-node/Chart.yaml +++ b/charts/rollups-node/Chart.yaml @@ -14,9 +14,3 @@ maintainers: type: application version: 1.2.0-0 - -dependencies: - - name: postgresql - version: 12.1.9 - repository: https://charts.bitnami.com/bitnami - condition: postgresql.enabled diff --git a/charts/rollups-node/ci/test-values.yaml.tpl b/charts/rollups-node/ci/test-values.yaml.tpl index 12458cd..25fa3b3 100644 --- a/charts/rollups-node/ci/test-values.yaml.tpl +++ b/charts/rollups-node/ci/test-values.yaml.tpl @@ -120,11 +120,12 @@ indexer: extraEnvVars: - name: "REDIS_ENDPOINT" value: "redis://redis-master" + - name: "POSTGRES_ENDPOINT" + value: "postgres://postgres:postgres@postgresql.default.svc.cluster.local:5432/postgres" +graphqlServer: + extraEnvVars: + - name: "POSTGRES_ENDPOINT" + value: "postgres://postgres:postgres@postgresql.default.svc.cluster.local:5432/postgres" image: pullPolicy: Always - -postgresql: - enabled: false - endpoint: - value: postgres://postgres:postgres@postgresql.default.svc.cluster.local:5432/postgres diff --git a/charts/rollups-node/templates/_helpers.tpl b/charts/rollups-node/templates/_helpers.tpl index 15d6b20..bdfedfd 100644 --- a/charts/rollups-node/templates/_helpers.tpl +++ b/charts/rollups-node/templates/_helpers.tpl @@ -10,18 +10,6 @@ Expand the name of the chart. {{- default (regexReplaceAll "(^.*)(-chart)$" .Chart.Name "${1}" ) .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} -{{/* -Return POSTGRES_ENDPOINT values -*/}} -{{- define "validator.postgresEndpoint" -}} -{{- if .Values.postgresql.enabled }} -{{- print "postgres://" .Values.postgresql.auth.username ":" .Values.postgresql.auth.password "@" .Release.Name "-postgresql." .Release.Namespace ":" .Values.postgresql.auth.port "/" .Values.postgresql.auth.database -}} -{{- else if not (empty .Values.postgresql.endpoint.secretRef) }} -{{- else }} -{{- print (required "A valid .Values.postgresql.endpoint.value is required when .Values.postgresql is false" .Values.postgresql.endpoint.value) -}} -{{- end }} -{{- end }} - {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). diff --git a/charts/rollups-node/templates/database-secret.yaml b/charts/rollups-node/templates/database-secret.yaml deleted file mode 100644 index c8e8422..0000000 --- a/charts/rollups-node/templates/database-secret.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- /* -(c) Cartesi and individual authors (see AUTHORS) -SPDX-License-Identifier: Apache-2.0 (see LICENSE) -*/}} - ---- -{{- if (empty .Values.postgresql.endpoint.secretRef) }} -kind: Secret -apiVersion: v1 -metadata: - name: {{ include "validator.fullname" . }}-database - labels: {{- include "validator.labels" . | nindent 4 }} -type: Opaque -data: - POSTGRES_ENDPOINT: {{ include "validator.postgresEndpoint" . | b64enc | quote }} -{{- end }} diff --git a/charts/rollups-node/templates/graphql-server-deployment.yaml b/charts/rollups-node/templates/graphql-server-deployment.yaml index c235bc9..b834e02 100644 --- a/charts/rollups-node/templates/graphql-server-deployment.yaml +++ b/charts/rollups-node/templates/graphql-server-deployment.yaml @@ -70,12 +70,6 @@ spec: - name: GRAPHQL_PORT value: "4000" envFrom: - - secretRef: - {{- if (empty .Values.postgresql.endpoint.secretRef) }} - name: {{ include "validator.fullname" . }}-database - {{- else }} - name: {{ .Values.postgresql.endpoint.secretRef }} - {{- end }} {{- if or .Values.graphqlServer.extraEnvVarsCM .Values.graphqlServer.extraEnvVarsSecret }} {{- if .Values.graphqlServer.extraEnvVarsCM }} - configMapRef: diff --git a/charts/rollups-node/templates/indexer-deployment.yaml b/charts/rollups-node/templates/indexer-deployment.yaml index 0f26e91..064490b 100644 --- a/charts/rollups-node/templates/indexer-deployment.yaml +++ b/charts/rollups-node/templates/indexer-deployment.yaml @@ -76,12 +76,6 @@ spec: {{- include "tplvalues.render" (dict "value" .Values.indexer.extraEnvVars "context" $) | nindent 12 }} {{- end }} envFrom: - - secretRef: - {{- if (empty .Values.postgresql.endpoint.secretRef) }} - name: {{ include "validator.fullname" . }}-database - {{- else }} - name: {{ .Values.postgresql.endpoint.secretRef }} - {{- end }} {{- if or .Values.indexer.extraEnvVarsCM .Values.indexer.extraEnvVarsSecret }} {{- if .Values.indexer.extraEnvVarsCM }} - configMapRef: diff --git a/charts/rollups-node/values.yaml b/charts/rollups-node/values.yaml index a65a0c7..922ed84 100644 --- a/charts/rollups-node/values.yaml +++ b/charts/rollups-node/values.yaml @@ -867,25 +867,3 @@ graphqlServer: # -- Optionally specify extra list of additional volumeMounts for the endpoints.graphqlServer container(s) extraVolumeMounts: [] - -## PostgreSQL configuration -postgresql: - # -- Use bitnami postgreSQL pod. - enabled: true - # -- Define an external Postgresql endpoint - endpoint: - # -- Connection detail like postgres://host:pass@host:port/db. - # REQUIRED if you don't have an existing secret. - value: - # -- Define an existing secret name. - # REQUIRED if you don't want to define an endpoint value. - secretRef: - # -- Set bitnami postgreSQL`username`, `password`,`database`. - auth: - username: rollups - password: rollups - database: rollups - port: 5432 - image: - # -- bitnami postgreSQL docker image tag. - tag: 13.9.0-debian-11-r27