diff --git a/README.md b/README.md index 342ba6c..51d1459 100644 --- a/README.md +++ b/README.md @@ -658,6 +658,13 @@ For more information take a look at * Default: `true` * Description: Enable or disable the share +#### `share.mergeAcsShare` + +* Required: false +* Default: false +* Description: If set to `true` the Share container will be installed inside the ACS pod. + + #### `share.replicas` * Required: false diff --git a/xenit-alfresco/templates/acs/acs-deployment.yaml b/xenit-alfresco/templates/acs/acs-deployment.yaml index 18d760d..3d4b362 100644 --- a/xenit-alfresco/templates/acs/acs-deployment.yaml +++ b/xenit-alfresco/templates/acs/acs-deployment.yaml @@ -25,6 +25,12 @@ spec: checksum/acs-config: {{ include (print $.Template.BasePath "/acs/acs-config.yaml") . | sha256sum }} checksum/mq-secret: {{ include (print $.Template.BasePath "/active-mq/mq-secret.yaml") . | sha256sum }} checksum/db-secret: {{ include (print $.Template.BasePath "/db-secret.yaml") . | sha256sum }} + {{- if .Values.share.mergeAcsShare }} + checksum/share-config: {{ include (print $.Template.BasePath "/share/share-config.yaml") . | sha256sum }} + {{- if .Values.share.podAnnotations }} + {{ toYaml .Values.share.podAnnotations | nindent 8 }} + {{- end }} + {{- end }} {{- include "globalPodAnnotations" . | indent 8 }} {{- if .Values.acs.podAnnotations }} {{ toYaml .Values.acs.podAnnotations | nindent 8 }} @@ -105,6 +111,39 @@ spec: subPath: {{ .subPath }} {{- end }} {{- end }} + {{- if .Values.share.mergeAcsShare}} + - name: share-container + image: {{ .Values.share.image.registry }}/{{ .Values.share.image.repository }}:{{ .Values.share.image.tag }} + imagePullPolicy: {{ .Values.share.imagePullPolicy | default "IfNotPresent" }} + lifecycle: + preStop: + exec: + command: + - /bin/bash + - -c + - sleep 20 + envFrom: + - configMapRef: + name: share-configmap + {{- if .Values.share.envFrom }} + {{ toYaml .Values.share.envFrom | nindent 10 }} + {{- end }} + ports: + - containerPort: 8082 + # when running together with acs we fix containerport for share to 8082, see also TOMCAT-PORT + protocol: TCP + {{- if or (.Values.share.resources.requests) ((.Values.share.resources.limits)) }} + resources: + {{- if .Values.share.resources.requests }} + requests: + {{ toYaml .Values.share.resources.requests | nindent 12 }} + {{- end }} + {{- if .Values.share.resources.limits }} + limits: + {{ toYaml .Values.share.resources.limits | nindent 12 }} + {{- end }} + {{- end }} + {{- end }} volumes: {{- if .Values.persistentStorage.alfresco.enabled }} - name: data @@ -124,4 +163,9 @@ spec: {{- end }} {{- if .Values.acs.imagePullSecrets}} {{ toYaml .Values.acs.imagePullSecrets | nindent 8 }} + {{- end }} + {{- if .Values.share.mergeAcsShare}} + {{- if .Values.share.imagePullSecrets }} + {{ toYaml .Values.share.imagePullSecrets | nindent 8 }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/xenit-alfresco/templates/share/share-config.yaml b/xenit-alfresco/templates/share/share-config.yaml index feaab5f..031f421 100644 --- a/xenit-alfresco/templates/share/share-config.yaml +++ b/xenit-alfresco/templates/share/share-config.yaml @@ -7,11 +7,20 @@ metadata: labels: app: share data: + {{- if .Values.share.mergeAcsShare }} + ALFRESCO_INTERNAL_HOST: 'localhost' + ALFRESCO_INTERNAL_PORT: '8080' + {{- else }} ALFRESCO_INTERNAL_HOST: 'acs-service' ALFRESCO_INTERNAL_PORT: '30000' + {{- end }} ALFRESCO_HOST: {{ .Values.ingress.host }} ALFRESCO_PORT: '443' ALFRESCO_PROTOCOL: 'https' + {{- if .Values.share.mergeAcsShare }} + TOMCAT_PORT: '8082' + TOMCAT_SERVER_PORT: '8099' + {{- end }} {{- if .Values.share.additionalEnvironmentVariables }} {{ toYaml .Values.share.additionalEnvironmentVariables | nindent 2 }} {{- end }} diff --git a/xenit-alfresco/templates/share/share-deployment.yaml b/xenit-alfresco/templates/share/share-deployment.yaml index 65928d5..203ed52 100644 --- a/xenit-alfresco/templates/share/share-deployment.yaml +++ b/xenit-alfresco/templates/share/share-deployment.yaml @@ -1,4 +1,4 @@ -{{- if .Values.share.enabled -}} +{{- if and (.Values.share.enabled) ( not .Values.share.mergeAcsShare) }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/xenit-alfresco/templates/share/share-service.yaml b/xenit-alfresco/templates/share/share-service.yaml index 682bd68..b575eda 100644 --- a/xenit-alfresco/templates/share/share-service.yaml +++ b/xenit-alfresco/templates/share/share-service.yaml @@ -10,11 +10,20 @@ metadata: {{- end }} spec: selector: + {{- if .Values.share.mergeAcsShare }} + app: acs + {{- else }} app: share + {{- end }} ports: - protocol: TCP port: 30100 + {{- if .Values.share.mergeAcsShare }} + targetPort: 8082 + {{- else }} targetPort: 8080 + {{- end }} + {{- if .Values.general.serviceType }} type: {{ .Values.general.serviceType }} {{- end }} diff --git a/xenit-alfresco/values.yaml b/xenit-alfresco/values.yaml index b91e2d3..88ed930 100644 --- a/xenit-alfresco/values.yaml +++ b/xenit-alfresco/values.yaml @@ -77,6 +77,7 @@ digitalWorkspace: share: enabled: true + mergeAcsShare: false replicas: 1 image: registry: 'docker.io'