Skip to content

Commit e54559e

Browse files
author
Romain Winieski
authored
CLD-575: Open a range of ports for MarkLogic pods and service by default
* add defaultPort and change additional ports conf * fix networkpolicy additional port * add adminUsername by default * Put Network policies as false * Adapt README and comment into values file
1 parent 98634b0 commit e54559e

File tree

5 files changed

+145
-44
lines changed

5 files changed

+145
-44
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,24 @@ For each Kubernetes service, a DNS with the following format is created:
358358

359359
For example, if the service-name is "marklogic" and namespace-name is "default", the DNS URL to access the MarkLogic cluster is "marklogic.default.svc.cluster.local".
360360

361+
### Additional Ports
362+
363+
When creating a new app server on Marklogic, the new app server port must also be added to the additionalPorts in the service configuration:
364+
365+
```yaml
366+
## @param service.additionalPorts. Additional ports exposed at the service level.
367+
## Example:
368+
## - name: app1
369+
## port: 8010
370+
## targetPort: 8010
371+
## protocol: TCP
372+
additionalPorts:
373+
- name: app-server1
374+
port: 8010
375+
targetPort: 8010
376+
protocol: TCP
377+
```
378+
361379
## Port Forward
362380
363381
The `kubectl port-forward` command can help you access MarkLogic outside of the Kubernetes cluster. Use the service to access a specific pod, or the whole cluster.
@@ -481,9 +499,9 @@ This table describes the list of available parameters for Helm Chart.
481499
| `persistence.accessModes` | Access mode for persistence volume | `["ReadWriteOnce"]` |
482500
| `extraVolumes` | Extra list of additional volumes for MarkLogic statefulset | `[]` |
483501
| `extraVolumeMounts` | Extra list of additional volumeMounts for MarkLogic container | `[]` |
484-
| `extraContainerPorts` | Extra list of additional containerPorts for MarkLogic container | `[]` |
502+
| `additionalContainerPorts` | List of ports in addition to the defaults exposed at the container level (Note: This does not typically need to be updated. Use `service.additionalPorts` to expose app server ports.) | `[]` |
485503
| `service.type` | type of the default service | `ClusterIP` |
486-
| `service.ports` | ports of the default service | `[8000, 8002]` |
504+
| `service.additionalPorts` | List of ports in addition to the defaults exposed at the service level. | `[]` |
487505
| `serviceAccount.create` | Enable this parameter to create a service account for a MarkLogic Pod | `true` |
488506
| `serviceAccount.annotations` | Annotations for MarkLogic service account | `{}` |
489507
| `serviceAccount.name` | Name of the serviceAccount | `""` |

charts/templates/service-headless.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,30 @@ spec:
1111
selector:
1212
{{- include "marklogic.selectorLabels" . | nindent 4 }}
1313
ports:
14-
- protocol: TCP
15-
name: health-check
14+
- name: health-check
1615
port: 7997
17-
- protocol: TCP
18-
name: foreign-bind
16+
targetPort: 7997
17+
protocol: TCP
18+
- name: xdqp-port1
1919
port: 7998
20-
- protocol: TCP
21-
name: bind
20+
targetPort: 7998
21+
protocol: TCP
22+
- name: xdqp-port2
2223
port: 7999
23-
- protocol: TCP
24-
name: query-console
24+
targetPort: 7999
25+
protocol: TCP
26+
- name: app-services
2527
port: 8000
26-
- protocol: TCP
27-
name: admin
28+
targetPort: 8000
29+
protocol: TCP
30+
- name: admin
2831
port: 8001
29-
- protocol: TCP
30-
name: manage
32+
targetPort: 8001
33+
protocol: TCP
34+
- name: manage
3135
port: 8002
36+
targetPort: 8002
37+
protocol: TCP
38+
{{- if .Values.service.additionalPorts }}
39+
{{- toYaml .Values.service.additionalPorts | nindent 4 }}
40+
{{- end }}

charts/templates/service.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,31 @@ spec:
1010
selector:
1111
{{- include "marklogic.selectorLabels" . | nindent 4 }}
1212
type: {{ .Values.service.type }}
13-
ports: {{- toYaml .Values.service.ports | nindent 4 }}
13+
ports:
14+
- name: health-check
15+
port: 7997
16+
targetPort: 7997
17+
protocol: TCP
18+
- name: xdqp-port1
19+
port: 7998
20+
targetPort: 7998
21+
protocol: TCP
22+
- name: xdqp-port2
23+
port: 7999
24+
targetPort: 7999
25+
protocol: TCP
26+
- name: app-services
27+
port: 8000
28+
targetPort: 8000
29+
protocol: TCP
30+
- name: admin
31+
port: 8001
32+
targetPort: 8001
33+
protocol: TCP
34+
- name: manage
35+
port: 8002
36+
targetPort: 8002
37+
protocol: TCP
38+
{{- if .Values.service.additionalPorts }}
39+
{{- toYaml .Values.service.additionalPorts | nindent 4 }}
40+
{{- end }}

charts/templates/statefulset.yaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,26 @@ spec:
123123
- configMapRef:
124124
name: {{ include "marklogic.fullname" . }}
125125
ports:
126-
- containerPort: 7997
127-
name: health-check
128-
- containerPort: 7998
129-
name: cluster-port
130-
- containerPort: 7999
131-
name: cluster-port2
132-
- containerPort: 8000
133-
name: app-services
134-
- containerPort: 8001
135-
name: admin
136-
- containerPort: 8002
137-
name: manage
138-
{{- if .Values.extraContainerPorts }}
139-
{{- toYaml .Values.extraContainerPorts | nindent 12 }}
126+
- name: health-check
127+
containerPort: 7997
128+
protocol: TCP
129+
- name: xdqp-port1
130+
containerPort: 7998
131+
protocol: TCP
132+
- name: xdqp-port2
133+
containerPort: 7999
134+
protocol: TCP
135+
- name: app-services
136+
containerPort: 8000
137+
protocol: TCP
138+
- name: admin
139+
containerPort: 8001
140+
protocol: TCP
141+
- name: manage
142+
containerPort: 8002
143+
protocol: TCP
144+
{{- if .Values.additionalContainerPorts }}
145+
{{- toYaml .Values.additionalContainerPorts | nindent 12 }}
140146
{{- end }}
141147
lifecycle:
142148
{{- if eq .Values.bootstrapHostName "" }}

charts/values.yaml

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fullnameOverride: ""
5656

5757
# Configure Marklogic Admin Username and Password
5858
auth:
59-
adminUsername: admin
59+
adminUsername: "admin"
6060
adminPassword: ""
6161
walletPassword: ""
6262

@@ -96,8 +96,27 @@ persistence:
9696
extraVolumes: []
9797
# specify extra list of volumeMounts
9898
extraVolumeMounts: []
99-
# specify extra list of containerPorts
100-
extraContainerPorts: []
99+
100+
## Container listener port configuration
101+
## ref: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
102+
103+
#########################################################################################
104+
## WARNING: Changing additionalContainerPorts on an existing cluster requires a pod ##
105+
## restart to take effect. This setting does not need to be changed under normal ##
106+
## circumsatances though. To expose new ports for MarkLogic app servers, use ##
107+
## service.additionalPorts. When the updateStrategy is set to OnDelete (the default), ##
108+
## this must be done manually. If the updateStrategy is changed to RollingUpdate (not ##
109+
## recommented), changing the additionalContainerPorts will trigger a rolling update ##
110+
## of the StatefulSet. ##
111+
#########################################################################################
112+
113+
## @param additionalContainerPorts. Additional container ports
114+
## Example:
115+
## - name: app1
116+
## containerPorts: 8010
117+
## protocol: TCP
118+
additionalContainerPorts: []
119+
101120

102121
# Configure the Service to access Marklogic Clusters
103122
service:
@@ -107,13 +126,25 @@ service:
107126
annotations: {}
108127

109128
type: ClusterIP
110-
ports:
111-
- protocol: TCP
112-
name: query-console
113-
port: 8000
114-
- protocol: TCP
115-
name: manage
116-
port: 8002
129+
## Service listener port configuration
130+
## ref: https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
131+
132+
#######################################################################################
133+
## NOTE : When adding new app servers to MarkLogic, the new app server ports must ##
134+
## also be added to the additionalPorts parameter to expose the ports via the ##
135+
## kubernetes service. ##
136+
#######################################################################################
137+
138+
## @param service.additionalPorts. Additional service ports
139+
## Example:
140+
## - name: app1
141+
## port: 8010
142+
## targetPort: 8010
143+
## protocol: TCP
144+
additionalPorts: []
145+
# Annotations to add to the service
146+
annotations: {}
147+
117148
serviceAccount:
118149
# Specifies whether a service account should be created
119150
create: true
@@ -131,13 +162,23 @@ priorityClassName: ""
131162
# ref: https://kubernetes.io/docs/concepts/services-networking/network-policies
132163
networkPolicy:
133164
enabled: false
165+
## @param networkPolicy.customRules. Additional NetworkPolicy rules
166+
## Note that all rules are OR-ed.
167+
## Example:
168+
## customRules:
169+
## - matchLabels:
170+
## - role: frontend
171+
## - matchExpressions:
172+
## - key: role
173+
## operator: In
174+
## values:
175+
## - frontend
176+
##
134177
customRules: {}
178+
## The endPort should be the last port exposed by an App Server
135179
ports:
136180
- port: 8000
137-
protocol: TCP
138-
- port: 8001
139-
protocol: TCP
140-
- port: 8002
181+
endPort: 8020
141182
protocol: TCP
142183

143184
# Below are the security configurations for container, by default security will be enabled
@@ -208,4 +249,4 @@ logCollection:
208249
# HTTP_User admin
209250
# HTTP_Passwd admin
210251
# Documentation on how to set up output can be found here: https://docs.fluentbit.io/manual/pipeline/outputs
211-
# Configure desired output below
252+
# Configure desired output below

0 commit comments

Comments
 (0)