Skip to content

Commit 84d8391

Browse files
author
Barkha Choithani
committed
Merge remote-tracking branch 'origin/develop' into feature/CLD-706
2 parents b5a9958 + 1d42286 commit 84d8391

File tree

7 files changed

+85
-16
lines changed

7 files changed

+85
-16
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ helm repo update
158158
Use this command to install MarkLogic Chart to the current namespace with default settings:
159159

160160
```
161-
helm install my-release marklogic/marklogic --version=1.0.0-ea1
161+
helm install my-release marklogic/marklogic --version=1.0.0-ea2
162162
```
163163

164164
After you install MarkLogic Chart, the output will look like this:
@@ -171,12 +171,12 @@ STATUS: deployed
171171
REVISION: 1
172172
```
173173

174-
**Note:** --version=1.0.0-ea1 must be provided as part of the name. You can choose a distinctive release name to replace "my-release".
174+
**Note:** --version=1.0.0-ea2 must be provided as part of the name. You can choose a distinctive release name to replace "my-release".
175175

176176
We strongly recommend that you deploy MarkLogic Chart in an exclusive namespace. Use the `--create-namespace` flag if the namespace has not already been created:
177177

178178
```
179-
helm install my-release marklogic/marklogic --version=1.0.0-ea1 --namespace=marklogic --create-namespace
179+
helm install my-release marklogic/marklogic --version=1.0.0-ea2 --namespace=marklogic --create-namespace
180180
```
181181

182182
Use this command to verify the deployment:
@@ -198,7 +198,7 @@ The `--values` flag points to a YAML file. The values in the file will override
198198
Use this command to view the default configurable values:
199199

200200
```
201-
helm show values marklogic/marklogic --version=1.0.0-ea1
201+
helm show values marklogic/marklogic --version=1.0.0-ea2
202202
```
203203

204204
To configure a different value for your installation, create a `values.yaml` file.
@@ -215,15 +215,15 @@ imagePullSecret:
215215
Use the following command to install MarkLogic with the `values.yaml` file you just created.
216216

217217
```
218-
helm install my-release marklogic/marklogic --version=1.0.0-ea1 --values values.yaml
218+
helm install my-release marklogic/marklogic --version=1.0.0-ea2 --values values.yaml
219219
```
220220

221221
### --set
222222

223223
Use the `--set` flag to make one or more configuration changes directly:
224224

225225
```
226-
helm install my-release marklogic/marklogic --version=1.0.0-ea1 \
226+
helm install my-release marklogic/marklogic --version=1.0.0-ea2 \
227227
--set imagePullSecret.registry="https://index.docker.io/v1/" \
228228
--set imagePullSecret.username=YOUR_USERNAME \
229229
--set imagePullSecret.password=YOUR_PASSWORD

charts/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ data:
99
{{- if ne .Values.bootstrapHostName "" }}
1010
MARKLOGIC_BOOTSTRAP_HOST: {{ .Values.bootstrapHostName }}
1111
{{- else }}
12-
MARKLOGIC_BOOTSTRAP_HOST: {{ include "marklogic.fullname" . }}-0
12+
MARKLOGIC_BOOTSTRAP_HOST: {{ include "marklogic.fqdn" . }}
1313
{{- end }}
1414
MARKLOGIC_FQDN_SUFFIX: {{ include "marklogic.headlessURL" . }}
1515
MARKLOGIC_INIT: "true"

charts/templates/statefulset.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ spec:
272272
{{- with .Values.nodeSelector }}
273273
nodeSelector: {{- toYaml . | nindent 8}}
274274
{{- end }}
275-
dnsConfig:
276-
searches:
277-
- {{ include "marklogic.headlessURL" . }}
278275
{{- if .Values.imagePullSecret }}
279276
imagePullSecrets:
280277
- name: {{ include "marklogic.fullname" . }}-registry

charts/values.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bootstrapHostName: ""
2525
# Marklogic image parameters
2626
image:
2727
repository: marklogicdb/marklogic-db
28-
tag: latest
28+
tag: 10.0-9.5-centos-1.0.0
2929
pullPolicy: IfNotPresent
3030

3131
# Init container image parameters
@@ -61,7 +61,19 @@ auth:
6161

6262
# Configure Affinity property for scheduling pods to nodes
6363
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
64-
affinity: {}
64+
# Preferred anti affinity rule to schedule one marklogic pod per worker node
65+
affinity:
66+
podAntiAffinity:
67+
preferredDuringSchedulingIgnoredDuringExecution:
68+
- weight: 100
69+
podAffinityTerm:
70+
labelSelector:
71+
matchExpressions:
72+
- key: app.kubernetes.io/name
73+
operator: In
74+
values:
75+
- marklogic
76+
topologyKey: kubernetes.io/hostname
6577

6678
# Configure NodeSelector property for scheduling pods to nodes
6779
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/#create-a-pod-that-gets-scheduled-to-your-chosen-node

index.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ entries:
55
category: Database
66
apiVersion: v2
77
appVersion: 10.0-9.5
8-
created: "2022-12-05T12:37:45.098819-08:00"
8+
created: "2022-12-12T13:30:47.74871-08:00"
99
description: MarkLogic Server is a multi-model database that has both NoSQL and
1010
trusted enterprise data management capabilities.
11-
digest: 431d46bbed02be9b6224ec7b7a39fdcc9e1abffbb3656126cbc73a460240e122
11+
digest: 9a2c957bbe8032a7e6a2967fc83d23c243a5552312f33a9bb4d9f0580c4614e3
1212
keywords:
1313
- marklogic
1414
- database
@@ -25,7 +25,7 @@ entries:
2525
category: Database
2626
apiVersion: v2
2727
appVersion: 10.0-9.1
28-
created: "2022-12-05T12:37:45.09751-08:00"
28+
created: "2022-12-12T13:30:47.747045-08:00"
2929
description: MarkLogic Server is a multi-model database that has both NoSQL and
3030
trusted enterprise data management capabilities.
3131
digest: 2d9588d42beaaef3267d1375b50ab5d972863c259ebb4d843c4b24c480467321
@@ -41,4 +41,4 @@ entries:
4141
urls:
4242
- marklogic-1.0.0-ea1.tgz
4343
version: 1.0.0-ea1
44-
generated: "2022-12-05T12:37:45.094373-08:00"
44+
generated: "2022-12-12T13:30:47.742091-08:00"

marklogic-1.0.0-ea2.tgz

5 Bytes
Binary file not shown.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package template_test
2+
3+
import (
4+
"path/filepath"
5+
"strings"
6+
"testing"
7+
8+
"github.com/stretchr/testify/require"
9+
appsv1 "k8s.io/api/apps/v1"
10+
11+
"github.com/gruntwork-io/terratest/modules/helm"
12+
"github.com/gruntwork-io/terratest/modules/k8s"
13+
"github.com/gruntwork-io/terratest/modules/random"
14+
)
15+
16+
func TestChartTemplatePodAntiAffinityClass(t *testing.T) {
17+
t.Parallel()
18+
19+
// Path to the helm chart we will test
20+
helmChartPath, err := filepath.Abs("../../charts")
21+
releaseName := "marklogic-pod-antiaffinity-test"
22+
t.Log(helmChartPath, releaseName)
23+
require.NoError(t, err)
24+
25+
// Set up the namespace; confirm that the template renders the expected value for the namespace.
26+
namespaceName := "marklogic-" + strings.ToLower(random.UniqueId())
27+
t.Logf("Namespace: %s\n", namespaceName)
28+
29+
// Setup the args for helm install
30+
options := &helm.Options{
31+
SetValues: map[string]string{
32+
"image.repository": "marklogicdb/marklogic-db",
33+
"image.tag": "latest",
34+
"persistence.enabled": "false",
35+
},
36+
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
37+
}
38+
39+
// render the tempate
40+
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/statefulset.yaml"})
41+
42+
var statefulset appsv1.StatefulSet
43+
helm.UnmarshalK8SYaml(t, output, &statefulset)
44+
45+
// Verify the name and namespace matches
46+
require.Equal(t, namespaceName, statefulset.Namespace)
47+
48+
// Verify the pod anti affinity rule is set
49+
expectedLabelSelectorKey := "app.kubernetes.io/name"
50+
expectedLabelSelectorValue := "marklogic"
51+
expectedTopologyKey := "kubernetes.io/hostname"
52+
statefulSetAffinityRule := statefulset.Spec.Template.Spec.Affinity.PodAntiAffinity
53+
affinityPreferredRule := statefulSetAffinityRule.PreferredDuringSchedulingIgnoredDuringExecution
54+
actualLabelSelectorKey := affinityPreferredRule[0].PodAffinityTerm.LabelSelector.MatchExpressions[0].Key
55+
actualLabelSelectorValue := affinityPreferredRule[0].PodAffinityTerm.LabelSelector.MatchExpressions[0].Values[0]
56+
actualTopologyKey := affinityPreferredRule[0].PodAffinityTerm.TopologyKey
57+
require.Equal(t, actualLabelSelectorKey, expectedLabelSelectorKey)
58+
require.Equal(t, actualLabelSelectorValue, expectedLabelSelectorValue)
59+
require.Equal(t, actualTopologyKey, expectedTopologyKey)
60+
}

0 commit comments

Comments
 (0)