From 73892ae804b638717a4ca112ad33005a9a390327 Mon Sep 17 00:00:00 2001 From: maartenboonen Date: Wed, 7 Aug 2024 09:54:42 +0200 Subject: [PATCH] XENOPS-1187 flag that disables enterprise functionality on community version --- README.md | 9 +++++++++ xenit-alfresco/templates/acs/acs-config.yaml | 2 +- xenit-alfresco/templates/acs/acs-deployment.yaml | 4 ++++ xenit-alfresco/templates/acs/acs-hpa.yaml | 2 +- .../digital-workspace/digital-workspace-config.yaml | 2 +- .../digital-workspace/digital-workspace-deployment.yaml | 2 +- .../digital-workspace/digital-workspace-service.yaml | 2 +- .../shared-file-store/network-policy.yml | 2 +- .../shared-file-store/shared-file-store-config.yaml | 2 +- .../shared-file-store/shared-file-store-deployment.yaml | 2 +- .../shared-file-store/shared-file-store-service.yaml | 2 +- .../transform-router/network-policy.yml | 2 +- .../transform-router/transform-router-config.yaml | 2 +- .../transform-router/transform-router-deployment.yaml | 2 +- .../transform-router/transform-router-service.yaml | 2 +- xenit-alfresco/values.yaml | 1 + 16 files changed, 27 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 140095e..4bd0c23 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,15 @@ For more information take a look at ### General +#### `general.enterprise` + +* Required: false +* Default: false +* Description: Whether this is an enterprise version of Alfresco. In a community version Transform Service Router, +Transform Service Shared File Storage, Clustering (replica count should always have a max of 1 for ACS pods) and +Digital Workspace are disabled. + + #### `general.strategy` * Required: false diff --git a/xenit-alfresco/templates/acs/acs-config.yaml b/xenit-alfresco/templates/acs/acs-config.yaml index c1c79a8..f3b68dc 100644 --- a/xenit-alfresco/templates/acs/acs-config.yaml +++ b/xenit-alfresco/templates/acs/acs-config.yaml @@ -24,7 +24,7 @@ data: {{- if .Values.mq.enabled }} GLOBAL_messaging.broker.url: 'failover:(nio://mq-service:61616)?timeout=3000&jms.useCompression=true' {{- end }} - {{- if gt .Values.acs.replicas 1.0 }} + {{- if and (gt .Values.acs.replicas 1.0) (.Values.general.enterprise) }} GLOBAL_alfresco.cluster.enabled: 'true' {{- end }} {{- if .Values.transformServices.enabled }} diff --git a/xenit-alfresco/templates/acs/acs-deployment.yaml b/xenit-alfresco/templates/acs/acs-deployment.yaml index e550e5c..b17eb72 100644 --- a/xenit-alfresco/templates/acs/acs-deployment.yaml +++ b/xenit-alfresco/templates/acs/acs-deployment.yaml @@ -7,7 +7,11 @@ metadata: labels: app: acs spec: + {{-if .Values.general.enterprise }} replicas: {{ .Values.acs.replicas }} + {{- else }} + replicas: 1 + {{- end }} selector: matchLabels: app: acs diff --git a/xenit-alfresco/templates/acs/acs-hpa.yaml b/xenit-alfresco/templates/acs/acs-hpa.yaml index 534d684..2c05d48 100644 --- a/xenit-alfresco/templates/acs/acs-hpa.yaml +++ b/xenit-alfresco/templates/acs/acs-hpa.yaml @@ -1,4 +1,4 @@ -{{- if .Values.acs.hpa.enabled }} +{{- if and (.Values.acs.hpa.enabled) (.Values.general.enterprise) }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: diff --git a/xenit-alfresco/templates/digital-workspace/digital-workspace-config.yaml b/xenit-alfresco/templates/digital-workspace/digital-workspace-config.yaml index c3a7a11..a67617d 100644 --- a/xenit-alfresco/templates/digital-workspace/digital-workspace-config.yaml +++ b/xenit-alfresco/templates/digital-workspace/digital-workspace-config.yaml @@ -1,4 +1,4 @@ -{{- if .Values.digitalWorkspace.enabled -}} +{{- if and (.Values.digitalWorkspace.enabled) (.Values.general.enterprise) -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/xenit-alfresco/templates/digital-workspace/digital-workspace-deployment.yaml b/xenit-alfresco/templates/digital-workspace/digital-workspace-deployment.yaml index 93baf3b..ff9fb1a 100644 --- a/xenit-alfresco/templates/digital-workspace/digital-workspace-deployment.yaml +++ b/xenit-alfresco/templates/digital-workspace/digital-workspace-deployment.yaml @@ -1,4 +1,4 @@ -{{- if .Values.digitalWorkspace.enabled -}} +{{- if and (.Values.digitalWorkspace.enabled) (.Values.general.enterprise) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/xenit-alfresco/templates/digital-workspace/digital-workspace-service.yaml b/xenit-alfresco/templates/digital-workspace/digital-workspace-service.yaml index 7606a16..b14e42d 100644 --- a/xenit-alfresco/templates/digital-workspace/digital-workspace-service.yaml +++ b/xenit-alfresco/templates/digital-workspace/digital-workspace-service.yaml @@ -1,4 +1,4 @@ -{{- if .Values.digitalWorkspace.enabled -}} +{{- if and (.Values.digitalWorkspace.enabled) (.Values.general.enterprise) -}} apiVersion: v1 kind: Service metadata: diff --git a/xenit-alfresco/templates/transform-services/shared-file-store/network-policy.yml b/xenit-alfresco/templates/transform-services/shared-file-store/network-policy.yml index b06cd5a..5a1718b 100644 --- a/xenit-alfresco/templates/transform-services/shared-file-store/network-policy.yml +++ b/xenit-alfresco/templates/transform-services/shared-file-store/network-policy.yml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) (.Values.general.networkPolicies.enabled) }} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) (.Values.general.networkPolicies.enabled) (.Values.general.enterprise) }} --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy diff --git a/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-config.yaml b/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-config.yaml index 4420269..f5da157 100644 --- a/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-config.yaml +++ b/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-config.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) -}} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) (.Values.general.enterprise) -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-deployment.yaml b/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-deployment.yaml index 002694c..8c1358c 100644 --- a/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-deployment.yaml +++ b/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-deployment.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) -}} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) (.Values.general.enterprise) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-service.yaml b/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-service.yaml index ebe27fa..857657c 100644 --- a/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-service.yaml +++ b/xenit-alfresco/templates/transform-services/shared-file-store/shared-file-store-service.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) -}} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.sharedFileStore.enabled) (.Values.general.enterprise) -}} apiVersion: v1 kind: Service metadata: diff --git a/xenit-alfresco/templates/transform-services/transform-router/network-policy.yml b/xenit-alfresco/templates/transform-services/transform-router/network-policy.yml index 3a132e3..83acb68 100644 --- a/xenit-alfresco/templates/transform-services/transform-router/network-policy.yml +++ b/xenit-alfresco/templates/transform-services/transform-router/network-policy.yml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) (.Values.general.networkPolicies.enabled) }} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) (.Values.general.networkPolicies.enabled) (.Values.general.enterprise) }} --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy diff --git a/xenit-alfresco/templates/transform-services/transform-router/transform-router-config.yaml b/xenit-alfresco/templates/transform-services/transform-router/transform-router-config.yaml index 08cbf78..4e45f0e 100644 --- a/xenit-alfresco/templates/transform-services/transform-router/transform-router-config.yaml +++ b/xenit-alfresco/templates/transform-services/transform-router/transform-router-config.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) -}} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) (.Values.general.enterprise) -}} apiVersion: v1 kind: ConfigMap metadata: diff --git a/xenit-alfresco/templates/transform-services/transform-router/transform-router-deployment.yaml b/xenit-alfresco/templates/transform-services/transform-router/transform-router-deployment.yaml index e771b10..7f7386c 100644 --- a/xenit-alfresco/templates/transform-services/transform-router/transform-router-deployment.yaml +++ b/xenit-alfresco/templates/transform-services/transform-router/transform-router-deployment.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) -}} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) (.Values.general.enterprise) -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/xenit-alfresco/templates/transform-services/transform-router/transform-router-service.yaml b/xenit-alfresco/templates/transform-services/transform-router/transform-router-service.yaml index f23e8b0..4825691 100644 --- a/xenit-alfresco/templates/transform-services/transform-router/transform-router-service.yaml +++ b/xenit-alfresco/templates/transform-services/transform-router/transform-router-service.yaml @@ -1,4 +1,4 @@ -{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) -}} +{{- if and (.Values.transformServices.enabled) (.Values.transformServices.transformRouter.enabled) (.Values.general.enterprise) -}} apiVersion: v1 kind: Service metadata: diff --git a/xenit-alfresco/values.yaml b/xenit-alfresco/values.yaml index 0525356..7e514b5 100644 --- a/xenit-alfresco/values.yaml +++ b/xenit-alfresco/values.yaml @@ -1,4 +1,5 @@ general: + enterprise: false strategy: type: RollingUpdate rollingUpdate: