Skip to content

Commit

Permalink
OPSEXP-2298: fix wrong repository URL in search enterprise reindexing…
Browse files Browse the repository at this point in the history
… job (#1035)
  • Loading branch information
alxgomz authored Oct 24, 2023
1 parent 51fcae6 commit 8d105d4
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 67 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pre-commit-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected]
- name: Add dependency chart repos
run: |
helm repo add alfresco-helm-charts https://alfresco.github.io/alfresco-helm-charts/
helm repo add alfresco-helm-charts https://alfresco.github.io/alfresco-helm-charts
helm repo add activiti-cloud-helm-charts https://activiti.github.io/activiti-cloud-helm-charts
helm repo add elasticsearch https://helm.elastic.co
- uses: pre-commit/[email protected]
25 changes: 12 additions & 13 deletions docs/helm/examples/with-aws-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,17 @@ global:
known_urls:
- https://acs.YOUR-DOMAIN-NAME
search:
sharedSecret: dummy
alfrescoRegistryPullSecrets: quay-registry-secret
elasticsearch:
host: YOUR-DOMAIN-HOSTNAME
port: 443
protocol: https
user: YOUR-DOMAIN-MASTER-USERNAME
url: https://YOUR-DOMAIN-HOSTNAME/
username: YOUR-DOMAIN-MASTER-USERNAME
password: YOUR-DOMAIN-MASTER-PASSWORD
alfrescoRegistryPullSecrets: quay-registry-secret
alfresco-repository:
image:
repository: alfresco-content-repository-aws
configuration:
search:
flavor: elasticsearch
securecomms: https
persistence:
enabled: false
environement:
Expand Down Expand Up @@ -313,14 +313,13 @@ helm -n alfresco install acs \
--atomic --timeout 10m0s \
--set global.known_urls=https://acs.YOUR-DOMAIN-NAME \
--set global.alfrescoRegistryPullSecrets=quay-registry-secret \
--set global.search.sharedSecret=dummy \
--set global.elasticsearch.host=YOUR-DOMAIN-HOSTNAME \
--set global.elasticsearch.port=443 \
--set global.elasticsearch.protocol=https \
--set global.elasticsearch.user=YOUR-DOMAIN-MASTER-USERNAME \
--set global.elasticsearch.password=YOUR-DOMAIN-MASTER-PASSWORD \
--set global.search.url=https://YOUR-DOMAIN-HOSTNAME \
--set global.search.username=YOUR-DOMAIN-MASTER-USERNAME \
--set global.search.password=YOUR-DOMAIN-MASTER-PASSWORD \
--set alfresco-repository.persistence.enabled=false \
--set alfresco-repository.image.repository=alfresco-content-repository-aws \
--set alfresco-repository.configuration.search.flavor=elasticsearch \
--set alfresco-repository.configuration.search.securecomms=https \
--set filestore.persistence.enabled=true \
--set filestore.persistence.storageClass="nfs-client" \
--set alfresco-repository.image.repository="quay.io/alfresco/alfresco-content-repository-aws" \
Expand Down
13 changes: 8 additions & 5 deletions helm/alfresco-content-services/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: alfresco-common
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 3.0.0-alpha.2
version: 3.0.0-alpha.3
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 12.8.5
Expand All @@ -13,7 +13,7 @@ dependencies:
version: 7.11.0
- name: alfresco-repository
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 0.1.0-alpha.18
version: 0.1.0-alpha.19
- name: activemq
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 3.3.0
Expand All @@ -28,7 +28,7 @@ dependencies:
version: 4.4.0
- name: alfresco-search-enterprise
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 3.0.0-alpha.1
version: 3.0.0-alpha.6
- name: alfresco-connector-msteams
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 0.2.0
Expand All @@ -41,5 +41,8 @@ dependencies:
- name: alfresco-ai-transformer
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 0.3.0
digest: sha256:6a533094da7cc78446fb85fe0fc7ca6e61e24d207ea63ffa6a6a808f6af5aab7
generated: "2023-10-13T19:53:57.940715+02:00"
- name: elasticsearch
repository: https://helm.elastic.co
version: 7.17.3
digest: sha256:baff6c44e199f18cfcedac5c5329d667480576f0b8ddf7be5640563da791370e
generated: "2023-10-23T15:00:16.909173+02:00"
10 changes: 7 additions & 3 deletions helm/alfresco-content-services/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sources:
- https://github.com/Alfresco/acs-deployment
dependencies:
- name: alfresco-common
version: 3.0.0-alpha.2
version: 3.0.0-alpha.3
repository: https://alfresco.github.io/alfresco-helm-charts/
- name: postgresql
version: 12.8.5
Expand All @@ -36,7 +36,7 @@ dependencies:
condition: >-
alfresco-digital-workspace.enabled
- name: alfresco-repository
version: 0.1.0-alpha.18
version: 0.1.0-alpha.19
repository: https://alfresco.github.io/alfresco-helm-charts/
- name: activemq
version: 3.3.0
Expand All @@ -56,7 +56,7 @@ dependencies:
version: 4.4.0
condition: alfresco-sync-service.enabled
- name: alfresco-search-enterprise
version: 3.0.0-alpha.1
version: 3.0.0-alpha.6
repository: https://alfresco.github.io/alfresco-helm-charts/
condition: alfresco-search-enterprise.enabled
- name: alfresco-connector-msteams
Expand All @@ -76,4 +76,8 @@ dependencies:
version: 0.3.0
repository: https://alfresco.github.io/alfresco-helm-charts/
condition: alfresco-ai-transformer.enabled
- name: elasticsearch
repository: https://helm.elastic.co
version: 7.17.3
condition: elasticsearch.enabled
icon: https://avatars0.githubusercontent.com/u/391127?s=200&v=4
29 changes: 16 additions & 13 deletions helm/alfresco-content-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b
| https://activiti.github.io/activiti-cloud-helm-charts | alfresco-digital-workspace(common) | 7.11.0 |
| https://alfresco.github.io/alfresco-helm-charts/ | activemq | 3.3.0 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-ai-transformer | 0.3.0 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.0.0-alpha.2 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.0.0-alpha.3 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-connector-ms365 | 0.4.0 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-connector-msteams | 0.2.0 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-repository | 0.1.0-alpha.18 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-search-enterprise | 3.0.0-alpha.1 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-repository | 0.1.0-alpha.19 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-search-enterprise | 3.0.0-alpha.6 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-search(alfresco-search-service) | 2.0.0-alpha.2 |
| https://alfresco.github.io/alfresco-helm-charts/ | share(alfresco-share) | 0.1.1 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-sync-service | 4.4.0 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-transform-service | 0.2.0 |
| https://helm.elastic.co | elasticsearch | 7.17.3 |
| oci://registry-1.docker.io/bitnamicharts | postgresql | 12.8.5 |

## Values
Expand Down Expand Up @@ -113,7 +114,9 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b
| alfresco-repository.configuration.repository.existingSecrets[1].name | string | `"outbound-email"` | |
| alfresco-repository.configuration.repository.existingSecrets[1].purpose | string | `"property:mail.password"` | |
| alfresco-repository.configuration.search.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-repository.configuration.search.existingSecret.name | string | `"solr-shared-secret"` | |
| alfresco-repository.configuration.search.existingSecret.keys.password | string | `"SEARCH_PASSWORD"` | |
| alfresco-repository.configuration.search.existingSecret.keys.username | string | `"SEARCH_USERNAME"` | |
| alfresco-repository.configuration.search.existingSecret.name | string | `"alfresco-search-secret"` | |
| alfresco-repository.configuration.search.flavor | string | `"solr6"` | |
| alfresco-repository.image.repository | string | `"quay.io/alfresco/alfresco-content-repository"` | |
| alfresco-repository.image.tag | string | `"23.1.0-A27"` | |
Expand All @@ -122,17 +125,20 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b
| alfresco-repository.persistence.baseSize | string | `"20Gi"` | |
| alfresco-repository.persistence.enabled | bool | `true` | Persist repository data |
| alfresco-search-enterprise.ats.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-search-enterprise.elasticsearch.enabled | bool | `true` | Enables the embedded elasticsearch cluster |
| alfresco-search-enterprise.enabled | bool | `false` | |
| alfresco-search-enterprise.liveIndexing.content.image.tag | string | `"4.0.0-M1"` | |
| alfresco-search-enterprise.liveIndexing.mediation.image.tag | string | `"4.0.0-M1"` | |
| alfresco-search-enterprise.liveIndexing.metadata.image.tag | string | `"4.0.0-M1"` | |
| alfresco-search-enterprise.liveIndexing.path.image.tag | string | `"4.0.0-M1"` | |
| alfresco-search-enterprise.messageBroker.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-search-enterprise.messageBroker.existingSecretName | string | `"acs-alfresco-cs-brokersecret"` | |
| alfresco-search-enterprise.reindexing.db.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-search-enterprise.reindexing.db.existingSecret.name | string | `"alfresco-cs-database"` | |
| alfresco-search-enterprise.reindexing.enabled | bool | `true` | |
| alfresco-search-enterprise.reindexing.image.tag | string | `"4.0.0-M1"` | |
| alfresco-search-enterprise.reindexing.repository.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-search-enterprise.search.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-search-enterprise.search.existingSecret.name | string | `"alfresco-search-secret"` | |
| alfresco-search.alfresco-insight-zeppelin.enabled | bool | `false` | |
| alfresco-search.enabled | bool | `true` | |
| alfresco-search.external.host | string | `nil` | Host dns/ip of the external solr6 instance. |
Expand All @@ -146,7 +152,7 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b
| alfresco-search.repository.existingConfigMap.keys.securecomms | string | `"SEARCH_SECURECOMMS"` | |
| alfresco-search.repository.existingConfigMap.name | string | `"alfresco-infrastructure"` | |
| alfresco-search.repository.existingSecret.keys.sharedSecret | string | `"SOLR_SECRET"` | |
| alfresco-search.repository.existingSecret.name | string | `"solr-shared-secret"` | |
| 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.1"` | |
| 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) |
Expand Down Expand Up @@ -200,21 +206,18 @@ Please refer to the [documentation](https://github.com/Alfresco/acs-deployment/b
| database.secretName | string | `"alfresco-cs-database"` | Name of the secret managed by this chart |
| 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"` | |
| elasticsearch.enabled | bool | `false` | Enables the embedded elasticsearch cluster |
| elasticsearch.replicas | int | `1` | |
| global.ai.enabled | bool | `false` | Enable AI capabilities in ADW AI plugin |
| global.alfrescoRegistryPullSecrets | string | `nil` | If a private image registry a secret can be defined and passed to kubernetes, see: https://github.com/Alfresco/acs-deployment/blob/a924ad6670911f64f1bba680682d266dd4ea27fb/docs/helm/eks-deployment.md#docker-registry-secret |
| global.elasticsearch | object | `{"host":"elasticsearch-master","password":null,"port":9200,"protocol":"http","user":null}` | Shared connections details for Elasticsearch/Opensearch, required when alfresco-search-enterprise.enabled is true |
| global.elasticsearch.host | string | `"elasticsearch-master"` | The host where service is available. The provided default is for when elasticsearch.enabled is true |
| global.elasticsearch.password | string | `nil` | The password required to access the service, if any |
| global.elasticsearch.port | int | `9200` | The port where service is available |
| global.elasticsearch.protocol | string | `"http"` | Valid values are http or https |
| global.elasticsearch.user | string | `nil` | The username required to access the service, if any |
| global.known_urls | list | `["https://localhost","http://localhost"]` | list of trusted URLs. URLs a re used to configure Cross-origin protections Also the first entry is considered the main hosting domain of the platform. |
| global.mail | object | `{"host":null,"password":null,"port":587,"protocol":"smtp","smtp":{"auth":true,"starttls":{"enable":true}},"smtps":{"auth":true},"username":"anonymous"}` | For a full information of configuring the outbound email system, see https://docs.alfresco.com/content-services/latest/config/email/#manage-outbound-emails |
| global.mail.host | string | `nil` | SMTP server to use for the system to send outgoing email |
| global.mail.port | int | `587` | SMTP server port |
| global.mail.protocol | string | `"smtp"` | SMTP protocol to use. Either smtp or smtps |
| global.search.flavor | string | `nil` | set the type of search service used externally (solr6 of elasticsearch) |
| global.search.secretName | string | `"solr-shared-secret"` | Name of the secret managed by this chart |
| global.search.secretName | string | `"alfresco-search-secret"` | Name of the secret managed by this chart |
| global.search.securecomms | string | `"secret"` | set the security level used with the external search service (secret, none or https) |
| global.search.sharedSecret | string | `nil` | Mandatory secret to provide when using Solr search with 'secret' security level |
| global.search.url | string | `nil` | set this URL if you have an external search service |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ metadata:
data:
{{- $repoCtx := dict "Values" (index .Values "alfresco-repository") "Chart" .Chart "Release" .Release }}
{{- $atsCtx := dict "Values" (index .Values "alfresco-transform-service") "Chart" $.Chart "Release" $.Release }}
repo_svc_name: {{ template "alfresco-repository.fullname" $repoCtx }}
repo_svc_port: {{ index .Values "alfresco-repository" "service" "port" | default 80 | quote }}
{{- $repo_svc_name := include "alfresco-repository.fullname" $repoCtx }}
{{- $repo_svc_port := index .Values "alfresco-repository" "service" "port" | default 80 }}
repo_svc_name: {{ $repo_svc_name }}
repo_svc_port: {{ $repo_svc_port | quote }}
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) }}
{{ template "alfresco-repository.mq.cm" (include "alfresco-content-services.mq.url" .) }}
{{ template "alfresco-common.activemq.cm" (include "alfresco-content-services.mq.url" .) }}
{{- $search_url := "" }}
{{- $search_flavor := include "alfresco-content-services.search.flavor" . }}
{{- if ne "noindex" $search_flavor }}
Expand All @@ -22,9 +25,15 @@ data:
{{- $searchCtx := dict "Values" (index .Values "alfresco-search") "Chart" .Chart "Release" .Release }}
{{- $search_url = printf "http://%s-solr/solr" (include "alfresco-search-service.fullname" $searchCtx) }}
{{- else if eq "elasticsearch" $search_flavor }}
{{- $searchCtx := dict "Values" (index .Values "alfresco-search-enterprise") "Chart" .Chart "Release" .Release }}
{{- with (index .Values "alfresco-search-enterprise" "elasticsearch") }}
{{- $search_url = printf "%s://%s-%s:%v" .protocol .clusterName .nodeGroup .httpPort }}
{{- with .Values.elasticsearch }}
{{- if .enabled }}
{{- $esProto := .protocol | default "http" }}
{{- $esHost := printf "%s-%s" (.clusterName | default "elastcisearch") (.nodeGroup | default "master") }}
{{- $esPort := .port | default 9200 }}
{{- $search_url = coalesce $.Values.global.search.url (printf "%s://%s:%v" $esProto $esHost $esPort) }}
{{- else }}
{{- fail "Chart is configured to use Alfresco Search Enterprise but no index backend has been provided. Set one using either global.search.url or elasticsearch.enabled" }}
{{- end }}
{{- end }}
{{- $search_comms := "" }}
{{- if hasPrefix "https://" $search_url }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ data:
BROKER_PASSWORD: {{ .password | default "" | b64enc | quote }}
{{- end }}
{{- end }}
{{/* required until OPSEXP-2300 & OPSEXP-2293 */}}
{{/* required until OPSEXP-2301, OPSEXP-2300 & OPSEXP-2293 */}}
BROKER_URL: {{ include "alfresco-content-services.mq.url" . | b64enc | quote }}
{{- end }}
17 changes: 13 additions & 4 deletions helm/alfresco-content-services/templates/secret-search.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{{- if eq "secret" .Values.global.search.securecomms }}
{{- $search_flavor := (include "alfresco-content-services.search.flavor" .) }}
{{- if ne "noindex" $search_flavor }}
{{- with .Values.global.search }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.global.search.secretName }}
name: {{ .secretName }}
labels:
{{- include "alfresco-content-services.labels" . | nindent 4 }}
{{- include "alfresco-content-services.labels" $ | nindent 4 }}
type: Opaque
data:
SOLR_SECRET: {{ .Values.global.search.sharedSecret | default "" | b64enc | quote }}
{{- if eq "secret" .securecomms }}
SOLR_SECRET: {{ .sharedSecret | default "" | b64enc | quote }}
{{- end }}
{{- if eq "elasticsearch" (include "alfresco-content-services.search.flavor" $) }}
SEARCH_USERNAME: {{ .username | default "" | b64enc | quote }}
SEARCH_PASSWORD: {{ .password | default "" | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
23 changes: 20 additions & 3 deletions helm/alfresco-content-services/tests/search_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ tests:
enabled: false
alfresco-search-enterprise:
enabled: true
elasticsearch:
enabled: true
template: config-infrastructure.yaml
asserts:
- equal:
Expand All @@ -89,10 +91,25 @@ tests:
- it: should not render a secret render property with default credentials
values: *testvalues
set:
global:
search:
securecomms: none
alfresco-search:
enabled: false
alfresco-search-enterprise:
enabled: false
asserts:
- hasDocuments:
count: 0
template: secret-search.yaml
- it: Should complain on missing search index
values: *testvalues
set:
alfresco-search:
enabled: false
alfresco-search-enterprise:
enabled: true
template: config-infrastructure.yaml
asserts:
- failedTemplate:
errorMessage: >-
Chart is configured to use Alfresco Search Enterprise but no index
backend has been provided. Set one using either global.search.url
or elasticsearch.enabled
Loading

0 comments on commit 8d105d4

Please sign in to comment.