Skip to content

Commit 44928e0

Browse files
authored
Merge pull request #179 from marklogic/feature/MLE-2507-path-based-routing
MLE-2507/Add Helm Chart Ingress Support with Path-based routing
2 parents b72ae4c + 79e065b commit 44928e0

File tree

10 files changed

+542
-38
lines changed

10 files changed

+542
-38
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,14 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
193193
| `haproxy.stats.auth.username` | Username for stats page | `""` |
194194
| `haproxy.stats.auth.password` | Password for stats page | `""` |
195195
| `haproxy.service.type` | The service type of the HAproxy | `ClusterIP` |
196-
| `haproxy.ports` | Ports and load balancing type configuration for HAproxy | `[]` |
196+
| `haproxy.pathbased.enabled` | Parameter to enable path based routing on the HAProxy Load Balancer for MarkLogic | `false` |
197+
| `haproxy.frontendPort` | Listening port in the Front-End section of the HAProxy when using Path based routing | `443` |
198+
| `haproxy.defaultAppServers.appservices.path` | Path used to expose MarkLogic App-Services App-Server | `""` |
199+
| `haproxy.defaultAppServers.admin.path` | Path used to expose MarkLogic Admin App-Server | `""` |
200+
| `haproxy.defaultAppServers.manage.path` | Path used to expose the MarkLogic Manage App-Server | `""` |
201+
| `haproxy.additionalAppServers` | List of additional HTTP Ports configuration for HAproxy | `[]` |
202+
| `haproxy.tcpports.enabled` | Parameter to enable TCP port routing on HAProxy | `false` |
203+
| `haproxy.tcpports` | TCP Ports and load balancing type configuration for HAproxy | `[]` |
197204
| `haproxy.tls.enabled` | Parameter to enable TLS for HAProxy | `false` |
198205
| `haproxy.tls.secretName` | Name of the secret that stores the certificate | `""` |
199206
| `haproxy.tls.certFileName` | The name of the certificate file in the secret | `""` |
@@ -203,6 +210,12 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
203210
| `haproxy.resources.requests.memory` | The requested memory resource for the HAProxy container | `128Mi` |
204211
| `haproxy.resources.limits.cpu` | The cpu resource limit for the HAProxy container | `250m` |
205212
| `haproxy.resources.limits.memory` | The memory resource limit for the HAProxy container | `128Mi` |
213+
| `ingress.enabled` | Enable an ingress resource for the MarkLogic cluster | `false`|
214+
| `ingress.className` | Defines which ingress controller will implement the resource | `""` |
215+
| `ingress.labels` | Additional ingress labels | `{}` |
216+
| `ingress.annotations` | Additional ingress annotations | `{}` |
217+
| `ingress.hosts` | List of ingress hosts | `[]` |
218+
| `ingress.additionalHost` | List of ingress additional hosts | `[]` |
206219

207220
## Known Issues and Limitations
208221

charts/charts/haproxy/templates/service.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,41 @@ spec:
5050
{{- toYaml . | nindent 2 }}
5151
{{- end }}
5252
ports:
53+
- name: qconsole
54+
protocol: TCP
55+
port: {{ .Values.defaultAppServers.appservices.port }}
56+
targetPort: {{ .Values.defaultAppServers.appservices.port }}
57+
- name: admin
58+
protocol: TCP
59+
port: {{ .Values.defaultAppServers.admin.port }}
60+
targetPort: {{ .Values.defaultAppServers.admin.port }}
61+
- name: manage
62+
protocol: TCP
63+
port: {{ .Values.defaultAppServers.manage.port }}
64+
targetPort: {{ .Values.defaultAppServers.manage.port }}
65+
{{- if .Values.pathbased.enabled }}
66+
- name: frontendport
67+
protocol: TCP
68+
port: {{ .Values.frontendPort }}
69+
targetPort: {{ .Values.frontendPort }}
70+
{{- end }}
5371
{{- if .Values.stats.enabled }}
5472
- name: stats
5573
protocol: TCP
5674
port: {{ .Values.stats.port }}
5775
targetPort: {{ .Values.stats.port }}
5876
{{- end }}
59-
{{- with .Values.ports }}
77+
{{- if .Values.tcpports.enabled }}
78+
{{- range .Values.tcpports.ports }}
79+
- name: {{ .name }}
80+
protocol: TCP
81+
port: {{ .port }}
82+
{{- if .targetPort }}
83+
targetPort: {{ .targetPort }}
84+
{{- end }}
85+
{{- end }}
86+
{{- end }}
87+
{{- with .Values.additionalAppServers }}
6088
{{- range $_, $v := . }}
6189
- name: {{ $v.name }}
6290
protocol: TCP

charts/charts/haproxy/values.yaml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,60 @@ stats:
4949
username: ''
5050
password: ''
5151

52-
## open the port for LB and service
53-
ports: []
52+
# Used if MarkLogic Default APP-Servers are meant to be exposed under subpath different from /
53+
54+
#######################################################################
55+
# IMPORTANT NOTE: #
56+
# This feature is only available starting MarkLogic 11.1 and higher. #
57+
#######################################################################
58+
59+
pathbased:
60+
enabled: false
61+
62+
frontendPort: 443
63+
64+
# Path and port used on HAProxy
65+
# The same path will be used on Ingress for Default AppServers
66+
67+
defaultAppServers:
68+
appservices:
69+
# path: /console
70+
port: 8000
71+
admin:
72+
# path: /adminUI
73+
port: 8001
74+
manage:
75+
# path: /manage
76+
port: 8002
77+
78+
## HTTP Ports, load balancing type and path configuration for HAproxy
79+
## HTTP: HTTP(Layer 7) proxy mode. This works for most of the App Servers handling HTTP connections.
80+
## path : define the path to be used to expose the APP-Server on HAProxy and Ingress
81+
82+
## To add new ports to be exposed using HTTP just uncoment the following lines and adapt the configuration
83+
84+
# additionalAppServers:
85+
# - name: dhf-jobs
86+
# type: HTTP
87+
# port: 8010
88+
# targetPort: 8010
89+
# path: /DHF-jobs
90+
# - name: dhf-final
91+
# type: HTTP
92+
# port: 8011
93+
# targetPort: 8011
94+
# path: /DHF-final
95+
96+
## TCP Ports, load balancing configuration for HAproxy
97+
## TCP: TCP(Layer 4) proxy mode. This works for the MarkLogic App Servers handling TCP connections like ODBC.
98+
99+
tcpports:
100+
# TCP port has to be explicitely enabled
101+
enabled: false
102+
# ports:
103+
# - name: odbc
104+
# type: TCP
105+
# port: 5432
54106

55107
## Automatically Roll Deployments
56108
# ref: https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments

charts/templates/NOTES.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
Thank you for installing {{ .Chart.Name }}.
22

3+
NOTE: Marklogic cluster make take several minutes to be fully initialised. Please standby while containers are started and the MarkLogic cluster is configured.
4+
35
Your release is named {{ .Release.Name }}.
46

7+
{{- if .Values.haproxy.pathbased.enabled }}
8+
{{- if not .Values.tls.enableOnDefaultAppServers }}
9+
WARNING
10+
***********************************************************************************************************
11+
Setting "pathbased.enabled" to true requires HTTP basic authentication but "tls.enableOnDefaultAppServers"
12+
is set to false so passwords will be sent in plain text.
13+
This is not recommended and is not a secure configuration so it should only be used be used with caution
14+
in non-production environments.
15+
16+
For production environments please enable TLS as recommended.
17+
18+
Set "tls.enableOnDefaultAppServers" to true or use a service mesh with TLS enabled for
19+
end-to-end encryption.
20+
***********************************************************************************************************
21+
{{- end }}
22+
{{- end }}
23+
524
FQDN is {{ include "marklogic.fqdn" . }}
625
{{- if gt (len (include "marklogic.fqdn" .)) 64 }}
726
WARNING: The hostname is greater than 64 characters

charts/templates/_helpers.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,18 @@ Validate values file
108108
{{- end }}
109109
{{- end }}
110110

111+
{{/*
112+
Create the name of the Ingress to use.
113+
*/}}
114+
{{- define "marklogic.ingress" -}}
115+
{{- printf "%s-ingress" (include "marklogic.fullname" .) }}
116+
{{- end }}
117+
118+
{{/*
119+
Name of the HAProxy Service name to use in Ingress.
120+
*/}}
121+
{{- define "marklogic.haproxy.servicename" -}}
122+
{{- printf "%s-haproxy" .Release.Name }}
123+
{{- end }}
124+
125+

0 commit comments

Comments
 (0)