@@ -31,83 +31,19 @@ spec:
31
31
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
32
32
{{- end }}
33
33
env :
34
- - name : ML_ADMIN_USER
34
+ - name : MARKLOGIC_ADMIN_USERNAME
35
35
valueFrom :
36
36
secretKeyRef :
37
37
name : {{ include "marklogic.fullname" . }}
38
38
key : username
39
- - name : ML_ADMIN_PASS
39
+ - name : MARKLOGIC_ADMIN_PASSWORD
40
40
valueFrom :
41
41
secretKeyRef :
42
42
name : {{ include "marklogic.fullname" . }}
43
43
key : password
44
44
envFrom :
45
45
- configMapRef :
46
46
name : {{ include "marklogic.fullname" . }}
47
- command :
48
- - bash
49
- - ' -c'
50
- - |
51
- echo '### Begin ML Container Config ###'
52
-
53
- # Set Hostname to the value of hostname command to /etc/marklogic.conf
54
- HOST_FQDN="$(hostname).$ML_FQDN_SUFFIX"
55
- echo "export MARKLOGIC_HOSTNAME=\"$HOST_FQDN\"" | sudo tee /etc/marklogic.conf
56
-
57
- cd ~
58
-
59
- AUTH_CURL="curl --anyauth --user $ML_ADMIN_USER:$ML_ADMIN_PASS -m 20 -s "
60
-
61
- # Start MarkLogic
62
- sudo service MarkLogic start
63
- sleep 5s
64
-
65
- # Initialize and Setup Admin User
66
- echo '### Initialize and Setup Admin User ###'
67
- ML_STATUS_CODE=`curl -s -o /dev/null --write-out %{response_code} http://localhost:8001/admin/v1/init`
68
- if [ "$ML_STATUS_CODE" == "401" ]; then
69
- echo "Server is already configured."
70
- else
71
- curl -X POST -d "" http://$HOSTNAME:8001/admin/v1/init
72
- sleep 5s
73
-
74
- curl -X POST -H "Content-type: application/x-www-form-urlencoded" \
75
- --data "admin-username=$ML_ADMIN_USER" --data "admin-password=$ML_ADMIN_PASS" \
76
- --data "realm=public" \
77
- http://$HOSTNAME:8001/admin/v1/instance-admin
78
- sleep 10s
79
-
80
- # for EA1 release, disable turning on XDQP by default.
81
- # Turn on XDQP encryption via CMA
82
- # $AUTH_CURL -X POST -H 'Content-Type: application/json' \
83
- # -d '{"config":[{"op":"update","group":[{"group-name":"Default","xdqp-ssl-enabled":true}]}]}' \
84
- # http://$HOSTNAME:8002/manage/v3/
85
-
86
- # Join Cluster
87
- if [ "$HOSTNAME" != "$ML_BOOTSTRAP_HOST" ]; then
88
- echo "### joining cluster ###"
89
- joiner=$HOSTNAME
90
- cluster="$ML_BOOTSTRAP_HOST"
91
- $AUTH_CURL -o host.xml -X GET -H "Accept: application/xml" http://${joiner}:8001/admin/v1/server-config
92
- $AUTH_CURL -X POST -d "group=Default" --data-urlencode "server-config@./host.xml" -H "Content-type: application/x-www-form-urlencoded" -o cluster.zip http://${cluster}:8001/admin/v1/cluster-config
93
-
94
- sleep 10s
95
-
96
- $AUTH_CURL -X POST -H "Content-type: application/zip" --data-binary @./cluster.zip http://${joiner}:8001/admin/v1/cluster-config
97
- sleep 5s
98
-
99
- rm -f host.xml
100
- rm -f cluster.zip
101
- fi
102
-
103
- fi
104
-
105
- # mark the pod ready for readiness probe
106
- sudo touch /var/opt/MarkLogic/ready
107
-
108
- echo '### END ML Container Config ###'
109
-
110
- tail -f $MARKLOGIC_DATA_DIR/Logs/ErrorLog.txt
111
47
ports :
112
48
- containerPort : 7997
113
49
name : health-check
0 commit comments