Skip to content

Commit e77b95f

Browse files
CLD-700: Support setting the MarkLogic wallet password via the k8s values file (#100)
* changes to support ml wallet-password as secret * fixed lint errors * fixed test for wallet-password * fixed path for wallet-password-file
1 parent 25142c0 commit e77b95f

File tree

7 files changed

+672
-39
lines changed

7 files changed

+672
-39
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ This table describes the list of available parameters for Helm Chart.
464464
| `nameOverride` | String to override the app name | `""` |
465465
| `fullnameOverride` | String to completely replace the generated name | `""` |
466466
| `auth.adminUsername` | Username for default MarkLogic Administrator | `admin` |
467-
| `auth.adminPassword` | Password for default MarkLogic Administrator | `admin`
467+
| `auth.adminPassword` | Password for default MarkLogic Administrator | ``
468+
| `auth.walletPassword` | Password for wallet | ``
468469
| `bootstrapHostName` | Host name of MarkLogic bootstrap host | `""`
469470
| `group.name` | group name for joining MarkLogic cluster | `Default` |
470471
| `group.enableXdqpSsl` | SSL encryption for XDQP | `true` |

charts/templates/secret.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ type: kubernetes.io/basic-auth
1515
data:
1616
password: {{ $adminPassword }}
1717
username: {{ .Values.auth.adminUsername | b64enc | quote }}
18+
wallet-password: {{ .Values.auth.walletPassword | b64enc | quote }}
1819

charts/templates/statefulset.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ spec:
9797
{{- if .Values.extraVolumeMounts }}
9898
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
9999
{{- end }}
100+
- name: mladmin-secrets
101+
mountPath: /run/secrets/ml-secrets
102+
readOnly: true
100103
env:
101104
- name: MARKLOGIC_ADMIN_USERNAME
102105
valueFrom:
@@ -108,6 +111,10 @@ spec:
108111
secretKeyRef:
109112
name: {{ include "marklogic.fullname" . }}-admin
110113
key: password
114+
{{- if .Values.auth.walletPassword }}
115+
- name: MARKLOGIC_WALLET_PASSWORD_FILE
116+
value: ml-secrets/wallet-password
117+
{{- end }}
111118
- name: POD_NAME
112119
valueFrom:
113120
fieldRef:
@@ -285,6 +292,14 @@ spec:
285292
- name: {{ include "marklogic.fullname" . }}-registry
286293
{{- end }}
287294
volumes:
295+
- name: mladmin-secrets
296+
secret:
297+
secretName: {{ include "marklogic.fullname" . }}-admin
298+
items:
299+
{{- if .Values.auth.walletPassword }}
300+
- key: wallet-password
301+
path: wallet-password
302+
{{- end }}
288303
{{- if .Values.logCollection.enabled }}
289304
- name: {{ include "marklogic.fullname" . }}-fb-config-map
290305
configMap:

charts/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ fullnameOverride: ""
5858
auth:
5959
adminUsername: admin
6060
adminPassword: ""
61+
walletPassword: ""
6162

6263
# Configure Affinity property for scheduling pods to nodes
6364
# ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

go.mod

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ module github.com/marklogic/marklogic-kubernetes
33
go 1.17
44

55
require (
6-
github.com/gruntwork-io/terratest v0.40.6
7-
github.com/stretchr/testify v1.7.0
6+
github.com/gruntwork-io/terratest v0.41.15
7+
github.com/stretchr/testify v1.8.1
88
github.com/tidwall/gjson v1.14.3
99
github.com/xinsnake/go-http-digest-auth-client v0.6.0
1010
k8s.io/api v0.23.0
1111
)
1212

1313
require (
14-
cloud.google.com/go v0.83.0 // indirect
15-
github.com/aws/aws-sdk-go v1.40.56 // indirect
14+
cloud.google.com/go/compute v1.12.1 // indirect
15+
cloud.google.com/go/compute/metadata v0.2.1 // indirect
16+
github.com/aws/aws-sdk-go v1.44.122 // indirect
1617
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
1718
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
1819
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -23,9 +24,9 @@ require (
2324
github.com/go-sql-driver/mysql v1.4.1 // indirect
2425
github.com/gogo/protobuf v1.3.2 // indirect
2526
github.com/golang/protobuf v1.5.2 // indirect
26-
github.com/google/go-cmp v0.5.6 // indirect
27+
github.com/google/go-cmp v0.5.9 // indirect
2728
github.com/google/gofuzz v1.1.0 // indirect
28-
github.com/google/uuid v1.2.0 // indirect
29+
github.com/google/uuid v1.3.0 // indirect
2930
github.com/googleapis/gnostic v0.5.5 // indirect
3031
github.com/gruntwork-io/go-commons v0.8.0 // indirect
3132
github.com/hashicorp/errwrap v1.0.0 // indirect
@@ -47,18 +48,18 @@ require (
4748
github.com/tidwall/match v1.1.1 // indirect
4849
github.com/tidwall/pretty v1.2.0 // indirect
4950
github.com/urfave/cli v1.22.2 // indirect
50-
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
51-
golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect
52-
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
53-
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
54-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
55-
golang.org/x/text v0.3.7 // indirect
51+
golang.org/x/crypto v0.1.0 // indirect
52+
golang.org/x/net v0.7.0 // indirect
53+
golang.org/x/oauth2 v0.1.0 // indirect
54+
golang.org/x/sys v0.5.0 // indirect
55+
golang.org/x/term v0.5.0 // indirect
56+
golang.org/x/text v0.7.0 // indirect
5657
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
5758
google.golang.org/appengine v1.6.7 // indirect
58-
google.golang.org/protobuf v1.27.1 // indirect
59+
google.golang.org/protobuf v1.28.1 // indirect
5960
gopkg.in/inf.v0 v0.9.1 // indirect
6061
gopkg.in/yaml.v2 v2.4.0 // indirect
61-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
62+
gopkg.in/yaml.v3 v3.0.1 // indirect
6263
k8s.io/apimachinery v0.23.0 // indirect
6364
k8s.io/client-go v0.23.0 // indirect
6465
k8s.io/klog/v2 v2.30.0 // indirect

0 commit comments

Comments
 (0)