From 9ca2aa241d4f99a7cc66621aa4488a9e9ea7b750 Mon Sep 17 00:00:00 2001 From: Jesper Svendsen Date: Mon, 21 Aug 2023 16:58:53 +0200 Subject: [PATCH 01/13] Add PgBouncer --- charts/studio/templates/_helpers.tpl | 15 ++++ .../templates/deployment-pgbouncer.yaml | 66 ++++++++++++++ .../deployment-studio-dvcx-worker.yaml | 2 +- charts/studio/templates/secret-pgbouncer.yaml | 18 ++++ charts/studio/templates/secret-studio.yaml | 10 +-- .../studio/templates/service-pgbouncer.yaml | 15 ++++ charts/studio/values.yaml | 89 +++++++++++++++++++ 7 files changed, 206 insertions(+), 9 deletions(-) create mode 100644 charts/studio/templates/deployment-pgbouncer.yaml create mode 100644 charts/studio/templates/secret-pgbouncer.yaml create mode 100644 charts/studio/templates/service-pgbouncer.yaml diff --git a/charts/studio/templates/_helpers.tpl b/charts/studio/templates/_helpers.tpl index 8c3b0d14..fc46ef46 100644 --- a/charts/studio/templates/_helpers.tpl +++ b/charts/studio/templates/_helpers.tpl @@ -88,6 +88,15 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} +{{- define "pgbouncer.labels" -}} +helm.sh/chart: {{ include "studio.chart" . }} +{{ include "pgbouncer.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + {{/* Selector labels */}} @@ -122,6 +131,12 @@ app.kubernetes.io/name: studio-worker app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{- define "pgbouncer.selectorLabels" -}} +app.kubernetes.io/name: pgbouncer +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + + {{/* Create the name of the service account to use */}} diff --git a/charts/studio/templates/deployment-pgbouncer.yaml b/charts/studio/templates/deployment-pgbouncer.yaml new file mode 100644 index 00000000..e2a3a431 --- /dev/null +++ b/charts/studio/templates/deployment-pgbouncer.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{.Release.Name}}-pgbouncer + labels: + {{- include "pgbouncer.labels" . | nindent 4 }} +spec: + {{- if not .Values.pgBouncer.autoscaling.enabled }} + replicas: {{ .Values.pgBouncer.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "pgbouncer.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + {{- include "studio.checksum" . | indent 8 }} + {{- with .Values.pgBouncer.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "pgbouncer.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ .Values.pgBouncer.serviceAccountName }} + securityContext: + {{- with .Values.pgBouncer.podSecurityContext }} + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: pgbouncer + securityContext: + {{- toYaml .Values.pgBouncer.securityContext | nindent 12 }} + image: "{{ .Values.pgBouncer.image.repository }}:{{ .Values.pgBouncer.image.tag }}" + imagePullPolicy: {{ .Values.pgBouncer.image.pullPolicy }} + resources: + {{- toYaml .Values.pgBouncer.resources | nindent 12 }} + env: + - name: PGBOUNCER_PORT + value: "6432" + envFrom: + - secretRef: + name: pgbouncer + {{- if .Values.pgBouncer.envFromSecret }} + - secretRef: + name: {{ .Values.pgBouncer.envFromSecret }} + {{- end }} + ports: + - name: pgbouncer + containerPort: 6432 + protocol: TCP + {{- with .Values.pgBouncer.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pgBouncer.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.pgBouncer.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/studio/templates/deployment-studio-dvcx-worker.yaml b/charts/studio/templates/deployment-studio-dvcx-worker.yaml index e5065abf..2804693f 100644 --- a/charts/studio/templates/deployment-studio-dvcx-worker.yaml +++ b/charts/studio/templates/deployment-studio-dvcx-worker.yaml @@ -30,7 +30,7 @@ spec: securityContext: fsGroup: 103 fsGroupChangePolicy: "OnRootMismatch" - {{- with .Values.studioWorker.podSecurityContext }} + {{- with .Values.studioDvcxWorker.podSecurityContext }} {{- toYaml . | nindent 8 }} {{- end }} containers: diff --git a/charts/studio/templates/secret-pgbouncer.yaml b/charts/studio/templates/secret-pgbouncer.yaml new file mode 100644 index 00000000..5ff693d7 --- /dev/null +++ b/charts/studio/templates/secret-pgbouncer.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Secret +metadata: + name: pgbouncer + {{ if (not (hasKey .Values "ci")) }} # Add annotation if we're not in CI execution. + annotations: + helm.sh/resource-policy: "keep" + argocd.argoproj.io/sync-options: Delete=false + {{- end }} + labels: + {{- include "studio.labels" . | nindent 4 }} +type: Opaque +stringData: + POSTGRESQL_USERNAME: {{ .Values.global.postgres.user | quote }} + POSTGRESQL_PASSWORD: {{ .Values.global.postgres.password | quote }} + POSTGRESQL_DATABASE: {{ .Values.global.postgres.databaseName | quote }} + POSTGRESQL_HOST: {{ .Values.global.postgres.host | quote }} + POSTGRESQL_PORT: {{ .Values.global.postgres.port | quote }} diff --git a/charts/studio/templates/secret-studio.yaml b/charts/studio/templates/secret-studio.yaml index 2475081a..3037196c 100644 --- a/charts/studio/templates/secret-studio.yaml +++ b/charts/studio/templates/secret-studio.yaml @@ -11,17 +11,11 @@ metadata: {{- include "studio.labels" . | nindent 4 }} type: Opaque stringData: - {{- if .Values.global.postgres.databaseUrl }} - # Deprecated configuration format. - # Will be removed in a future release - DATABASE_URL: "psql://{{ .Values.global.postgres.databaseUser}}:{{ .Values.global.postgres.databasePassword }}@{{ .Values.global.postgres.databaseUrl }}" - {{- else }} DATABASE_USER: {{ .Values.global.postgres.user | quote }} DATABASE_PASSWORD: {{ .Values.global.postgres.password | quote }} DATABASE_NAME: {{ .Values.global.postgres.databaseName | quote }} - DATABASE_HOST: {{ .Values.global.postgres.host | quote }} - DATABASE_PORT: {{ .Values.global.postgres.port | quote }} - {{- end }} + DATABASE_HOST: "pgbouncer.{{ .Release.Namespace }}.svc.cluster.local" + DATABASE_PORT: {{ .Values.pgBouncer.service.port | quote }} {{- if .Values.global.scmProviders.gitlab.clientId }} GITLAB_CLIENT_ID: {{ .Values.global.scmProviders.gitlab.clientId | quote }} diff --git a/charts/studio/templates/service-pgbouncer.yaml b/charts/studio/templates/service-pgbouncer.yaml new file mode 100644 index 00000000..4d0fdc71 --- /dev/null +++ b/charts/studio/templates/service-pgbouncer.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: pgbouncer + labels: + {{- include "pgbouncer.labels" . | nindent 4 }} +spec: + type: {{ .Values.pgBouncer.service.type }} + ports: + - port: {{ .Values.pgBouncer.service.port }} + targetPort: pgbouncer + protocol: TCP + name: pgbouncer + selector: + {{- include "pgbouncer.selectorLabels" . | nindent 4 }} diff --git a/charts/studio/values.yaml b/charts/studio/values.yaml index cc7ffcd1..d394d0b0 100644 --- a/charts/studio/values.yaml +++ b/charts/studio/values.yaml @@ -363,6 +363,95 @@ ray: minimum: 1 maximum: 4 +# -- PgBouncer settings group +pgBouncer: + # -- PgBouncer image settings + image: + # -- PgBouncer image repository + repository: docker.io/bitnami/pgbouncer + # -- PgBouncer image pull policy + pullPolicy: IfNotPresent + # -- PgBouncer image tag + tag: "1.20.1" + + service: + type: ClusterIP + port: 6432 + + # -- Additional environment variables for PgBouncer pods + envVars: {} + # Example: + # envVars: + # DEBUG: "True" + + # -- The name of an existing Secret that contains sensitive environment variables passed to DVCx + # worker pods. + envFromSecret: "" + + replicaCount: 1 + + # -- PgBouncer resources configuration + resources: + # -- PgBouncer requests configuration + requests: + cpu: 500m + memory: 512Mi + # -- PgBouncer limits configuration + limits: + cpu: 1000m + memory: 1024Mi + + # -- PgBouncer autoscaling configuration + autoscaling: + # -- PgBouncer autoscaling enabled flag + enabled: false + # -- PgBouncer autoscaling min replicas + minReplicas: 1 + # -- PgBouncer autoscaling max replicas + maxReplicas: 5 + # -- PgBouncer autoscaling target CPU utilization percentage + targetCPUUtilizationPercentage: 80 + # -- PgBouncer autoscaling target memory utilization percentage + # targetMemoryUtilizationPercentage: 80 + + # -- Additional PgBouncer pod annotations + podAnnotations: {} + + # -- PgBouncer pod security context configuration + podSecurityContext: {} + # fsGroup: 2000 + + # -- PgBouncer pod security context configuration + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + # -- PgBouncer service account name + serviceAccountName: "" + + # -- PgBouncer pod node selector configuration + nodeSelector: {} + + # -- PgBouncer pod tolerations configuration + tolerations: [] + + # -- PgBouncer pod affinity configuration + affinity: {} + +serviceAccount: + # Specifies whether a service account should be created + create: false + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + + # -- Studio UI settings group studioUi: # -- Additional environment variables for ui pods From 445689ce2957f5848dae7e7247bdb1fb61ee451f Mon Sep 17 00:00:00 2001 From: jesper7 Date: Mon, 21 Aug 2023 14:59:59 +0000 Subject: [PATCH 02/13] Helm-Docs update --- charts/studio/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/charts/studio/README.md b/charts/studio/README.md index 93afb8dd..767d282d 100644 --- a/charts/studio/README.md +++ b/charts/studio/README.md @@ -91,6 +91,28 @@ A Helm chart for Kubernetes | nginx.ingress.enabled | bool | `false` | | | nginx.serverBlock | string | see in `values.yaml` | Nginx for blobvault configuration | | nginx.service.type | string | `"ClusterIP"` | | +| pgBouncer | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/bitnami/pgbouncer","tag":"1.20.1"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"1024Mi"},"requests":{"cpu":"500m","memory":"512Mi"}},"securityContext":{},"service":{"port":6432,"type":"ClusterIP"},"serviceAccountName":"","tolerations":[]}` | PgBouncer settings group | +| pgBouncer.affinity | object | `{}` | PgBouncer pod affinity configuration | +| pgBouncer.autoscaling | object | `{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | PgBouncer autoscaling configuration | +| pgBouncer.autoscaling.enabled | bool | `false` | PgBouncer autoscaling enabled flag | +| pgBouncer.autoscaling.maxReplicas | int | `5` | PgBouncer autoscaling max replicas | +| pgBouncer.autoscaling.minReplicas | int | `1` | PgBouncer autoscaling min replicas | +| pgBouncer.autoscaling.targetCPUUtilizationPercentage | int | `80` | PgBouncer autoscaling target CPU utilization percentage | +| pgBouncer.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to DVCx worker pods. | +| pgBouncer.envVars | object | `{}` | Additional environment variables for PgBouncer pods | +| pgBouncer.image | object | `{"pullPolicy":"IfNotPresent","repository":"docker.io/bitnami/pgbouncer","tag":"1.20.1"}` | PgBouncer image settings | +| pgBouncer.image.pullPolicy | string | `"IfNotPresent"` | PgBouncer image pull policy | +| pgBouncer.image.repository | string | `"docker.io/bitnami/pgbouncer"` | PgBouncer image repository | +| pgBouncer.image.tag | string | `"1.20.1"` | PgBouncer image tag | +| pgBouncer.nodeSelector | object | `{}` | PgBouncer pod node selector configuration | +| pgBouncer.podAnnotations | object | `{}` | Additional PgBouncer pod annotations | +| pgBouncer.podSecurityContext | object | `{}` | PgBouncer pod security context configuration | +| pgBouncer.resources | object | `{"limits":{"cpu":"1000m","memory":"1024Mi"},"requests":{"cpu":"500m","memory":"512Mi"}}` | PgBouncer resources configuration | +| pgBouncer.resources.limits | object | `{"cpu":"1000m","memory":"1024Mi"}` | PgBouncer limits configuration | +| pgBouncer.resources.requests | object | `{"cpu":"500m","memory":"512Mi"}` | PgBouncer requests configuration | +| pgBouncer.securityContext | object | `{}` | PgBouncer pod security context configuration | +| pgBouncer.serviceAccountName | string | `""` | PgBouncer service account name | +| pgBouncer.tolerations | list | `[]` | PgBouncer pod tolerations configuration | | postgresql.enabled | bool | `true` | Postgres enabled | | postgresql.fullnameOverride | string | `"studio-postgresql"` | Postgres name override | | postgresql.global.postgresql.auth.database | string | `"iterativeai"` | Postgres database | @@ -112,8 +134,11 @@ A Helm chart for Kubernetes | redis.replica.persistence.enabled | bool | `false` | Redis replica persistence is disabled | | redis.replica.replicaCount | int | `0` | Redis replica count. 0 for standalone deployment of 1 master and 0 replicas | | serviceAccount.annotations | object | `{}` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `false` | | | serviceAccount.create | bool | `false` | | | serviceAccount.name | string | `""` | | +| serviceAccount.name | string | `""` | | | studioBackend | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"nameOverride":"","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":8000,"type":"ClusterIP"},"tolerations":[]}` | Studio Backend settings group | | studioBackend.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to backend pods. | | studioBackend.envVars | object | `{}` | Additional environment variables for backend pods | From 9750627667601771ca9225a942f8510a16a2f5ac Mon Sep 17 00:00:00 2001 From: Jesper Svendsen Date: Mon, 21 Aug 2023 17:10:53 +0200 Subject: [PATCH 03/13] Remove serviceAccount --- charts/studio/values.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/charts/studio/values.yaml b/charts/studio/values.yaml index d394d0b0..13aaf3fd 100644 --- a/charts/studio/values.yaml +++ b/charts/studio/values.yaml @@ -442,16 +442,6 @@ pgBouncer: # -- PgBouncer pod affinity configuration affinity: {} -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - - # -- Studio UI settings group studioUi: # -- Additional environment variables for ui pods From 6655a05053498080f3e06d36cf0e81bd2a56f239 Mon Sep 17 00:00:00 2001 From: jesper7 Date: Mon, 21 Aug 2023 15:12:11 +0000 Subject: [PATCH 04/13] Helm-Docs update --- charts/studio/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/charts/studio/README.md b/charts/studio/README.md index 767d282d..6387a93b 100644 --- a/charts/studio/README.md +++ b/charts/studio/README.md @@ -134,11 +134,8 @@ A Helm chart for Kubernetes | redis.replica.persistence.enabled | bool | `false` | Redis replica persistence is disabled | | redis.replica.replicaCount | int | `0` | Redis replica count. 0 for standalone deployment of 1 master and 0 replicas | | serviceAccount.annotations | object | `{}` | | -| serviceAccount.annotations | object | `{}` | | -| serviceAccount.create | bool | `false` | | | serviceAccount.create | bool | `false` | | | serviceAccount.name | string | `""` | | -| serviceAccount.name | string | `""` | | | studioBackend | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"docker.iterative.ai/studio-backend"},"nameOverride":"","nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}},"securityContext":{},"service":{"port":8000,"type":"ClusterIP"},"tolerations":[]}` | Studio Backend settings group | | studioBackend.envFromSecret | string | `""` | The name of an existing Secret that contains sensitive environment variables passed to backend pods. | | studioBackend.envVars | object | `{}` | Additional environment variables for backend pods | From 3e53762e423a997ce95f254042bf3f1210739599 Mon Sep 17 00:00:00 2001 From: Jesper Svendsen Date: Mon, 21 Aug 2023 18:03:34 +0200 Subject: [PATCH 05/13] Add PGBOUNCER_DATABASE --- charts/studio/templates/deployment-pgbouncer.yaml | 1 + charts/studio/templates/secret-pgbouncer.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/studio/templates/deployment-pgbouncer.yaml b/charts/studio/templates/deployment-pgbouncer.yaml index e2a3a431..86e20dba 100644 --- a/charts/studio/templates/deployment-pgbouncer.yaml +++ b/charts/studio/templates/deployment-pgbouncer.yaml @@ -14,6 +14,7 @@ spec: template: metadata: annotations: + checksum/secret-pgbouncer: {{ include (print $.Template.BasePath "/secret-pgbouncer.yaml") . | sha256sum }} {{- include "studio.checksum" . | indent 8 }} {{- with .Values.pgBouncer.podAnnotations }} {{- toYaml . | nindent 8 }} diff --git a/charts/studio/templates/secret-pgbouncer.yaml b/charts/studio/templates/secret-pgbouncer.yaml index 5ff693d7..2cfbd7d3 100644 --- a/charts/studio/templates/secret-pgbouncer.yaml +++ b/charts/studio/templates/secret-pgbouncer.yaml @@ -16,3 +16,4 @@ stringData: POSTGRESQL_DATABASE: {{ .Values.global.postgres.databaseName | quote }} POSTGRESQL_HOST: {{ .Values.global.postgres.host | quote }} POSTGRESQL_PORT: {{ .Values.global.postgres.port | quote }} + PGBOUNCER_DATABASE: {{ .Values.global.postgres.databaseName | quote }} From ba25c75d5d7d66f872be65fca826fe8f750cc0f3 Mon Sep 17 00:00:00 2001 From: Jesper Svendsen Date: Mon, 21 Aug 2023 18:16:56 +0200 Subject: [PATCH 06/13] Make pgbouncer optional --- charts/studio/templates/deployment-pgbouncer.yaml | 2 ++ charts/studio/templates/secret-pgbouncer.yaml | 2 ++ charts/studio/templates/secret-studio.yaml | 6 ++++++ charts/studio/templates/service-pgbouncer.yaml | 2 ++ charts/studio/values.yaml | 2 ++ 5 files changed, 14 insertions(+) diff --git a/charts/studio/templates/deployment-pgbouncer.yaml b/charts/studio/templates/deployment-pgbouncer.yaml index 86e20dba..11c237c7 100644 --- a/charts/studio/templates/deployment-pgbouncer.yaml +++ b/charts/studio/templates/deployment-pgbouncer.yaml @@ -1,3 +1,4 @@ +{{- if .Values.pgBouncer.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -65,3 +66,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} diff --git a/charts/studio/templates/secret-pgbouncer.yaml b/charts/studio/templates/secret-pgbouncer.yaml index 2cfbd7d3..785087bb 100644 --- a/charts/studio/templates/secret-pgbouncer.yaml +++ b/charts/studio/templates/secret-pgbouncer.yaml @@ -1,3 +1,4 @@ +{{- if .Values.pgBouncer.enabled -}} apiVersion: v1 kind: Secret metadata: @@ -17,3 +18,4 @@ stringData: POSTGRESQL_HOST: {{ .Values.global.postgres.host | quote }} POSTGRESQL_PORT: {{ .Values.global.postgres.port | quote }} PGBOUNCER_DATABASE: {{ .Values.global.postgres.databaseName | quote }} +{{- end }} \ No newline at end of file diff --git a/charts/studio/templates/secret-studio.yaml b/charts/studio/templates/secret-studio.yaml index 3037196c..40e2d4b1 100644 --- a/charts/studio/templates/secret-studio.yaml +++ b/charts/studio/templates/secret-studio.yaml @@ -14,8 +14,14 @@ stringData: DATABASE_USER: {{ .Values.global.postgres.user | quote }} DATABASE_PASSWORD: {{ .Values.global.postgres.password | quote }} DATABASE_NAME: {{ .Values.global.postgres.databaseName | quote }} + + {{- if .Values.pgBouncer.enabled -}} DATABASE_HOST: "pgbouncer.{{ .Release.Namespace }}.svc.cluster.local" DATABASE_PORT: {{ .Values.pgBouncer.service.port | quote }} + {{- else }} + DATABASE_HOST: {{ .Values.global.postgres.host | quote }} + DATABASE_PORT: {{ .Values.global.postgres.port | quote }} + {{- end }} {{- if .Values.global.scmProviders.gitlab.clientId }} GITLAB_CLIENT_ID: {{ .Values.global.scmProviders.gitlab.clientId | quote }} diff --git a/charts/studio/templates/service-pgbouncer.yaml b/charts/studio/templates/service-pgbouncer.yaml index 4d0fdc71..95971731 100644 --- a/charts/studio/templates/service-pgbouncer.yaml +++ b/charts/studio/templates/service-pgbouncer.yaml @@ -1,3 +1,4 @@ +{{- if .Values.pgBouncer.enabled -}} apiVersion: v1 kind: Service metadata: @@ -13,3 +14,4 @@ spec: name: pgbouncer selector: {{- include "pgbouncer.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/charts/studio/values.yaml b/charts/studio/values.yaml index 13aaf3fd..53a213c6 100644 --- a/charts/studio/values.yaml +++ b/charts/studio/values.yaml @@ -365,6 +365,8 @@ ray: # -- PgBouncer settings group pgBouncer: + enabled: false + # -- PgBouncer image settings image: # -- PgBouncer image repository From db7f5b8525ee7c4bba58f97c98fc7a8d20de02a3 Mon Sep 17 00:00:00 2001 From: jesper7 Date: Mon, 21 Aug 2023 16:17:54 +0000 Subject: [PATCH 07/13] Helm-Docs update --- charts/studio/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/studio/README.md b/charts/studio/README.md index 6387a93b..d19f9f62 100644 --- a/charts/studio/README.md +++ b/charts/studio/README.md @@ -91,7 +91,7 @@ A Helm chart for Kubernetes | nginx.ingress.enabled | bool | `false` | | | nginx.serverBlock | string | see in `values.yaml` | Nginx for blobvault configuration | | nginx.service.type | string | `"ClusterIP"` | | -| pgBouncer | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/bitnami/pgbouncer","tag":"1.20.1"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"1024Mi"},"requests":{"cpu":"500m","memory":"512Mi"}},"securityContext":{},"service":{"port":6432,"type":"ClusterIP"},"serviceAccountName":"","tolerations":[]}` | PgBouncer settings group | +| pgBouncer | object | `{"affinity":{},"autoscaling":{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80},"enabled":false,"envFromSecret":"","envVars":{},"image":{"pullPolicy":"IfNotPresent","repository":"docker.io/bitnami/pgbouncer","tag":"1.20.1"},"nodeSelector":{},"podAnnotations":{},"podSecurityContext":{},"replicaCount":1,"resources":{"limits":{"cpu":"1000m","memory":"1024Mi"},"requests":{"cpu":"500m","memory":"512Mi"}},"securityContext":{},"service":{"port":6432,"type":"ClusterIP"},"serviceAccountName":"","tolerations":[]}` | PgBouncer settings group | | pgBouncer.affinity | object | `{}` | PgBouncer pod affinity configuration | | pgBouncer.autoscaling | object | `{"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPUUtilizationPercentage":80}` | PgBouncer autoscaling configuration | | pgBouncer.autoscaling.enabled | bool | `false` | PgBouncer autoscaling enabled flag | From 22a1ea016a9be527154db16840c8ee91c2bee90f Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Mon, 21 Aug 2023 18:21:32 +0200 Subject: [PATCH 08/13] Bump chart version --- charts/studio/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/studio/Chart.yaml b/charts/studio/Chart.yaml index 1e4b9ae5..1a330f76 100644 --- a/charts/studio/Chart.yaml +++ b/charts/studio/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: studio description: A Helm chart for Kubernetes type: application -version: 0.4.3 +version: 0.4.4 appVersion: "v2.27.0" maintainers: - name: iterative From 28f3a522090a9cf74105739281d3ab1a9205a9d8 Mon Sep 17 00:00:00 2001 From: 0x2b3bfa0 <0x2b3bfa0@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:32:31 +0000 Subject: [PATCH 09/13] Helm-Docs update --- charts/studio/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/studio/README.md b/charts/studio/README.md index d19f9f62..d2cf1ebc 100644 --- a/charts/studio/README.md +++ b/charts/studio/README.md @@ -1,6 +1,6 @@ # studio -![Version: 0.4.3](https://img.shields.io/badge/Version-0.4.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.27.0](https://img.shields.io/badge/AppVersion-v2.27.0-informational?style=flat-square) +![Version: 0.4.4](https://img.shields.io/badge/Version-0.4.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.27.0](https://img.shields.io/badge/AppVersion-v2.27.0-informational?style=flat-square) A Helm chart for Kubernetes From 39404e0c1f9a0d58e8ba6e16e99d16c5ebd6f298 Mon Sep 17 00:00:00 2001 From: Jesper Svendsen Date: Mon, 21 Aug 2023 18:42:56 +0200 Subject: [PATCH 10/13] Fix "nil pointer evaluating interface" --- charts/studio/templates/deployment-pgbouncer.yaml | 2 +- charts/studio/templates/secret-pgbouncer.yaml | 2 +- charts/studio/templates/service-pgbouncer.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/studio/templates/deployment-pgbouncer.yaml b/charts/studio/templates/deployment-pgbouncer.yaml index 11c237c7..858a32e9 100644 --- a/charts/studio/templates/deployment-pgbouncer.yaml +++ b/charts/studio/templates/deployment-pgbouncer.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pgBouncer.enabled -}} +{{- if ((.Values.pgBouncer).enabled) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/studio/templates/secret-pgbouncer.yaml b/charts/studio/templates/secret-pgbouncer.yaml index 785087bb..807d3739 100644 --- a/charts/studio/templates/secret-pgbouncer.yaml +++ b/charts/studio/templates/secret-pgbouncer.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pgBouncer.enabled -}} +{{- if ((.Values.pgBouncer).enabled) -}} apiVersion: v1 kind: Secret metadata: diff --git a/charts/studio/templates/service-pgbouncer.yaml b/charts/studio/templates/service-pgbouncer.yaml index 95971731..4c8233fb 100644 --- a/charts/studio/templates/service-pgbouncer.yaml +++ b/charts/studio/templates/service-pgbouncer.yaml @@ -1,4 +1,4 @@ -{{- if .Values.pgBouncer.enabled -}} +{{- if ((.Values.pgBouncer).enabled) -}} apiVersion: v1 kind: Service metadata: From ee82d405654033b15e03bd1270a54097b0357f11 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Mon, 21 Aug 2023 22:06:53 +0200 Subject: [PATCH 11/13] Apply suggestions from code review --- charts/studio/templates/secret-studio.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/studio/templates/secret-studio.yaml b/charts/studio/templates/secret-studio.yaml index 40e2d4b1..61542c38 100644 --- a/charts/studio/templates/secret-studio.yaml +++ b/charts/studio/templates/secret-studio.yaml @@ -15,7 +15,7 @@ stringData: DATABASE_PASSWORD: {{ .Values.global.postgres.password | quote }} DATABASE_NAME: {{ .Values.global.postgres.databaseName | quote }} - {{- if .Values.pgBouncer.enabled -}} +{{- if ((.Values.pgBouncer).enabled) -}} DATABASE_HOST: "pgbouncer.{{ .Release.Namespace }}.svc.cluster.local" DATABASE_PORT: {{ .Values.pgBouncer.service.port | quote }} {{- else }} From a285506d1d18c5c17d191d65aedc4d032897f3e4 Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Mon, 21 Aug 2023 22:07:33 +0200 Subject: [PATCH 12/13] Apply suggestions from code review --- charts/studio/templates/secret-studio.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/studio/templates/secret-studio.yaml b/charts/studio/templates/secret-studio.yaml index 61542c38..27d297fb 100644 --- a/charts/studio/templates/secret-studio.yaml +++ b/charts/studio/templates/secret-studio.yaml @@ -15,7 +15,7 @@ stringData: DATABASE_PASSWORD: {{ .Values.global.postgres.password | quote }} DATABASE_NAME: {{ .Values.global.postgres.databaseName | quote }} -{{- if ((.Values.pgBouncer).enabled) -}} + {{- if ((.Values.pgBouncer).enabled) -}} DATABASE_HOST: "pgbouncer.{{ .Release.Namespace }}.svc.cluster.local" DATABASE_PORT: {{ .Values.pgBouncer.service.port | quote }} {{- else }} From fc4716fc807deb6c836705d0f78fb97466c5da2e Mon Sep 17 00:00:00 2001 From: Jesper Svendsen <99078145+jesper7@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:02:42 +0200 Subject: [PATCH 13/13] Update charts/studio/templates/secret-studio.yaml Co-authored-by: Marcin Jasion <5058132+mjasion@users.noreply.github.com> --- charts/studio/templates/secret-studio.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/studio/templates/secret-studio.yaml b/charts/studio/templates/secret-studio.yaml index 27d297fb..6534b1c2 100644 --- a/charts/studio/templates/secret-studio.yaml +++ b/charts/studio/templates/secret-studio.yaml @@ -15,7 +15,7 @@ stringData: DATABASE_PASSWORD: {{ .Values.global.postgres.password | quote }} DATABASE_NAME: {{ .Values.global.postgres.databaseName | quote }} - {{- if ((.Values.pgBouncer).enabled) -}} + {{- if ((.Values.pgBouncer).enabled) }} DATABASE_HOST: "pgbouncer.{{ .Release.Namespace }}.svc.cluster.local" DATABASE_PORT: {{ .Values.pgBouncer.service.port | quote }} {{- else }}