diff --git a/charts/alfresco-connector-hxi/.helmignore b/charts/alfresco-connector-hxi/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/alfresco-connector-hxi/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/alfresco-connector-hxi/Chart.lock b/charts/alfresco-connector-hxi/Chart.lock new file mode 100644 index 00000000..2eee86b0 --- /dev/null +++ b/charts/alfresco-connector-hxi/Chart.lock @@ -0,0 +1,12 @@ +dependencies: +- name: alfresco-common + repository: https://alfresco.github.io/alfresco-helm-charts/ + version: 3.1.3 +- name: activemq + repository: https://alfresco.github.io/alfresco-helm-charts/ + version: 3.5.5 +- name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 12.5.6 +digest: sha256:82f2c26305e35e511750f8621c60d0f222f6afad9d66e73c1cbffa17e825e425 +generated: "2024-08-30T08:57:16.043350112Z" diff --git a/charts/alfresco-connector-hxi/Chart.yaml b/charts/alfresco-connector-hxi/Chart.yaml new file mode 100644 index 00000000..8470f3ca --- /dev/null +++ b/charts/alfresco-connector-hxi/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +name: alfresco-connector-hxi +description: A Helm chart for deploying Alfresco connector hxi services +type: application +version: 0.1.0-alpha.0 +appVersion: 1.0.0 +dependencies: + - name: alfresco-common + version: 3.1.3 + repository: https://alfresco.github.io/alfresco-helm-charts/ + - name: activemq + version: 3.5.5 + repository: https://alfresco.github.io/alfresco-helm-charts/ + tags: + - ci + - name: postgresql + version: 12.5.6 + repository: oci://registry-1.docker.io/bitnamicharts + tags: + - ci diff --git a/charts/alfresco-connector-hxi/README.md b/charts/alfresco-connector-hxi/README.md new file mode 100644 index 00000000..a10317fa --- /dev/null +++ b/charts/alfresco-connector-hxi/README.md @@ -0,0 +1,155 @@ +--- +title: alfresco-connector-hxi +parent: Charts Reference +--- + +# alfresco-connector-hxi + +![Version: 0.1.0-alpha.0](https://img.shields.io/badge/Version-0.1.0--alpha.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) + +A Helm chart for deploying Alfresco connector hxi services + +Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs-deployment/blob/master/docs/helm/README.md) for an example of how to leverage this chart from an umbrella chart. + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| https://alfresco.github.io/alfresco-helm-charts/ | activemq | 3.5.5 | +| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.1.3 | +| oci://registry-1.docker.io/bitnamicharts | postgresql | 12.5.6 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| ats.existingConfigMap.keys.sfsUrl | string | `"SFS_URL"` | Key within the configmap holding the URL of the alfresco shared filestore | +| ats.existingConfigMap.keys.transformUrl | string | `"ATS_URL"` | Key within the configmap holding the URL of the alfresco transform | +| ats.existingConfigMap.name | string | `nil` | Alternatively, provide ATS details via an existing configmap | +| ats.sfsUrl | string | `nil` | URL of the alfresco shared filestore | +| ats.transformUrl | string | `nil` | URL of the alfresco transform (trouter or tengine-aio) | +| bulkIngester.affinity | object | `{}` | | +| bulkIngester.enabled | bool | `true` | | +| bulkIngester.environment.ALFRESCO_BULK_INGEST_PUBLISHER_ENDPOINT | string | `"activemq:queue:bulk-ingester-events"` | | +| bulkIngester.image.pullPolicy | string | `"IfNotPresent"` | | +| bulkIngester.image.repository | string | `"quay.io/alfresco/alfresco-hxinsight-connector-bulk-ingester"` | | +| bulkIngester.image.tag | string | `"1.0.0-A13"` | | +| bulkIngester.initContainers.waitForRepository.resources.limits.cpu | string | `"0.25"` | | +| bulkIngester.initContainers.waitForRepository.resources.limits.memory | string | `"10Mi"` | | +| bulkIngester.resources.limits.cpu | string | `"2"` | | +| bulkIngester.resources.limits.memory | string | `"512Mi"` | | +| bulkIngester.resources.requests.cpu | string | `"0.5"` | | +| bulkIngester.resources.requests.memory | string | `"128Mi"` | | +| db.existingConfigMap.keys.url | string | `"DATABASE_URL"` | Key within the configmap holding the full JDBC url to connect to database service | +| db.existingConfigMap.name | string | `nil` | Alternatively, provide database connection details via an existing configmap | +| db.existingSecret.keys.password | string | `"DATABASE_PASSWORD"` | Key within the secret holding the database password | +| db.existingSecret.keys.username | string | `"DATABASE_USERNAME"` | Key within the secret holding the database username | +| db.existingSecret.name | string | `nil` | Alternatively, provide database credentials via an existing secret | +| db.password | string | `nil` | The password required to access the service | +| db.url | string | `nil` | Provide the full JDBC url to connect to database service e.g.: `jdbc:postgresql://hostname:5432/database` | +| db.username | string | `nil` | The username required to access the service | +| fullnameOverride | string | `""` | | +| global.alfrescoRegistryPullSecrets | string | `"quay-registry-secret"` | | +| hxi.existingConfigMap.keys.hxAuthTokenUrl | string | `"HX_AUTH_TOKEN_URL"` | | +| hxi.existingConfigMap.keys.hxInsightIngestionUrl | string | `"HX_INSIGHT_INGESTION_URL"` | | +| hxi.existingConfigMap.keys.hxInsightPredictionsUrl | string | `"HX_INSIGHT_PREDICTIONS_URL"` | | +| hxi.existingConfigMap.name | string | `nil` | | +| hxi.existingSecret.keys.hxAppSourceId | string | `"HX_APP_SOURCE_ID"` | | +| hxi.existingSecret.keys.hxClientId | string | `"HX_CLIENT_ID"` | | +| hxi.existingSecret.keys.hxClientSecret | string | `"HX_CLIENT_SECRET"` | | +| hxi.existingSecret.keys.hxEnvKey | string | `"HX_ENV_KEY"` | | +| hxi.existingSecret.name | string | `nil` | | +| hxi.hxAppSourceId | string | `nil` | | +| hxi.hxAuthTokenUrl | string | `nil` | | +| hxi.hxClientId | string | `nil` | | +| hxi.hxClientSecret | string | `nil` | | +| hxi.hxEnvKey | string | `nil` | | +| hxi.hxInsightIngestionUrl | string | `nil` | | +| hxi.hxInsightPredictionsUrl | string | `nil` | | +| imagePullSecrets | list | `[]` | | +| liveIngester.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-connector-hxi.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"topology.kubernetes.io/zone"},"weight":10}` | Prefer to schedule the content pod on a different zone | +| liveIngester.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[1] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-connector-hxi.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"kubernetes.io/hostname"},"weight":5}` | Prefer to schedule the content pod on a different node | +| liveIngester.environment.ALFRESCO_BULKINGESTER_ENDPOINT | string | `"activemq:queue:bulk-ingester-events"` | | +| liveIngester.environment.SERVER_PORT | int | `8080` | | +| liveIngester.image.internalPort | int | `8080` | | +| liveIngester.image.pullPolicy | string | `"IfNotPresent"` | | +| liveIngester.image.repository | string | `"quay.io/alfresco/alfresco-hxinsight-connector-live-ingester"` | | +| liveIngester.image.tag | string | `"1.0.0-A13"` | | +| liveIngester.livenessProbe.httpGet.path | string | `"/actuator/health/liveness"` | | +| liveIngester.livenessProbe.httpGet.port | int | `8080` | | +| liveIngester.livenessProbe.initialDelaySeconds | int | `30` | | +| liveIngester.readinessProbe.httpGet.path | string | `"/actuator/health/readiness"` | | +| liveIngester.readinessProbe.httpGet.port | int | `8080` | | +| liveIngester.readinessProbe.initialDelaySeconds | int | `40` | | +| liveIngester.replicaCount | int | `1` | | +| liveIngester.resources.limits.cpu | string | `"2"` | | +| liveIngester.resources.limits.memory | string | `"2048Mi"` | | +| liveIngester.resources.requests.cpu | string | `"0.5"` | | +| liveIngester.resources.requests.memory | string | `"256Mi"` | | +| liveIngester.service.externalPort | int | `80` | | +| liveIngester.service.name | string | `"hxi-live-ingester-service"` | | +| liveIngester.service.type | string | `"ClusterIP"` | | +| liveIngester.strategy.rollingUpdate.maxSurge | int | `1` | | +| liveIngester.strategy.rollingUpdate.maxUnavailable | int | `0` | | +| messageBroker.existingConfigMap.keys.url | string | `"BROKER_URL"` | Key within the configmap holding the URL of the message broker | +| messageBroker.existingConfigMap.name | string | `nil` | Alternatively, provide message broker connection details via an existing configmap | +| messageBroker.existingSecret | object | `{"keys":{"password":"BROKER_PASSWORD","username":"BROKER_USERNAME"},"name":null}` | Provide connection details alternatively via an existing secret that contains BROKER_URL, BROKER_USERNAME and BROKER_PASSWORD keys | +| messageBroker.password | string | `nil` | Broker password | +| messageBroker.url | string | `nil` | Broker URL formatted as per: https://activemq.apache.org/failover-transport-reference | +| messageBroker.username | string | `nil` | Broker username | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podSecurityContext | object | `{}` | | +| predictionApplier.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-connector-hxi.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"topology.kubernetes.io/zone"},"weight":10}` | Prefer to schedule the content pod on a different zone | +| predictionApplier.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[1] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-connector-hxi.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"kubernetes.io/hostname"},"weight":5}` | Prefer to schedule the content pod on a different node | +| predictionApplier.enabled | bool | `true` | | +| predictionApplier.environment."HYLANDEXPERIENCE.INSIGHT.PREDICTIONS.BUFFERENDPOINT" | string | `"activemq:queue:predictions-buffer"` | | +| predictionApplier.environment."HYLANDEXPERIENCE.INSIGHT.PREDICTIONS.POLLPERIODMILLIS" | int | `300000` | | +| predictionApplier.environment.SERVER_PORT | int | `8080` | | +| predictionApplier.image.internalPort | int | `8080` | | +| predictionApplier.image.pullPolicy | string | `"IfNotPresent"` | | +| predictionApplier.image.repository | string | `"quay.io/alfresco/alfresco-hxinsight-connector-prediction-applier"` | | +| predictionApplier.image.tag | string | `"1.0.0-A13"` | | +| predictionApplier.livenessProbe.httpGet.path | string | `"/actuator/health/liveness"` | | +| predictionApplier.livenessProbe.httpGet.port | int | `8080` | | +| predictionApplier.livenessProbe.initialDelaySeconds | int | `30` | | +| predictionApplier.readinessProbe.httpGet.path | string | `"/actuator/health/readiness"` | | +| predictionApplier.readinessProbe.httpGet.port | int | `8080` | | +| predictionApplier.readinessProbe.initialDelaySeconds | int | `40` | | +| predictionApplier.replicaCount | int | `1` | | +| predictionApplier.resources.limits.cpu | string | `"2"` | | +| predictionApplier.resources.limits.memory | string | `"2048Mi"` | | +| predictionApplier.resources.requests.cpu | string | `"0.5"` | | +| predictionApplier.resources.requests.memory | string | `"256Mi"` | | +| predictionApplier.service.externalPort | int | `80` | | +| predictionApplier.service.name | string | `"hxi-prediction-applier-service"` | | +| predictionApplier.service.type | string | `"ClusterIP"` | | +| predictionApplier.strategy.rollingUpdate.maxSurge | int | `1` | | +| predictionApplier.strategy.rollingUpdate.maxUnavailable | int | `0` | | +| repository.authGrantType | string | `nil` | | +| repository.authTokenUrl | string | `nil` | | +| repository.authType | string | `nil` | | +| repository.clientId | string | `nil` | | +| repository.clientSecret | string | `nil` | | +| repository.existingConfigMap.keys.authGrantType | string | `"REPOSITORY_AUTH_GRANT_TYPE"` | | +| repository.existingConfigMap.keys.authTokenUrl | string | `"REPOSITORY_AUTH_TOKEN_URL"` | | +| repository.existingConfigMap.keys.authType | string | `"REPOSITORY_AUTH_TYPE"` | | +| repository.existingConfigMap.keys.url | string | `"REPOSITORY_URL"` | Key within the configmap holding the full url to connect to the alfresco repository | +| repository.existingConfigMap.keys.versionOverride | string | `"REPOSITORY_VERSION_OVERRIDE"` | | +| repository.existingConfigMap.name | string | `nil` | Alternatively, provide repository connection details via an existing configmap | +| repository.existingSecret.keys.clientId | string | `"REPOSITORY_CLIENT_ID"` | | +| repository.existingSecret.keys.clientSecret | string | `"REPOSITORY_CLIENT_SECRET"` | | +| repository.existingSecret.keys.password | string | `"REPOSITORY_PASSWORD"` | | +| repository.existingSecret.keys.username | string | `"REPOSITORY_USERNAME"` | | +| repository.existingSecret.name | string | `nil` | | +| repository.password | string | `nil` | | +| repository.url | string | `nil` | URL of the Alfresco repository | +| repository.username | string | `nil` | | +| repository.versionOverride | string | `nil` | | +| securityContext | object | `{}` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `"alfresco-connector-hxi-sa"` | | +| tags.ci | bool | `false` | A chart tag used for Hyland's CI purpose. Do not set it to true. | +| tolerations | list | `[]` | | diff --git a/charts/alfresco-connector-hxi/README.md.gotmpl b/charts/alfresco-connector-hxi/README.md.gotmpl new file mode 100644 index 00000000..53ced264 --- /dev/null +++ b/charts/alfresco-connector-hxi/README.md.gotmpl @@ -0,0 +1,23 @@ +--- +title: {{ template "chart.name" . }} +parent: Charts Reference +--- + +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs-deployment/blob/master/docs/helm/README.md) for an example of how to leverage this chart from an umbrella chart. + +{{ template "chart.homepageLine" . }} + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} diff --git a/charts/alfresco-connector-hxi/ci/default-values.yaml b/charts/alfresco-connector-hxi/ci/default-values.yaml new file mode 100644 index 00000000..822d894d --- /dev/null +++ b/charts/alfresco-connector-hxi/ci/default-values.yaml @@ -0,0 +1,51 @@ +liveIngester: + replicaCount: 1 + resources: + requests: + cpu: "0.01" + memory: "128Mi" + limits: + cpu: "1" + memory: "500Mi" + livenessProbe: null + readinessProbe: null +bulkIngester: + resources: + requests: + cpu: "0.01" + memory: "128Mi" + limits: + cpu: "1" + memory: "1Gi" +predictionApplier: + replicaCount: 1 + resources: + requests: + cpu: "0.01" + memory: "128Mi" + limits: + cpu: "1" + memory: "1Gi" + livenessProbe: null + readinessProbe: null +activemq: + fullnameOverride: activemq + resources: + requests: + cpu: "100m" + memory: "512Mi" + limits: + cpu: "1000m" + memory: "1Gi" +db: + url: jdbc:postgresql://postgresql:5432/postgres +messageBroker: + url: nio://activemq-broker:61616 +repository: + url: http://repository +ats: + sfsUrl: http://alfresco-transform-services-sfs +hxi: + hxInsightPredictionsUrl: http://hxi-predictions +tags: + ci: true diff --git a/charts/alfresco-connector-hxi/templates/_helpers-env-ats.tpl b/charts/alfresco-connector-hxi/templates/_helpers-env-ats.tpl new file mode 100644 index 00000000..97e975fc --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-env-ats.tpl @@ -0,0 +1,16 @@ +{{/* + +Usage: include "alfresco-connector-hxi.sfs.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.ats.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "ats")) "Chart" .Chart "Release" .Release }} +{{- with .Values.ats }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx) }} +- name: ALFRESCO_TRANSFORM_SHAREDFILESTORE_BASEURL + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.sfsUrl }} +{{- end -}} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/_helpers-env-connector-hxi.tpl b/charts/alfresco-connector-hxi/templates/_helpers-env-connector-hxi.tpl new file mode 100644 index 00000000..9daa1251 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-env-connector-hxi.tpl @@ -0,0 +1,84 @@ +{{/* + +Usage: include "alfresco-connector-hxi.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "")) "Chart" .Chart "Release" .Release }} +{{- with .Values.hxi }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx ) }} +- name: AUTH_PROVIDERS_HYLANDEXPERIENCE_TOKENURI + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.hxAuthTokenUrl }} +{{- end -}} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.live-ingester.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.live-ingester.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "")) "Chart" .Chart "Release" .Release }} +{{- with .Values.hxi }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx ) }} +{{- include "alfresco-connector-hxi.cm.env" $ }} +- name: HYLANDEXPERIENCE_INSIGHT_INGESTION_BASEURL + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.hxInsightIngestionUrl }} +{{- end -}} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.prediction-applier.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.prediction-applier.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "")) "Chart" .Chart "Release" .Release }} +{{- with .Values.hxi }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx ) }} +{{- include "alfresco-connector-hxi.cm.env" $ }} +- name: HYLANDEXPERIENCE_INSIGHT_PREDICTIONS_BASEURL + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.hxInsightPredictionsUrl }} +{{- end -}} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.secret.env" $ + +*/}} +{{- define "alfresco-connector-hxi.secret.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "")) "Chart" .Chart "Release" .Release }} +{{- with .Values.hxi }} +{{- $secretName := coalesce .existingSecret.name (include "alfresco-connector-hxi.fullname" $cmCtx ) }} +- name: AUTH_PROVIDERS_HYLANDEXPERIENCE_CLIENTID + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.hxClientId }} +- name: AUTH_PROVIDERS_HYLANDEXPERIENCE_CLIENTSECRET + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.hxClientSecret }} +- name: AUTH_PROVIDERS_HYLANDEXPERIENCE_ENVIRONMENTKEY + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.hxEnvKey }} +- name: APPLICATION_SOURCEID + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.hxAppSourceId }} +{{- end -}} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/_helpers-env-database.tpl b/charts/alfresco-connector-hxi/templates/_helpers-env-database.tpl new file mode 100644 index 00000000..fed1d37b --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-env-database.tpl @@ -0,0 +1,38 @@ +{{/* + +Usage: include "alfresco-connector-hxi.database.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.database.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "database")) "Chart" .Chart "Release" .Release }} +{{- with .Values.db }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx) }} +- name: SPRING_DATASOURCE_URL + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.url }} +{{- end -}} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.database.secret.env" $ + +*/}} +{{- define "alfresco-connector-hxi.database.secret.env" -}} +{{- $secretCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default .Chart.Name) "database")) "Chart" .Chart "Release" .Release }} +{{- with .Values.db }} +{{- $secretName := coalesce .existingSecret.name (include "alfresco-connector-hxi.fullname" $secretCtx) }} +- name: SPRING_DATASOURCE_USERNAME + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.username }} +- name: SPRING_DATASOURCE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.password }} +{{- end -}} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/_helpers-env-mq.tpl b/charts/alfresco-connector-hxi/templates/_helpers-env-mq.tpl new file mode 100644 index 00000000..2604bf5f --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-env-mq.tpl @@ -0,0 +1,47 @@ +{{/* + +Usage: include "alfresco-connector-hxi.activemq.url" $ + +*/}} +{{- define "alfresco-connector-hxi.activemq.url" -}} +{{- required "You need to provide an ActiveMQ URL using messageBroker.url or using an existingConfigMap check chart README file" $.Values.messageBroker.url }} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.activemq.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.activemq.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "mq")) "Chart" .Chart "Release" .Release }} +{{- with .Values.messageBroker }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx) }} +- name: SPRING_ACTIVEMQ_BROKERURL + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.url }} +{{- end -}} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.activemq.secret.env" $ + +*/}} +{{- define "alfresco-connector-hxi.activemq.secret.env" -}} +{{- $secretCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default .Chart.Name) "mq")) "Chart" .Chart "Release" .Release }} +{{- with .Values.messageBroker }} +{{- $secretName := coalesce .existingSecret.name (include "alfresco-connector-hxi.fullname" $secretCtx) }} +- name: SPRING_ACTIVEMQ_USER + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.username }} +- name: SPRING_ACTIVEMQ_PASSWORD + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.password }} +{{- end -}} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/_helpers-env-repository.tpl b/charts/alfresco-connector-hxi/templates/_helpers-env-repository.tpl new file mode 100644 index 00000000..b8c68e66 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-env-repository.tpl @@ -0,0 +1,68 @@ +{{/* + +Usage: include "alfresco-connector-hxi.repository.cm.env" $ + +*/}} +{{- define "alfresco-connector-hxi.repository.cm.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" .Chart "Release" .Release }} +{{- with .Values.repository }} +{{- $cmName := coalesce .existingConfigMap.name (include "alfresco-connector-hxi.fullname" $cmCtx) }} +- name: ALFRESCO_REPOSITORY_BASEURL + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.url }} +- name: AUTH_PROVIDERS_ALFRESCO_TYPE + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.authType }} +- name: AUTH_PROVIDERS_ALFRESCO_GRANTTYPE + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.authGrantType }} +- name: AUTH_PROVIDERS_ALFRESCO_TOKENURI + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.authTokenUrl }} +- name: ALFRESCO_REPOSITORY_VERSIONOVERRIDE + valueFrom: + configMapKeyRef: + name: {{ $cmName }} + key: {{ .existingConfigMap.keys.versionOverride }} +{{- end -}} +{{- end -}} + +{{/* + +Usage: include "alfresco-connector-hxi.repository.secret.env" $ + +*/}} +{{- define "alfresco-connector-hxi.repository.secret.env" -}} +{{- $cmCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" (.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" .Chart "Release" .Release }} +{{- with .Values.repository }} +{{- $secretName := coalesce .existingSecret.name (include "alfresco-connector-hxi.fullname" $cmCtx ) }} +- name: AUTH_PROVIDERS_ALFRESCO_USERNAME + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.username }} +- name: AUTH_PROVIDERS_ALFRESCO_PASSWORD + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.password }} +- name: AUTH_PROVIDERS_ALFRESCO_CLIENTID + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.clientId }} +- name: AUTH_PROVIDERS_ALFRESCO_CLIENTSECRET + valueFrom: + secretKeyRef: + name: {{ $secretName }} + key: {{ .existingSecret.keys.clientSecret }} +{{- end -}} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/_helpers-label.tpl b/charts/alfresco-connector-hxi/templates/_helpers-label.tpl new file mode 100644 index 00000000..73454550 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-label.tpl @@ -0,0 +1,29 @@ +{{- define "alfresco-connector-hxi.live-ingester.labels" -}} +{{- $scope := (dict "Values" (dict "nameOverride" (include "alfresco-connector-hxi.live-ingester.name" .)) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.labels" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.live-ingester.selectorLabels" -}} +{{- $scope := (dict "Values" (dict "nameOverride" (include "alfresco-connector-hxi.live-ingester.name" .)) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.selectorLabels" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.bulk-ingester.labels" -}} +{{- $scope := (dict "Values" (dict "nameOverride" (include "alfresco-connector-hxi.bulk-ingester.name" .)) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.labels" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.bulk-ingester.selectorLabels" -}} +{{- $scope := (dict "Values" (dict "nameOverride" (include "alfresco-connector-hxi.bulk-ingester.name" .)) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.selectorLabels" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.prediction-applier.labels" -}} +{{- $scope := (dict "Values" (dict "nameOverride" (include "alfresco-connector-hxi.prediction-applier.name" .)) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.labels" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.prediction-applier.selectorLabels" -}} +{{- $scope := (dict "Values" (dict "nameOverride" (include "alfresco-connector-hxi.prediction-applier.name" .)) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.selectorLabels" $scope }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/_helpers-name.tpl b/charts/alfresco-connector-hxi/templates/_helpers-name.tpl new file mode 100644 index 00000000..ff0aba50 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers-name.tpl @@ -0,0 +1,35 @@ +{{- define "alfresco-connector-hxi.live-ingester.name" -}} +{{- $component := printf "%s-%s" (include "alfresco-connector-hxi.name" .) "live-ingester" }} +{{- $scope := (dict "Values" (dict "nameOverride" $component ) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.name" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.live-ingester.fullname" -}} +{{- $component := include "alfresco-connector-hxi.live-ingester.name" . }} +{{- $scope := (dict "Values" (dict "nameOverride" $component ) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.fullname" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.bulk-ingester.name" -}} +{{- $component := printf "%s-%s" (include "alfresco-connector-hxi.name" .) "bulk-ingester" }} +{{- $scope := (dict "Values" (dict "nameOverride" $component ) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.name" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.bulk-ingester.fullname" -}} +{{- $component := include "alfresco-connector-hxi.bulk-ingester.name" . }} +{{- $scope := (dict "Values" (dict "nameOverride" $component ) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.fullname" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.prediction-applier.name" -}} +{{- $component := printf "%s-%s" (include "alfresco-connector-hxi.name" .) "prediction-applier" }} +{{- $scope := (dict "Values" (dict "nameOverride" $component ) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.name" $scope }} +{{- end }} + +{{- define "alfresco-connector-hxi.prediction-applier.fullname" -}} +{{- $component := include "alfresco-connector-hxi.prediction-applier.name" . }} +{{- $scope := (dict "Values" (dict "nameOverride" $component ) "Chart" .Chart "Release" .Release) }} +{{- include "alfresco-connector-hxi.fullname" $scope }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/_helpers.tpl b/charts/alfresco-connector-hxi/templates/_helpers.tpl new file mode 100644 index 00000000..97ccf6b3 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "alfresco-connector-hxi.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- 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). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "alfresco-connector-hxi.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} +{{/* +Create chart name and version as used by the chart label. +*/}} + +{{- define "alfresco-connector-hxi.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "alfresco-connector-hxi.labels" -}} +helm.sh/chart: {{ include "alfresco-connector-hxi.chart" . }} +{{ include "alfresco-connector-hxi.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/component: {{ .Chart.Name }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "alfresco-connector-hxi.selectorLabels" -}} +app.kubernetes.io/name: {{ include "alfresco-connector-hxi.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "alfresco-connector-hxi.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "alfresco-connector-hxi.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/configmap-ats.yaml b/charts/alfresco-connector-hxi/templates/configmap-ats.yaml new file mode 100644 index 00000000..94f095ec --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/configmap-ats.yaml @@ -0,0 +1,11 @@ +{{- if not .Values.ats.existingConfigMap.name }} +apiVersion: v1 +kind: ConfigMap +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "ats")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +data: + SFS_URL: {{ required "You need to provide the SFS URL using either ats.sfsUrl value or a configmap" .Values.ats.sfsUrl }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/configmap-connector-hxi.yaml b/charts/alfresco-connector-hxi/templates/configmap-connector-hxi.yaml new file mode 100644 index 00000000..d6213efb --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/configmap-connector-hxi.yaml @@ -0,0 +1,12 @@ +{{- if not .Values.hxi.existingConfigMap.name -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "alfresco-connector-hxi.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +data: + HX_AUTH_TOKEN_URL: {{ .Values.hxi.hxAuthTokenUrl | default "" | quote }} + HX_INSIGHT_INGESTION_URL: {{ .Values.hxi.hxInsightIngestionUrl | default "" | quote }} + HX_INSIGHT_PREDICTIONS_URL: {{ .Values.hxi.hxInsightPredictionsUrl | default "" | quote }} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/configmap-database.yaml b/charts/alfresco-connector-hxi/templates/configmap-database.yaml new file mode 100644 index 00000000..2af317c7 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/configmap-database.yaml @@ -0,0 +1,11 @@ +{{- if and .Values.bulkIngester.enabled (not .Values.db.existingConfigMap.name) }} +apiVersion: v1 +kind: ConfigMap +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "database")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +data: + DATABASE_URL: {{ required "Specifying DB URL is mandatory when not using existingConfigMap" .Values.db.url }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/configmap-mq.yaml b/charts/alfresco-connector-hxi/templates/configmap-mq.yaml new file mode 100644 index 00000000..6498b11d --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/configmap-mq.yaml @@ -0,0 +1,11 @@ +{{- if not .Values.messageBroker.existingConfigMap.name -}} +apiVersion: v1 +kind: ConfigMap +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "mq")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +data: + {{ template "alfresco-common.activemq.cm" (include "alfresco-connector-hxi.activemq.url" .) }} +{{- end -}} diff --git a/charts/alfresco-connector-hxi/templates/configmap-repository.yaml b/charts/alfresco-connector-hxi/templates/configmap-repository.yaml new file mode 100644 index 00000000..68d9cb11 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/configmap-repository.yaml @@ -0,0 +1,15 @@ +{{- if not .Values.repository.existingConfigMap.name -}} +apiVersion: v1 +kind: ConfigMap +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +data: + REPOSITORY_URL: {{ .Values.repository.url | default "" | quote }} + REPOSITORY_AUTH_TYPE: {{ .Values.repository.authType | default "basic" | quote }} + REPOSITORY_AUTH_GRANT_TYPE: {{ .Values.repository.authGrantType | default "" | quote }} + REPOSITORY_AUTH_TOKEN_URL: {{ .Values.repository.authTokenUrl | default "" | quote }} + REPOSITORY_VERSION_OVERRIDE: {{ .Values.repository.versionOverride | default "" | quote }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/deployment-connector-hxi-live-ingester.yaml b/charts/alfresco-connector-hxi/templates/deployment-connector-hxi-live-ingester.yaml new file mode 100644 index 00000000..ea5e37c5 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/deployment-connector-hxi-live-ingester.yaml @@ -0,0 +1,68 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "alfresco-connector-hxi.live-ingester.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.live-ingester.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.liveIngester.replicaCount | default 1 }} + selector: + matchLabels: + {{- include "alfresco-connector-hxi.live-ingester.selectorLabels" . | nindent 6 }} + strategy: + type: RollingUpdate + rollingUpdate: + {{- toYaml .Values.liveIngester.strategy.rollingUpdate | nindent 6 }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap-connector-hxi.yaml") $ | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/secret-connector-hxi.yaml") $ | sha256sum }} + checksum/secret-broker: {{ include (print $.Template.BasePath "/secret-mq.yaml") $ | sha256sum }} + {{- with $.Values.podAnnotations }} + {{- toYaml $ | nindent 8 }} + {{- end }} + labels: + {{- include "alfresco-connector-hxi.live-ingester.labels" . | nindent 8 }} + spec: + {{- include "alfresco-common.imagePullSecrets" . | indent 6 }} + serviceAccountName: {{ include "alfresco-connector-hxi.serviceAccountName" . }} + {{- include "alfresco-common.component-pod-security-context" .Values | indent 4 }} + containers: + - name: {{ include "alfresco-connector-hxi.live-ingester.name" . }} + image: {{ printf "%s:%s" .Values.liveIngester.image.repository .Values.liveIngester.image.tag | quote }} + imagePullPolicy: {{ .Values.liveIngester.image.pullPolicy }} + {{- include "alfresco-common.component-security-context" .Values | indent 8 }} + env: + {{- include "alfresco-connector-hxi.activemq.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.activemq.secret.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.ats.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.repository.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.repository.secret.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.live-ingester.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.secret.env" . | indent 12 }} + {{- range $key, $val := $.Values.liveIngester.environment }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} + ports: + - containerPort: {{ .Values.liveIngester.image.internalPort }} + resources: + {{- toYaml .Values.liveIngester.resources | nindent 12 }} + livenessProbe: + {{- toYaml .Values.liveIngester.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.liveIngester.readinessProbe | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.liveIngester.affinity }} + affinity: + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/alfresco-connector-hxi/templates/deployment-connector-hxi-prediction-applier.yaml b/charts/alfresco-connector-hxi/templates/deployment-connector-hxi-prediction-applier.yaml new file mode 100644 index 00000000..3d2fca53 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/deployment-connector-hxi-prediction-applier.yaml @@ -0,0 +1,69 @@ +--- +{{- if .Values.predictionApplier.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "alfresco-connector-hxi.prediction-applier.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.prediction-applier.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.predictionApplier.replicaCount | default 1 }} + selector: + matchLabels: + {{- include "alfresco-connector-hxi.prediction-applier.selectorLabels" . | nindent 6 }} + strategy: + type: RollingUpdate + rollingUpdate: + {{- toYaml .Values.predictionApplier.strategy.rollingUpdate | nindent 6 }} + template: + metadata: + annotations: + checksum/config: {{ include (print $.Template.BasePath "/configmap-connector-hxi.yaml") $ | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/secret-connector-hxi.yaml") $ | sha256sum }} + checksum/secret-broker: {{ include (print $.Template.BasePath "/secret-mq.yaml") $ | sha256sum }} + {{- with $.Values.podAnnotations }} + {{- toYaml $ | nindent 8 }} + {{- end }} + labels: + {{- include "alfresco-connector-hxi.prediction-applier.labels" . | nindent 8 }} + spec: + {{- include "alfresco-common.imagePullSecrets" . | indent 6 }} + serviceAccountName: {{ include "alfresco-connector-hxi.serviceAccountName" . }} + {{- include "alfresco-common.component-pod-security-context" .Values | indent 4 }} + containers: + - name: {{ include "alfresco-connector-hxi.prediction-applier.name" . }} + image: {{ printf "%s:%s" .Values.predictionApplier.image.repository .Values.predictionApplier.image.tag | quote }} + imagePullPolicy: {{ .Values.predictionApplier.image.pullPolicy }} + {{- include "alfresco-common.component-security-context" .Values | indent 8 }} + env: + {{- include "alfresco-connector-hxi.activemq.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.activemq.secret.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.repository.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.repository.secret.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.prediction-applier.cm.env" . | indent 12 }} + {{- include "alfresco-connector-hxi.secret.env" . | indent 12 }} + {{- range $key, $val := $.Values.predictionApplier.environment }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} + ports: + - containerPort: {{ .Values.predictionApplier.image.internalPort }} + resources: + {{- toYaml .Values.predictionApplier.resources | nindent 12 }} + livenessProbe: + {{- toYaml .Values.predictionApplier.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.predictionApplier.readinessProbe | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.predictionApplier.affinity }} + affinity: + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{ end }} diff --git a/charts/alfresco-connector-hxi/templates/job-connector-hxi-bulk-ingester.yaml b/charts/alfresco-connector-hxi/templates/job-connector-hxi-bulk-ingester.yaml new file mode 100644 index 00000000..838706fd --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/job-connector-hxi-bulk-ingester.yaml @@ -0,0 +1,79 @@ +{{- if .Values.bulkIngester.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "alfresco-connector-hxi.bulk-ingester.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.bulk-ingester.labels" $ | nindent 4 }} +spec: + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "alfresco-connector-hxi.bulk-ingester.labels" . | nindent 8 }} + spec: + serviceAccountName: {{ include "alfresco-connector-hxi.serviceAccountName" . }} + {{- include "alfresco-common.component-pod-security-context" .Values | indent 4 }} + {{- include "alfresco-common.imagePullSecrets" . | indent 6 }} + restartPolicy: Never + containers: + - name: {{ include "alfresco-connector-hxi.bulk-ingester.name" . }} + image: {{ printf "%s:%s" .Values.bulkIngester.image.repository .Values.bulkIngester.image.tag | quote }} + imagePullPolicy: {{ .Values.bulkIngester.image.pullPolicy }} + {{- include "alfresco-common.component-security-context" .Values | indent 8 }} + resources: {{- toYaml .Values.bulkIngester.resources | nindent 12 }} + env: + {{- $dbCtx := dict "Values" (dict "nameOverride" "alfresco-database") "Chart" .Chart "Release" .Release }} + {{- $dbFullName := (include "alfresco-connector-hxi.fullname" $dbCtx) }} + {{- include "alfresco-connector-hxi.database.cm.env" $ | indent 12 }} + {{- include "alfresco-connector-hxi.database.secret.env" $ | indent 12 }} + {{- include "alfresco-connector-hxi.activemq.cm.env" $ | indent 12 }} + {{- include "alfresco-connector-hxi.activemq.secret.env" $ | indent 12 }} + {{- range $key, $val := $.Values.bulkIngester.environment }} + - name: {{ $key }} + value: {{ $val | quote }} + {{- end }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + initContainers: + - name: wait-for-repository + image: curlimages/curl:7.79.1 + {{- include "alfresco-common.component-security-context" .Values | indent 8 }} + resources: {{- toYaml .Values.bulkIngester.initContainers.waitForRepository.resources | nindent 12 }} + env: + {{- $repoCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" $.Chart "Release" $.Release }} + {{- $repoCm := coalesce .Values.repository.existingConfigMap.name (include "alfresco-connector-hxi.fullname" $repoCtx) }} + - name: REPOSITORY_URL + valueFrom: + configMapKeyRef: + name: {{ $repoCm }} + key: {{ .Values.repository.existingConfigMap.keys.url }} + command: ["/bin/sh", "-c"] + # Delay running the reindexing to give Alfresco Repository a chance to initialise its database + args: + - | + while [ $(curl -sw '%{http_code}' ${REPOSITORY_URL}/api/-default-/public/alfresco/versions/1/probes/-ready- -o /dev/null) -ne 200 ] + do echo "Waiting for the Alfresco repository to come up at $REPOSITORY_URL ..." + sleep 5 + done + echo 'Alfresco is ready, delay reindexing to give a chance to fully initialise.' + sleep 30 + echo 'Bulk ingesting started!' + {{- with $.Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $.Values.bulkIngester.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with $.Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{ end }} diff --git a/charts/alfresco-connector-hxi/templates/secret-connector-hxi.yaml b/charts/alfresco-connector-hxi/templates/secret-connector-hxi.yaml new file mode 100644 index 00000000..6ed0c525 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/secret-connector-hxi.yaml @@ -0,0 +1,14 @@ +{{- if not .Values.hxi.existingSecret.name }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "alfresco-connector-hxi.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +type: Opaque +data: + HX_CLIENT_ID: {{ .Values.hxi.hxClientId | default "" | b64enc | quote }} + HX_CLIENT_SECRET: {{ .Values.hxi.hxClientSecret | default "" | b64enc | quote }} + HX_ENV_KEY: {{ .Values.hxi.hxEnvKey | default "" | b64enc | quote }} + HX_APP_SOURCE_ID: {{ .Values.hxi.hxAppSourceId | default "" | b64enc | quote }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/secret-database.yaml b/charts/alfresco-connector-hxi/templates/secret-database.yaml new file mode 100644 index 00000000..356247e4 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/secret-database.yaml @@ -0,0 +1,13 @@ +{{- if and .Values.bulkIngester.enabled (not .Values.db.existingSecret.name) }} +apiVersion: v1 +kind: Secret +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "database")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" $ | nindent 4 }} +type: Opaque +data: + DATABASE_USERNAME: {{ .Values.db.username | default "" | b64enc | quote }} + DATABASE_PASSWORD: {{ .Values.db.password | default "" | b64enc | quote }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/secret-mq.yaml b/charts/alfresco-connector-hxi/templates/secret-mq.yaml new file mode 100644 index 00000000..59fbc968 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/secret-mq.yaml @@ -0,0 +1,13 @@ +{{- if not .Values.messageBroker.existingSecret.name }} +apiVersion: v1 +kind: Secret +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "mq")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +type: Opaque +data: + BROKER_USERNAME: {{ .Values.messageBroker.username | default "" | b64enc | quote }} + BROKER_PASSWORD: {{ .Values.messageBroker.password | default "" | b64enc | quote }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/secret-repository.yaml b/charts/alfresco-connector-hxi/templates/secret-repository.yaml new file mode 100644 index 00000000..24437991 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/secret-repository.yaml @@ -0,0 +1,14 @@ +{{- if not .Values.repository.existingSecret.name -}} +apiVersion: v1 +kind: Secret +metadata: + {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" $.Chart "Release" $.Release }} + name: {{ template "alfresco-connector-hxi.fullname" $ctx }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} +data: + REPOSITORY_USERNAME: {{ .Values.repository.username | default "" | b64enc | quote }} + REPOSITORY_PASSWORD: {{ .Values.repository.password | default "" | b64enc | quote }} + REPOSITORY_CLIENT_ID: {{ .Values.repository.clientId | default "" | b64enc | quote }} + REPOSITORY_CLIENT_SECRET: {{ .Values.repository.clientSecret | default "" | b64enc | quote }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/serviceaccount.yaml b/charts/alfresco-connector-hxi/templates/serviceaccount.yaml new file mode 100644 index 00000000..8f27e159 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "alfresco-connector-hxi.serviceAccountName" . }} + labels: + {{- include "alfresco-connector-hxi.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/alfresco-connector-hxi/templates/svc-connector-hxi-live-ingester.yaml b/charts/alfresco-connector-hxi/templates/svc-connector-hxi-live-ingester.yaml new file mode 100644 index 00000000..c0a5a11f --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/svc-connector-hxi-live-ingester.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "alfresco-connector-hxi.live-ingester.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.live-ingester.labels" . | nindent 4 }} +spec: + type: {{ .Values.liveIngester.service.type }} + ports: + - port: {{ .Values.liveIngester.service.externalPort }} + targetPort: {{ .Values.liveIngester.image.internalPort }} + name: {{ .Values.liveIngester.service.name }} + selector: + {{- include "alfresco-connector-hxi.live-ingester.selectorLabels" . | nindent 4 }} diff --git a/charts/alfresco-connector-hxi/templates/svc-connector-hxi-prediction-applier.yaml b/charts/alfresco-connector-hxi/templates/svc-connector-hxi-prediction-applier.yaml new file mode 100644 index 00000000..9bfc5a66 --- /dev/null +++ b/charts/alfresco-connector-hxi/templates/svc-connector-hxi-prediction-applier.yaml @@ -0,0 +1,16 @@ +{{- if .Values.predictionApplier.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ template "alfresco-connector-hxi.prediction-applier.fullname" . }} + labels: + {{- include "alfresco-connector-hxi.prediction-applier.labels" . | nindent 4 }} +spec: + type: {{ .Values.predictionApplier.service.type }} + ports: + - port: {{ .Values.predictionApplier.service.externalPort }} + targetPort: {{ .Values.predictionApplier.image.internalPort }} + name: {{ .Values.predictionApplier.service.name }} + selector: + {{- include "alfresco-connector-hxi.prediction-applier.selectorLabels" . | nindent 4 }} +{{ end }} diff --git a/charts/alfresco-connector-hxi/values.yaml b/charts/alfresco-connector-hxi/values.yaml new file mode 100644 index 00000000..5483aff2 --- /dev/null +++ b/charts/alfresco-connector-hxi/values.yaml @@ -0,0 +1,307 @@ +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" +podAnnotations: {} +podSecurityContext: {} +securityContext: {} +nodeSelector: {} +tolerations: [] +liveIngester: + image: + repository: quay.io/alfresco/alfresco-hxinsight-connector-live-ingester + tag: 1.0.0-A13 + pullPolicy: IfNotPresent + internalPort: &liveIngesterPort 8080 + replicaCount: 1 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + resources: + requests: + cpu: "0.5" + memory: "256Mi" + limits: + cpu: "2" + memory: "2048Mi" + environment: + SERVER_PORT: *liveIngesterPort + ALFRESCO_BULKINGESTER_ENDPOINT: activemq:queue:bulk-ingester-events + livenessProbe: + initialDelaySeconds: 30 + httpGet: + path: /actuator/health/liveness + port: *liveIngesterPort + readinessProbe: + initialDelaySeconds: 40 + httpGet: + path: /actuator/health/readiness + port: *liveIngesterPort + service: + name: hxi-live-ingester-service + type: ClusterIP + externalPort: 80 + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + # -- Prefer to schedule the content pod on a different zone + - weight: 10 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - >- + {{ template "alfresco-connector-hxi.name" $ }} + - key: app.kubernetes.io/instance + operator: In + values: + - "{{ $.Release.Name }}" + - key: app.kubernetes.io/component + operator: In + values: + - "{{ $.Chart.Name }}" + topologyKey: topology.kubernetes.io/zone + # -- Prefer to schedule the content pod on a different node + - weight: 5 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - >- + {{ template "alfresco-connector-hxi.name" $ }} + - key: app.kubernetes.io/instance + operator: In + values: + - "{{ $.Release.Name }}" + - key: app.kubernetes.io/component + operator: In + values: + - "{{ $.Chart.Name }}" + topologyKey: kubernetes.io/hostname +bulkIngester: + enabled: true + image: + repository: quay.io/alfresco/alfresco-hxinsight-connector-bulk-ingester + tag: 1.0.0-A13 + pullPolicy: IfNotPresent + resources: + requests: + cpu: "0.5" + memory: "128Mi" + limits: + cpu: "2" + memory: "512Mi" + environment: + ALFRESCO_BULK_INGEST_PUBLISHER_ENDPOINT: activemq:queue:bulk-ingester-events + initContainers: + waitForRepository: + resources: + limits: + cpu: "0.25" + memory: "10Mi" + affinity: {} +predictionApplier: + enabled: true + image: + repository: quay.io/alfresco/alfresco-hxinsight-connector-prediction-applier + tag: 1.0.0-A13 + pullPolicy: IfNotPresent + internalPort: &predictionApplierPort 8080 + replicaCount: 1 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + resources: + requests: + cpu: "0.5" + memory: "256Mi" + limits: + cpu: "2" + memory: "2048Mi" + environment: + SERVER_PORT: *predictionApplierPort + HYLANDEXPERIENCE.INSIGHT.PREDICTIONS.BUFFERENDPOINT: activemq:queue:predictions-buffer + HYLANDEXPERIENCE.INSIGHT.PREDICTIONS.POLLPERIODMILLIS: 300000 + livenessProbe: + initialDelaySeconds: 30 + httpGet: + path: /actuator/health/liveness + port: *predictionApplierPort + readinessProbe: + initialDelaySeconds: 40 + httpGet: + path: /actuator/health/readiness + port: *predictionApplierPort + service: + name: hxi-prediction-applier-service + type: ClusterIP + externalPort: 80 + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + # -- Prefer to schedule the content pod on a different zone + - weight: 10 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - >- + {{ template "alfresco-connector-hxi.name" $ }} + - key: app.kubernetes.io/instance + operator: In + values: + - "{{ $.Release.Name }}" + - key: app.kubernetes.io/component + operator: In + values: + - "{{ $.Chart.Name }}" + topologyKey: topology.kubernetes.io/zone + # -- Prefer to schedule the content pod on a different node + - weight: 5 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - >- + {{ template "alfresco-connector-hxi.name" $ }} + - key: app.kubernetes.io/instance + operator: In + values: + - "{{ $.Release.Name }}" + - key: app.kubernetes.io/component + operator: In + values: + - "{{ $.Chart.Name }}" + topologyKey: kubernetes.io/hostname +db: + # -- Provide the full JDBC url to connect to database service e.g.: + # `jdbc:postgresql://hostname:5432/database` + url: null + # -- The username required to access the service + username: null + # -- The password required to access the service + password: null + existingSecret: + # -- Alternatively, provide database credentials via an existing secret + name: null + keys: + # -- Key within the secret holding the database username + username: DATABASE_USERNAME + # -- Key within the secret holding the database password + password: DATABASE_PASSWORD + existingConfigMap: + # -- Alternatively, provide database connection details via an existing + # configmap + name: null + keys: + # -- Key within the configmap holding the full JDBC url to connect to + # database service + url: DATABASE_URL +messageBroker: + # -- Broker URL formatted as per: + # https://activemq.apache.org/failover-transport-reference + url: null + # -- Broker username + username: null + # -- Broker password + password: null + existingConfigMap: + # -- Alternatively, provide message broker connection details via an existing + # configmap + name: null + keys: + # -- Key within the configmap holding the URL of the message broker + url: BROKER_URL + # -- Provide connection details alternatively via an existing secret that + # contains BROKER_URL, BROKER_USERNAME and BROKER_PASSWORD keys + existingSecret: + name: null + keys: + username: BROKER_USERNAME + password: BROKER_PASSWORD +repository: + # -- URL of the Alfresco repository + url: null + authType: null + authGrantType: null + authTokenUrl: null + username: null + password: null + clientId: null + clientSecret: null + versionOverride: null + existingConfigMap: + # -- Alternatively, provide repository connection details via an existing + # configmap + name: null + keys: + # -- Key within the configmap holding the full url to connect to the + # alfresco repository + url: REPOSITORY_URL + authType: REPOSITORY_AUTH_TYPE + authGrantType: REPOSITORY_AUTH_GRANT_TYPE + authTokenUrl: REPOSITORY_AUTH_TOKEN_URL + versionOverride: REPOSITORY_VERSION_OVERRIDE + existingSecret: + name: null + keys: + username: REPOSITORY_USERNAME + password: REPOSITORY_PASSWORD + clientId: REPOSITORY_CLIENT_ID + clientSecret: REPOSITORY_CLIENT_SECRET +ats: + # -- URL of the alfresco transform (trouter or tengine-aio) + transformUrl: null + # -- URL of the alfresco shared filestore + sfsUrl: null + existingConfigMap: + # -- Alternatively, provide ATS details via an existing configmap + name: null + keys: + # -- Key within the configmap holding the URL of the alfresco transform + transformUrl: ATS_URL + # -- Key within the configmap holding the URL of the alfresco shared filestore + sfsUrl: SFS_URL +hxi: + hxAuthTokenUrl: null + hxInsightIngestionUrl: null + hxInsightPredictionsUrl: null + hxClientId: null + hxClientSecret: null + hxEnvKey: null + hxAppSourceId: null + existingConfigMap: + name: null + keys: + hxAuthTokenUrl: HX_AUTH_TOKEN_URL + hxInsightIngestionUrl: HX_INSIGHT_INGESTION_URL + hxInsightPredictionsUrl: HX_INSIGHT_PREDICTIONS_URL + existingSecret: + name: null + keys: + hxClientId: HX_CLIENT_ID + hxClientSecret: HX_CLIENT_SECRET + hxEnvKey: HX_ENV_KEY + hxAppSourceId: HX_APP_SOURCE_ID +serviceAccount: + # Specifies whether a service account should be created + create: true + # 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: "alfresco-connector-hxi-sa" +global: + alfrescoRegistryPullSecrets: quay-registry-secret +tags: + # -- A chart tag used for Hyland's CI purpose. Do not set it to true. + ci: false