From 6bb72cfecab35a10ebe1e800bc5ecbaedae3444b Mon Sep 17 00:00:00 2001 From: Alex Chapellon Date: Thu, 11 Jan 2024 09:58:17 +0100 Subject: [PATCH] OPSEXP-2300: bump alfresco-sync-service chart to 5.0.0-alpha.1 (#1068) --- helm/alfresco-content-services/Chart.lock | 9 ++- helm/alfresco-content-services/Chart.yaml | 7 +- helm/alfresco-content-services/README.md | 41 +++++++---- .../templates/_helpers-database.tpl | 18 +++++ .../templates/config-infrastructure.yaml | 5 ++ .../templates/secret-sync-database.yaml | 14 ++++ helm/alfresco-content-services/values.yaml | 68 +++++++++++++------ 7 files changed, 124 insertions(+), 38 deletions(-) create mode 100644 helm/alfresco-content-services/templates/secret-sync-database.yaml diff --git a/helm/alfresco-content-services/Chart.lock b/helm/alfresco-content-services/Chart.lock index b88d7e9db..d6b3fab90 100644 --- a/helm/alfresco-content-services/Chart.lock +++ b/helm/alfresco-content-services/Chart.lock @@ -5,6 +5,9 @@ dependencies: - name: postgresql repository: oci://registry-1.docker.io/bitnamicharts version: 12.8.5 +- name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 12.8.5 - name: common repository: https://activiti.github.io/activiti-cloud-helm-charts version: 8.0.0 @@ -25,7 +28,7 @@ dependencies: version: 2.0.0 - name: alfresco-sync-service repository: https://alfresco.github.io/alfresco-helm-charts/ - version: 4.5.1 + version: 5.0.0-alpha.1 - name: alfresco-search-enterprise repository: https://alfresco.github.io/alfresco-helm-charts/ version: 3.1.0-alpha.1 @@ -44,5 +47,5 @@ dependencies: - name: elasticsearch repository: https://helm.elastic.co version: 7.17.3 -digest: sha256:02be1c10b63c9e03784d7d7ef53893da3cc4bb46cb975274876ad791e16c0f14 -generated: "2024-01-09T16:33:13.116899+01:00" +digest: sha256:51536deb76355c975200cec27a9be5d8bbd5c40da819d558a549a353ef50de13 +generated: "2024-01-11T09:31:51.429814+01:00" diff --git a/helm/alfresco-content-services/Chart.yaml b/helm/alfresco-content-services/Chart.yaml index 884c20e8c..93fd1c4ae 100644 --- a/helm/alfresco-content-services/Chart.yaml +++ b/helm/alfresco-content-services/Chart.yaml @@ -23,6 +23,11 @@ dependencies: version: 12.8.5 repository: oci://registry-1.docker.io/bitnamicharts condition: postgresql.enabled + - name: postgresql + version: 12.8.5 + repository: oci://registry-1.docker.io/bitnamicharts + alias: postgresql-sync + condition: postgresql-sync.enabled - name: common alias: alfresco-control-center repository: https://activiti.github.io/activiti-cloud-helm-charts @@ -53,7 +58,7 @@ dependencies: condition: alfresco-search.enabled - name: alfresco-sync-service repository: https://alfresco.github.io/alfresco-helm-charts/ - version: 4.5.1 + version: 5.0.0-alpha.1 condition: alfresco-sync-service.enabled - name: alfresco-search-enterprise version: 3.1.0-alpha.1 diff --git a/helm/alfresco-content-services/README.md b/helm/alfresco-content-services/README.md index 4454a2a66..8fcc9820e 100644 --- a/helm/alfresco-content-services/README.md +++ b/helm/alfresco-content-services/README.md @@ -27,9 +27,10 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | https://alfresco.github.io/alfresco-helm-charts/ | alfresco-search-enterprise | 3.1.0-alpha.1 | | https://alfresco.github.io/alfresco-helm-charts/ | alfresco-search(alfresco-search-service) | 2.0.0 | | https://alfresco.github.io/alfresco-helm-charts/ | share(alfresco-share) | 0.3.0 | -| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-sync-service | 4.5.1 | +| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-sync-service | 5.0.0-alpha.1 | | https://alfresco.github.io/alfresco-helm-charts/ | alfresco-transform-service | 1.0.0-alpha.2 | | https://helm.elastic.co | elasticsearch | 7.17.3 | +| oci://registry-1.docker.io/bitnamicharts | postgresql-sync(postgresql) | 12.8.5 | | oci://registry-1.docker.io/bitnamicharts | postgresql | 12.8.5 | ## Values @@ -160,21 +161,16 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | alfresco-search.repository.existingSecret.name | string | `"alfresco-search-secret"` | | | alfresco-search.searchServicesImage.repository | string | `"quay.io/alfresco/search-services"` | | | alfresco-search.searchServicesImage.tag | string | `"2.0.8.2"` | | +| alfresco-sync-service.database.existingConfigMap.keys.url | string | `"SYNC_DATABASE_URL"` | | +| alfresco-sync-service.database.existingConfigMap.name | string | `"alfresco-infrastructure"` | | +| alfresco-sync-service.database.existingSecret.name | string | `"alfresco-cs-sync"` | | | alfresco-sync-service.enabled | bool | `true` | Toggle deployment of Alfresco Sync Service (Desktop-Sync) Check [Alfresco Sync Service Documentation](https://github.com/Alfresco/alfresco-helm-charts/tree/main/charts/alfresco-sync-service) | | alfresco-sync-service.image.tag | string | `"4.0.1"` | | -| alfresco-sync-service.messageBroker.existingSecretName | string | `"acs-alfresco-cs-brokersecret"` | | -| alfresco-sync-service.postgresql.auth.database | string | `"syncservice-postgresql"` | | -| alfresco-sync-service.postgresql.auth.enablePostgresUser | bool | `false` | | -| alfresco-sync-service.postgresql.auth.password | string | `"admin"` | | -| alfresco-sync-service.postgresql.auth.username | string | `"alfresco"` | | -| alfresco-sync-service.postgresql.enabled | bool | `true` | | -| alfresco-sync-service.postgresql.image.tag | string | `"14.4.0"` | | -| alfresco-sync-service.postgresql.primary.resources.limits.cpu | string | `"4"` | | -| alfresco-sync-service.postgresql.primary.resources.limits.memory | string | `"4Gi"` | | -| alfresco-sync-service.postgresql.primary.resources.requests.cpu | string | `"250m"` | | -| alfresco-sync-service.postgresql.primary.resources.requests.memory | string | `"1Gi"` | | -| alfresco-sync-service.repository.nameOverride | string | `"alfresco-repository"` | | -| alfresco-sync-service.repository.port | int | `80` | | +| alfresco-sync-service.messageBroker.existingConfigMap.name | string | `"alfresco-infrastructure"` | | +| alfresco-sync-service.messageBroker.existingSecret.name | string | `"acs-alfresco-cs-brokersecret"` | | +| alfresco-sync-service.repository.existingConfigMap.keys.host | string | `"repo_svc_name"` | | +| alfresco-sync-service.repository.existingConfigMap.keys.port | string | `"repo_svc_port"` | | +| alfresco-sync-service.repository.existingConfigMap.name | string | `"alfresco-infrastructure"` | | | alfresco-transform-service.enabled | bool | `true` | | | alfresco-transform-service.filestore.enabled | bool | `true` | Declares the alfresco-shared-file-store used by the content repository and transform service | | alfresco-transform-service.filestore.image.repository | string | `"quay.io/alfresco/alfresco-shared-file-store"` | | @@ -210,6 +206,12 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | database.external | bool | `false` | Enable using an external database for Alfresco Content Services. Must disable `postgresql.enabled` when true. | | database.password | string | `nil` | External Postgresql database password | | database.secretName | string | `"alfresco-cs-database"` | Name of the secret managed by this chart | +| database.sync.configMapName | string | `"alfresco-infrastructure"` | Name of the secret managed by this chart | +| database.sync.driver | string | `nil` | Postgresql jdbc driver name ex: org.postgresql.Driver. It should be available in the container image. | +| database.sync.password | string | `nil` | External Postgresql database password | +| database.sync.secretName | string | `"alfresco-cs-sync"` | Name of the secret managed by this chart | +| database.sync.url | string | `nil` | External Postgresql jdbc url ex: `jdbc:postgresql://oldfashioned-mule-postgresql-acs:5432/alfresco` | +| database.sync.user | string | `nil` | External Postgresql database user | | database.url | string | `nil` | External Postgresql jdbc url ex: `jdbc:postgresql://oldfashioned-mule-postgresql-acs:5432/alfresco` | | database.user | string | `nil` | External Postgresql database user | | elasticsearch.clusterHealthCheckParams | string | `"wait_for_status=yellow&timeout=1s"` | | @@ -232,6 +234,17 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b | infrastructure.configMapName | string | `"alfresco-infrastructure"` | | | messageBroker | object | `{"password":null,"secretName":"acs-alfresco-cs-brokersecret","url":null,"user":null}` | Activemq connection details (activemq.enabled must also be set to false) | | messageBroker.secretName | string | `"acs-alfresco-cs-brokersecret"` | Name of the secret managed by this chart | +| postgresql-sync.auth.database | string | `"syncservice-postgresql"` | | +| postgresql-sync.auth.enablePostgresUser | bool | `false` | | +| postgresql-sync.auth.password | string | `"admin"` | | +| postgresql-sync.auth.username | string | `"alfresco"` | | +| postgresql-sync.enabled | bool | `true` | Toggle creation of the "in-cluster" test postgresql instance for Alfresco Sync service | +| postgresql-sync.image.tag | string | `"14.4.0"` | | +| postgresql-sync.nameOverride | string | `"postgresql-sync"` | | +| postgresql-sync.primary.resources.limits.cpu | string | `"4"` | | +| postgresql-sync.primary.resources.limits.memory | string | `"4Gi"` | | +| postgresql-sync.primary.resources.requests.cpu | string | `"250m"` | | +| postgresql-sync.primary.resources.requests.memory | string | `"1Gi"` | | | postgresql.auth.database | string | `"alfresco"` | | | postgresql.auth.existingSecret | string | `nil` | | | postgresql.auth.password | string | `"alfresco"` | | diff --git a/helm/alfresco-content-services/templates/_helpers-database.tpl b/helm/alfresco-content-services/templates/_helpers-database.tpl index 40c10f47b..acfb76dfb 100644 --- a/helm/alfresco-content-services/templates/_helpers-database.tpl +++ b/helm/alfresco-content-services/templates/_helpers-database.tpl @@ -15,3 +15,21 @@ Usage: include "alfresco-content-services.database.repo" $ {{- end }} {{- end }} {{- end -}} + +{{/* +Compute the sync-service database URL + +Usage: include "alfresco-content-services.database.sync" $ + +*/}} +{{- define "alfresco-content-services.database.sync" -}} +{{- with .Values }} + {{- if and (not .database.sync.url) (not (index . "postgresql-sync" "enabled")) }} + {{- fail "You must either set database.sync.url or postgresql-sync.enabled values" }} + {{- else }} + {{- $pg_port := index . "postgresql-sync" "primary" "service" "ports" "postgresql" | toString }} + {{- $pg_url := printf "postgresql://%s-%s:%s/%s" $.Release.Name (index . "postgresql-sync" "nameOverride") $pg_port (index . "postgresql-sync" "auth" "database") }} + {{- .database.sync.url | default $pg_url }} + {{- end }} +{{- end }} +{{- end -}} diff --git a/helm/alfresco-content-services/templates/config-infrastructure.yaml b/helm/alfresco-content-services/templates/config-infrastructure.yaml index ba581a277..a73908aa6 100644 --- a/helm/alfresco-content-services/templates/config-infrastructure.yaml +++ b/helm/alfresco-content-services/templates/config-infrastructure.yaml @@ -14,6 +14,11 @@ data: REPOSITORY_URL: {{ printf "http://%s:%v/alfresco" $repo_svc_name $repo_svc_port }} {{- $db_url := include "alfresco-content-services.database.repo" $ }} {{ template "alfresco-repository.db.cm" (dict "url" $db_url "driver" .Values.database.driver) }} + {{- if index .Values "alfresco-sync-service" "enabled" }} + {{- $sync_db_url := include "alfresco-content-services.database.sync" $ }} + SYNC_DATABASE_URL: {{ hasPrefix "jdbc:" $sync_db_url | ternary $sync_db_url (print "jdbc:" $sync_db_url) }} + SYNC_DATABASE_DRIVER: {{ template "alfresco-common.db.driver" (dict "url" $sync_db_url "driver" .Values.database.sync.driver) }} + {{- end }} {{ template "alfresco-common.activemq.cm" (include "alfresco-content-services.mq.url" .) }} {{- $search_url := "" }} {{- $search_flavor := include "alfresco-content-services.search.flavor" . }} diff --git a/helm/alfresco-content-services/templates/secret-sync-database.yaml b/helm/alfresco-content-services/templates/secret-sync-database.yaml new file mode 100644 index 000000000..6fbbf2de7 --- /dev/null +++ b/helm/alfresco-content-services/templates/secret-sync-database.yaml @@ -0,0 +1,14 @@ +{{- if index . "Values" "alfresco-sync-service" "enabled" }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.database.sync.secretName }} + labels: + {{- include "alfresco-content-services.labels" . | nindent 4 }} +type: Opaque +data: + {{- with .Values }} + DATABASE_USERNAME: {{ .database.sync.user | default (index . "postgresql-sync" "auth" "username") | b64enc | quote }} + DATABASE_PASSWORD: {{ .database.sync.password | default (index . "postgresql-sync" "auth" "password") | b64enc | quote }} + {{- end }} +{{- end }} diff --git a/helm/alfresco-content-services/values.yaml b/helm/alfresco-content-services/values.yaml index d9039aacb..e9298c346 100644 --- a/helm/alfresco-content-services/values.yaml +++ b/helm/alfresco-content-services/values.yaml @@ -80,6 +80,19 @@ database: # -- An existing secret that contains DATABASE_USERNAME and DATABASE_PASSWORD keys. # When using embedded postgres you need to also set `postgresql.existingSecret`. existingSecretName: null + sync: + # -- Postgresql jdbc driver name ex: org.postgresql.Driver. It should be available in the container image. + driver: null + # -- External Postgresql database user + user: null + # -- External Postgresql database password + password: null + # -- External Postgresql jdbc url ex: `jdbc:postgresql://oldfashioned-mule-postgresql-acs:5432/alfresco` + url: null + # -- Name of the secret managed by this chart + configMapName: *infrastructure_cmName + # -- Name of the secret managed by this chart + secretName: &sync_database_secretName alfresco-cs-sync # -- Activemq connection details (activemq.enabled must also be set to false) messageBroker: url: null @@ -456,28 +469,43 @@ alfresco-sync-service: enabled: true image: tag: 4.0.1 - postgresql: - enabled: true - image: - tag: 14.4.0 - auth: - enablePostgresUser: false - username: alfresco - password: admin - database: syncservice-postgresql - primary: - resources: - requests: - cpu: 250m - memory: 1Gi - limits: - cpu: "4" - memory: 4Gi + database: + existingSecret: + name: *sync_database_secretName + existingConfigMap: + name: *infrastructure_cmName + keys: + url: SYNC_DATABASE_URL messageBroker: - existingSecretName: *acs_messageBroker_secretName + existingSecret: + name: *acs_messageBroker_secretName + existingConfigMap: + name: *infrastructure_cmName repository: - nameOverride: alfresco-repository - port: 80 + existingConfigMap: + name: *infrastructure_cmName + keys: + host: repo_svc_name + port: repo_svc_port +postgresql-sync: + # -- Toggle creation of the "in-cluster" test postgresql instance for Alfresco Sync service + enabled: true + nameOverride: postgresql-sync + image: + tag: 14.4.0 + auth: + enablePostgresUser: false + username: alfresco + password: admin + database: syncservice-postgresql + primary: + resources: + requests: + cpu: 250m + memory: 1Gi + limits: + cpu: "4" + memory: 4Gi alfresco-ai-transformer: # -- toggle deploying Alfresco ai transformer for more details about configuration check # https://github.com/Alfresco/alfresco-helm-charts/tree/main/charts/alfresco-ai-transformer