Skip to content

Commit 8faa70f

Browse files
authored
Merge branch 'develop' into sync-master-develop
2 parents c2bb142 + 7e40b1e commit 8faa70f

28 files changed

+1477
-118
lines changed

CONTRIBUTING.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing to MarkLogic-kubernetes
2+
3+
Thank you for your interest in contributing to this project! We welcome contributions from the community to make this project better.
4+
5+
- [Found an Issue](#found-an-issue)
6+
- [Want a Feature](#want-a-feature)
7+
- [Getting Started](#getting-started)
8+
- [PR management](#pr-management)
9+
10+
## Found an Issue?
11+
12+
If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue
13+
to our [GitHub Issue Tracker][Issue Tracker]. If you'd like to submit a feature enhancement, please first create an
14+
issue with your proposed idea so that we can start a discussion about the problem you want to solve and what the best
15+
solution would be.
16+
17+
## Want a Feature?
18+
19+
You can request a new feature by submitting an issue to our [GitHub Issue Tracker][Issue Tracker]. If you
20+
would like to implement a new feature then first create a new issue and discuss it with one of our
21+
project maintainers.
22+
23+
## Getting Started
24+
25+
To get started with contributing, please follow these steps:
26+
27+
1. Fork the repository and clone it to your local machine.
28+
2. Install the necessary dependencies.
29+
3. Create a new branch for your changes.
30+
4. Make your desired changes to the codebase.
31+
5. Test your changes thoroughly.
32+
6. Tests can be done using the test framework. See [test folder](./test/) and [Makefile](makefile)
33+
34+
## PR management
35+
36+
Created PR will not be merge as is.
37+
The MarkLogic kubernetes team will use the PRs for "inspiration" but not merge the changes in directly. They may rewrite the code as they like, incorporating the submitted changes into their own code.
38+
39+
**Important:** Please open an issue in the [Issue Tracker][] and get your proposed changes pre-approved by at least one of the project maintainers before you start coding. Nothing is more frustrating than seeing your hard work go to waste because your vision does not align with that of the project maintainers.
40+
41+
[Issue Tracker]: https://github.com/marklogic/marklogic-kubernetes/issues

Jenkinsfile

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ void resultNotification(message) {
104104
} else {
105105
emailList = params.emailList
106106
}
107-
jira_link = "https://project.marklogic.com/jira/browse/${JIRA_ID}"
108-
email_body = "<b>Jenkins pipeline for</b> ${env.JOB_NAME} <br><b>Build Number: </b>${env.BUILD_NUMBER} <br><br><b>Lint Output: </b><br><pre><code>${LINT_OUTPUT}</code></pre><br><br><b>Scan Output: </b><br><pre><code>${SCAN_OUTPUT}</code></pre><br><br><b>Build URL: </b><br>${env.BUILD_URL}"
109-
jira_email_body = "${email_body} <br><br><b>Jira URL: </b><br>${jira_link}"
107+
jira_link = "https://progresssoftware.atlassian.net/browse/${JIRA_ID}"
108+
email_body = "<b>Jenkins pipeline for</b> ${env.JOB_NAME} <br><b>Build Number: </b>${env.BUILD_NUMBER} <br><br><b>Lint Output: </b><br><pre><code>${LINT_OUTPUT}</code></pre><br><br><b>Scan Output: </b><br><pre><code>${SCAN_OUTPUT}</code></pre><br><br><b>Build URL: </b><br><a href='${env.BUILD_URL}'>${env.BUILD_URL}</a>"
109+
jira_email_body = "${email_body} <br><br><b>Jira URL: </b><br><a href='${jira_link}'>${jira_link}</a>"
110110

111111
if (JIRA_ID) {
112112
def comment = [ body: "Jenkins pipeline build result: ${message}" ]
@@ -146,17 +146,6 @@ void publishTestResults() {
146146
archiveArtifacts artifacts: '**/test/test_results/*.xml', allowEmptyArchive: true
147147
}
148148

149-
String getVersionDiv(mlVersion) {
150-
switch (mlVersion) {
151-
case '10.0':
152-
return '-'
153-
case '9.0':
154-
return '-'
155-
default:
156-
return '.'
157-
}
158-
}
159-
160149
pipeline {
161150
agent {
162151
label {
@@ -169,29 +158,22 @@ pipeline {
169158
skipStagesAfterUnstable()
170159
}
171160
triggers {
172-
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 04 * * * % IMAGE_SCAN=true''' : '')
161+
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 04 * * * % IMAGE_SCAN=true;HC_TESTS=true''' : '')
173162
}
174163
environment {
175-
//timeStamp = sh(returnStdout: true, script: "date +%Y%m%d -d '-5 hours'").trim()
176-
timeStamp = 'nightly'
177164
dockerRegistry = 'ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com'
178-
dockerRepository = "${dockerRegistry}/marklogic/marklogic-server-centos"
179-
dockerVerDivider = getVersionDiv(params.ML_VERSION)
180-
prevDockerVerDivider = getVersionDiv(params.PREV_ML_VERSION)
181-
dockerVersion = "${ML_VERSION}${dockerVerDivider}${timeStamp}-centos-${dockerReleaseVer}"
182-
prevDockerVersion = "${PREV_ML_VERSION}${prevDockerVerDivider}${timeStamp}-centos-${prevDockerReleaseVer}"
165+
dockerRepository = "${dockerRegistry}/marklogic/marklogic-server-${params.dockerImageType}"
183166
}
184167

185168
parameters {
186-
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
187-
choice(name: 'ML_VERSION', choices: '11.2\n12.0\n10.0', description: 'MarkLogic version. used to pick appropriate docker image')
169+
choice(name: 'dockerImageType', choices: 'ubi-rootless\nubi\ncentos', description: 'Platform type for Docker image')
170+
string(name: 'dockerVersion', defaultValue: 'latest-11', description: 'Docker tag to use for tests. (e.g. 11.2.nightly-ubi-rootless-1.1.2) Has to correspond with dockerImageType.', trim: true)
171+
string(name: 'prevDockerVersion', defaultValue: 'latest-10', description: 'Previous Docker version for MarkLogic upgrade tests. (e.g. 10.0-10.2-centos-1.1.2) Has to correspond with dockerImageType.', trim: true)
172+
choice(name: 'K8_VERSION', choices: 'v1.29\nv1.30\nv1.28\nv1.27\nv1.26\nv1.25\nv1.24', description: 'Test Kubernetes version.')
188173
booleanParam(name: 'KUBERNETES_TESTS', defaultValue: true, description: 'Run kubernetes tests')
189174
booleanParam(name: 'HC_TESTS', defaultValue: false, description: 'Run Hub Central E2E UI tests (takes about 3 hours)')
190175
booleanParam(name: 'IMAGE_SCAN', defaultValue: false, description: 'Find and scan dependent Docker images for security vulnerabilities')
191-
string(name: 'dockerReleaseVer', defaultValue: '1.1.2', description: 'Current Docker version. (e.g. 1.0.1)', trim: true)
192-
choice(name: 'PREV_ML_VERSION', choices: '10.0\n9.0\n11.2', description: 'Previous MarkLogic version for MarkLogic upgrade tests')
193-
string(name: 'prevDockerReleaseVer', defaultValue: '1.1.2', description: 'Previous Docker version for MarkLogic upgrade tests. (e.g. 1.0.1)', trim: true)
194-
choice(name: 'K8_VERSION', choices: 'v1.25.8\nv1.26.3\nv1.24.12\nv1.23.17', description: 'Test Kubernetes version. (e.g. v1.25.8)')
176+
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
195177
}
196178

197179
stages {

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,14 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
198198
| `haproxy.stats.auth.username` | Username for stats page | `""` |
199199
| `haproxy.stats.auth.password` | Password for stats page | `""` |
200200
| `haproxy.service.type` | The service type of the HAproxy | `ClusterIP` |
201-
| `haproxy.ports` | Ports and load balancing type configuration for HAproxy | `[]` |
201+
| `haproxy.pathbased.enabled` | Parameter to enable path based routing on the HAProxy Load Balancer for MarkLogic | `false` |
202+
| `haproxy.frontendPort` | Listening port in the Front-End section of the HAProxy when using Path based routing | `443` |
203+
| `haproxy.defaultAppServers.appservices.path` | Path used to expose MarkLogic App-Services App-Server | `""` |
204+
| `haproxy.defaultAppServers.admin.path` | Path used to expose MarkLogic Admin App-Server | `""` |
205+
| `haproxy.defaultAppServers.manage.path` | Path used to expose the MarkLogic Manage App-Server | `""` |
206+
| `haproxy.additionalAppServers` | List of additional HTTP Ports configuration for HAproxy | `[]` |
207+
| `haproxy.tcpports.enabled` | Parameter to enable TCP port routing on HAProxy | `false` |
208+
| `haproxy.tcpports` | TCP Ports and load balancing type configuration for HAproxy | `[]` |
202209
| `haproxy.tls.enabled` | Parameter to enable TLS for HAProxy | `false` |
203210
| `haproxy.tls.secretName` | Name of the secret that stores the certificate | `""` |
204211
| `haproxy.tls.certFileName` | The name of the certificate file in the secret | `""` |
@@ -208,6 +215,12 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
208215
| `haproxy.resources.requests.memory` | The requested memory resource for the HAProxy container | `128Mi` |
209216
| `haproxy.resources.limits.cpu` | The cpu resource limit for the HAProxy container | `250m` |
210217
| `haproxy.resources.limits.memory` | The memory resource limit for the HAProxy container | `128Mi` |
218+
| `ingress.enabled` | Enable an ingress resource for the MarkLogic cluster | `false`|
219+
| `ingress.className` | Defines which ingress controller will implement the resource | `""` |
220+
| `ingress.labels` | Additional ingress labels | `{}` |
221+
| `ingress.annotations` | Additional ingress annotations | `{}` |
222+
| `ingress.hosts` | List of ingress hosts | `[]` |
223+
| `ingress.additionalHost` | List of ingress additional hosts | `[]` |
211224

212225
## Known Issues and Limitations
213226

@@ -218,3 +231,5 @@ Following table lists all the parameters supported by the latest MarkLogic Helm
218231
5. The latest released version of redhat/ubi9:9.3 has known security vulnerabilities with respect to setuptools GHSA-r9hx-vwmv-q579. We wait for a future upgrade of the redhad ubi image to include the fix.
219232
6. The security context “allowPrivilegeEscalation” is set to TRUE by default in values.yaml file and cannot be changed to run the current MarkLogic container. Work is in progress to run MarkLogic container in "rootless" mode.
220233
7. Known Issues and Limitations for the MarkLogic Server Docker image can be viewed using the link: https://github.com/marklogic/marklogic-docker?tab=readme-ov-file#Known-Issues-and-Limitations
234+
8. The Readiness and Startup Probe are not compatible with HA deployment. At the moment these probes may fail in the case of Security database failover. As of the 1.0.2 helm chart release, the startup and readiness probes are disabled by default.
235+
9. Path based routing and Ingress features are only supported with MarkLogic 11.1 and higher.

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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
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+
58
{{- if eq (include "marklogic.imageType" .) "rootless" }}
69
{{- if .Values.containerSecurityContext.allowPrivilegeEscalation }}
710
WARNING
@@ -13,6 +16,23 @@ WARNING
1316
{{- end }}
1417
{{- end }}
1518

19+
{{- if .Values.haproxy.pathbased.enabled }}
20+
{{- if not .Values.tls.enableOnDefaultAppServers }}
21+
WARNING
22+
***********************************************************************************************************
23+
Setting "pathbased.enabled" to true requires HTTP basic authentication but "tls.enableOnDefaultAppServers"
24+
is set to false so passwords will be sent in plain text.
25+
This is not recommended and is not a secure configuration so it should only be used be used with caution
26+
in non-production environments.
27+
28+
For production environments please enable TLS as recommended.
29+
30+
Set "tls.enableOnDefaultAppServers" to true or use a service mesh with TLS enabled for
31+
end-to-end encryption.
32+
***********************************************************************************************************
33+
{{- end }}
34+
{{- end }}
35+
1636
FQDN is {{ include "marklogic.fqdn" . }}
1737
{{- if gt (len (include "marklogic.fqdn" .)) 64 }}
1838
WARNING: The hostname is greater than 64 characters

charts/templates/_helpers.tpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,16 @@ Name to distinguish marklogic image whether root or rootless
207207
{{- end }}
208208
{{- end }}
209209

210+
{{/*
211+
Create the name of the Ingress to use.
212+
*/}}
213+
{{- define "marklogic.ingress" -}}
214+
{{- printf "%s-ingress" (include "marklogic.fullname" .) }}
215+
{{- end }}
216+
217+
{{/*
218+
Name of the HAProxy Service name to use in Ingress.
219+
*/}}
220+
{{- define "marklogic.haproxy.servicename" -}}
221+
{{- printf "%s-haproxy" .Release.Name }}
222+
{{- end }}

0 commit comments

Comments
 (0)