63
63
- vm.max_map_count=262144
64
64
securityContext :
65
65
{{- toYaml .Values.indexer.initContainers.securityContext | nindent 12 }}
66
- - name : security-admin
66
+ {{- if .Values.indexer.config.reloadSecurityConfig }}
67
+ - name : reload-security-config
67
68
securityContext :
68
69
{{- toYaml .Values.indexer.securityContext | nindent 12 }}
69
70
image : " {{ .Values.indexer.image.repository }}:{{ .Values.indexer.image.tag | default .Chart.AppVersion }}"
72
73
- sh
73
74
- -c
74
75
- |
76
+ # Wait for indexer to be ready
77
+ until curl -k -u $INDEXER_USERNAME:$INDEXER_PASSWORD https://localhost:9200/_cluster/health; do
78
+ echo "Waiting for indexer to be ready..."
79
+ sleep 10
80
+ done
81
+
75
82
# Run security admin
76
83
export JAVA_HOME=/usr/share/wazuh-indexer/jdk/ && \
77
84
bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh \
@@ -104,6 +111,24 @@ spec:
104
111
value : {{ .Values.indexer.config.sslEnabled | quote }}
105
112
- name : DISABLE_INSTALL_DEMO_CONFIG
106
113
value : " true"
114
+ - name : INDEXER_USERNAME
115
+ valueFrom :
116
+ secretKeyRef :
117
+ {{- if .Values.manager.config.secrets.existingSecretName }}
118
+ name : {{ .Values.manager.config.secrets.existingSecretName }}
119
+ {{- else }}
120
+ name : {{ include "wazuh.fullname" . }}-manager
121
+ {{- end }}
122
+ key : INDEXER_USERNAME
123
+ - name : INDEXER_PASSWORD
124
+ valueFrom :
125
+ secretKeyRef :
126
+ {{- if .Values.manager.config.secrets.existingSecretName }}
127
+ name : {{ .Values.manager.config.secrets.existingSecretName }}
128
+ {{- else }}
129
+ name : {{ include "wazuh.fullname" . }}-manager
130
+ {{- end }}
131
+ key : INDEXER_PASSWORD
107
132
volumeMounts :
108
133
- name : wazuh-indexer
109
134
mountPath : /var/lib/wazuh-indexer
@@ -130,6 +155,7 @@ spec:
130
155
{{- with .Values.indexer.volumeMounts }}
131
156
{{- toYaml . | nindent 12 }}
132
157
{{- end }}
158
+ {{- end }}
133
159
containers :
134
160
- name : {{ include "wazuh.fullname" . }}-indexer
135
161
securityContext :
0 commit comments