Skip to content

Commit

Permalink
Merge pull request #86 from xenit-eu/OUPDAUNTLE-86
Browse files Browse the repository at this point in the history
Option to merge Share and ACS into 1 pod (sticky session workaround)
  • Loading branch information
JoostDeCupere authored Aug 28, 2023
2 parents 6103864 + 8a8ff27 commit 58adf71
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 44 additions & 0 deletions xenit-alfresco/templates/acs/acs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
9 changes: 9 additions & 0 deletions xenit-alfresco/templates/share/share-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion xenit-alfresco/templates/share/share-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.share.enabled -}}
{{- if and (.Values.share.enabled) ( not .Values.share.mergeAcsShare) }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
9 changes: 9 additions & 0 deletions xenit-alfresco/templates/share/share-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions xenit-alfresco/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ digitalWorkspace:

share:
enabled: true
mergeAcsShare: false
replicas: 1
image:
registry: 'docker.io'
Expand Down

0 comments on commit 58adf71

Please sign in to comment.