Skip to content

Commit

Permalink
Allow ingress to DE for epmd and inet_dist when clustering is enabled (
Browse files Browse the repository at this point in the history
…#45)

Co-authored-by: Ingvarr Zhmakin <[email protected]>
  • Loading branch information
bszaf and lazyoldbear authored Jan 16, 2025
1 parent 14de1e5 commit 60f300a
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 155 deletions.
54 changes: 31 additions & 23 deletions charts/document-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
# Changelog

- [Changelog](#changelog)
- [3.3.2 (2025-01-15)](#332-2025-01-15)
- [3.3.3 (2025-01-15)](#333-2025-01-15)
- [Changed](#changed)
- [3.3.2 (2025-01-15)](#332-2025-01-15)
- [Changed](#changed-1)
- [3.3.1 (2025-01-10)](#331-2025-01-10)
- [Added](#added)
- [3.2.12 (2024-12-05)](#3212-2024-12-05)
- [Changed](#changed-1)
- [3.2.11 (2024-11-21)](#3211-2024-11-21)
- [Changed](#changed-2)
- [3.2.10 (2024-11-18)](#3210-2024-11-18)
- [3.2.11 (2024-11-21)](#3211-2024-11-21)
- [Changed](#changed-3)
- [3.2.9 (2024-11-15)](#329-2024-11-15)
- [3.2.10 (2024-11-18)](#3210-2024-11-18)
- [Changed](#changed-4)
- [3.2.9 (2024-11-15)](#329-2024-11-15)
- [Changed](#changed-5)
- [3.2.7 (2024-11-15)](#327-2024-11-15)
- [Added](#added-1)
- [Changed](#changed-5)
- [Changed](#changed-6)
- [3.2.6 (2024-10-29)](#326-2024-10-29)
- [Added](#added-2)
- [Changed](#changed-6)
- [3.2.5 (2024-10-24)](#325-2024-10-24)
- [Changed](#changed-7)
- [3.2.5 (2024-10-24)](#325-2024-10-24)
- [Changed](#changed-8)
- [3.2.4 (2024-10-17)](#324-2024-10-17)
- [Fixed](#fixed)
- [3.2.3 (2024-10-16)](#323-2024-10-16)
- [Fixed](#fixed-1)
- [3.2.2 (2024-10-09)](#322-2024-10-09)
- [Changed](#changed-8)
- [3.2.1 (2024-09-20)](#321-2024-09-20)
- [Changed](#changed-9)
- [3.2.0 (2024-08-29)](#320-2024-08-29)
- [3.2.1 (2024-09-20)](#321-2024-09-20)
- [Changed](#changed-10)
- [3.1.2 (2024-08-23)](#312-2024-08-23)
- [3.2.0 (2024-08-29)](#320-2024-08-29)
- [Changed](#changed-11)
- [3.1.2 (2024-08-23)](#312-2024-08-23)
- [Changed](#changed-12)
- [3.1.1 (2024-08-23)](#311-2024-08-23)
- [Fixed](#fixed-2)
- [3.1.0 (2024-08-22)](#310-2024-08-22)
- [Added](#added-3)
- [3.0.6 (2024-08-22)](#306-2024-08-22)
- [Changed](#changed-12)
- [Changed](#changed-13)
- [3.0.5 (2024-08-21)](#305-2024-08-21)
- [Fixed](#fixed-3)
- [3.0.4 (2024-08-21)](#304-2024-08-21)
- [Changed](#changed-13)
- [Changed](#changed-14)
- [Added](#added-4)
- [2.9.3 (2024-08-16)](#293-2024-08-16)
- [Fixed](#fixed-4)
- [2.9.2 (2024-08-13)](#292-2024-08-13)
- [Changed](#changed-14)
- [Changed](#changed-15)
- [2.9.1 (2024-08-10)](#291-2024-08-10)
- [Added](#added-5)
- [Changed](#changed-15)
- [Changed](#changed-16)
- [2.9.0 (2024-08-01)](#290-2024-08-01)
- [Added](#added-6)
- [Changed](#changed-16)
- [Changed](#changed-17)
- [Fixed](#fixed-5)
- [2.8.0](#280)
- [Added](#added-7)
- [Changed](#changed-17)
- [Changed](#changed-18)
- [Fixed](#fixed-6)
- [2.7.3](#273)
- [Changed](#changed-18)
- [Changed](#changed-19)
- [Fixed](#fixed-7)
- [2.7.2](#272)
- [Fixed](#fixed-8)
- [2.7.0](#270)
- [Changed](#changed-19)
- [Changed](#changed-20)
- [2.6.2](#262)
- [Added](#added-8)
- [Changed](#changed-20)
- [Changed](#changed-21)
- [2.6.0](#260)
- [Added](#added-9)
- [2.4.0](#240)
Expand All @@ -78,9 +80,15 @@
- [2.2.0](#220)
- [Added](#added-12)
- [2.1.0](#210)
- [Changed](#changed-21)
- [2.0.0](#200)
- [Changed](#changed-22)
- [2.0.0](#200)
- [Changed](#changed-23)

## 3.3.3 (2024-01-15)

### Changed

* Updated Network Policy to allow inter-node communication.

## 3.3.2 (2025-01-15)

Expand Down
2 changes: 1 addition & 1 deletion charts/document-engine/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: application
description: Document Engine is a backend software for processing documents and powering automation workflows.
home: https://www.nutrient.io/sdk/document-engine
icon: https://cdn.prod.website-files.com/65fdb7696055f07a05048833/66e58e33c3880ff24aa34027_nutrient-logo.png
version: 3.3.2
version: 3.3.3
appVersion: "1.5.5"

keywords:
Expand Down
178 changes: 88 additions & 90 deletions charts/document-engine/README.md

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions charts/document-engine/ci/05-with-clustered-nodes-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,3 @@ replicaCount: 2
clustering:
enabled: true
method: kubernetes_dns
service:
name: document-engine-erl-dist
16 changes: 16 additions & 0 deletions charts/document-engine/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,22 @@ API and dashboard secrets
{{- end -}}
{{- end -}}

{{/*
Clustering
*/}}
{{- define "document-engine.clustering.service.enabled" -}}
{{- if and .Values.clustering.enabled
(eq .Values.clustering.method "kubernetes_dns") -}}
{{- true -}}
{{- else -}}
{{- false -}}
{{- end -}}
{{- end }}

{{- define "document-engine.clustering.service.name" -}}
{{- include "document-engine.fullname" . }}-cl
{{- end }}

{{/*
Database parameters
*/}}
Expand Down
5 changes: 3 additions & 2 deletions charts/document-engine/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ data:
{{- with .Values.clustering }}
CLUSTERING_ENABLED: {{ .enabled | quote }}
CLUSTERING_METHOD: {{ .method }}
{{- if eq .method "kubernetes_dns" }}
CLUSTERING_SERVICE_NAME: {{ .service.name | quote }}
ERL_EPMD_PORT: {{ .epmd.port | quote }}
{{- if (eq (include "document-engine.clustering.service.enabled" $ ) "true" ) }}
CLUSTERING_SERVICE_NAME: {{ include "document-engine.clustering.service.name" $ | quote }}
{{- end }}
{{- end }}
#
Expand Down
18 changes: 18 additions & 0 deletions charts/document-engine/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.clustering.enabled }}
{{- with .Values.clustering }}
- ports:
# EPMD port
- protocol: TCP
port: {{ .epmd.port }}
# Erlang inet_dist ports
{{- $portRange := split " " ( seq ( int .erlangInetDist.ports.min )
( int .erlangInetDist.ports.max ) ) }}
{{- range $port := $portRange }}
- protocol: TCP
port: {{ $port }}
{{- end }}
from:
- podSelector:
matchLabels: {{- include "document-engine.labels" $ | nindent 14 }}
{{- end }}
{{- end }}
{{- if .Values.networkPolicy.extraIngress }}
{{- tpl (toYaml .Values.networkPolicy.extraIngress) . | nindent 4 }}
{{- end }}
Expand Down
9 changes: 4 additions & 5 deletions charts/document-engine/templates/service-epmd.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{{- if and
.Values.clustering.enabled
(eq .Values.clustering.method "kubernetes_dns") }}
{{- if (eq (include "document-engine.clustering.service.enabled" . ) "true" ) }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.clustering.service.name }}
name: {{ include "document-engine.clustering.service.name" . }}
labels:
{{- include "document-engine.labels" . | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- port: 4369
- port: {{ .Values.clustering.epmd.port }}
name: epmd
selector:
{{- include "document-engine.selectorLabels" . | nindent 4 }}
Expand Down
72 changes: 50 additions & 22 deletions charts/document-engine/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,56 @@
},
"type": "object"
},
"clustering": {
"properties": {
"enabled": {
"type": "boolean"
},
"epmd": {
"properties": {
"port": {
"type": "integer"
}
},
"type": "object"
},
"erlangInetDist": {
"properties": {
"ports": {
"properties": {
"max": {
"maximum": 4379,
"minimum": 4379,
"type": "integer"
},
"min": {
"maximum": 4370,
"minimum": 4370,
"type": "integer"
}
},
"type": "object"
}
},
"type": "object"
},
"method": {
"enum": [
"kubernetes_dns"
],
"type": "string"
},
"service": {
"properties": {
"name": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"config": {
"properties": {
"allowDocumentGeneration": {
Expand Down Expand Up @@ -453,28 +503,6 @@
},
"type": "object"
},
"clustering": {
"properties": {
"enabled": {
"type": "boolean"
},
"method": {
"enum": [
"kubernetes_dns"
],
"type": "string"
},
"service": {
"properties": {
"name": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"documentEngineLicense": {
"properties": {
"activationKey": {
Expand Down
18 changes: 8 additions & 10 deletions charts/document-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -509,20 +509,18 @@ documentConversion:
# @section -- 10. Clustering
# @notationType -- none
clustering:
# -- `CLUSTERING_ENABLED`
# -- `CLUSTERING_ENABLED`, enable clustering, only works when `replicaCount` is greater than 1
# @section -- 10. Clustering
enabled: false
# -- `CLUSTERING_METHOD`
# -- `CLUSTERING_METHOD`, only `kubernetes_dns` is currently supported
# @section -- 10. Clustering
method: kubernetes_dns # @schema enum: [kubernetes_dns]
# -- (object) Clustering service settings
# @section -- 10. Clustering
# @notationType -- none
service:
# -- `CLUSTERING_SERVICE_NAME`
# Also sets up the name of Service with clusterIP: None used for DNS discovery
# @section -- 10. Clustering
name: document-engine-erl-dist
epmd:
port: 4369
erlangInetDist:
ports:
min: 4370 # @schema minimum: 4370; maximum: 4370
max: 4379 # @schema minimum: 4379; maximum: 4379

# -- (object) Document Engine Dashboard settings
# @section -- A. Dashboard
Expand Down

0 comments on commit 60f300a

Please sign in to comment.