Add chart starrocks/1.11.0
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
{{- if .Values.initPassword.enabled }}
|
||||
{{- if not .Values.initPassword.passwordSecret }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "starrockscluster.initpassword.secret.name" . }}
|
||||
namespace: {{ template "starrockscluster.namespace" . }}
|
||||
data:
|
||||
password: {{ .Values.initPassword.password | b64enc }}
|
||||
---
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "starrockscluster.name" . }}-initpwd-shell
|
||||
namespace: {{ template "starrockscluster.namespace" . }}
|
||||
data:
|
||||
fe_initpwd.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
# ensure `mysql` command can be ended with 30 seconds
|
||||
# Change the root password during initial installation
|
||||
init_pwd_sql="SET PASSWORD = PASSWORD('$INIT_PWD');"
|
||||
success=`mysql --connect-timeout 30 -h $1 -P $2 -u root --skip-column-names --batch -e "$init_pwd_sql" 2>&1`
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo $success
|
||||
errcode=`echo $success | awk -F " " '{print $2}'`
|
||||
echo "error code: $errcode"
|
||||
|
||||
# Password error, believed to have been changed, exiting normally
|
||||
if [[ $errcode = '1045' || $errcode = '1064' ]] ; then
|
||||
echo "Password error, believed to have been changed, exiting normally"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Other unsuccessful errors, abnormal exit
|
||||
echo "Other unsuccessful errors, abnormal exit"
|
||||
exit 1
|
||||
|
||||
fi
|
||||
|
||||
echo "Successfully modified password"
|
||||
exit 0
|
||||
{{- end }}
|
||||
@@ -0,0 +1,71 @@
|
||||
{{- if and .Values.initPassword.enabled .Values.initPassword.isInstall .Release.IsInstall }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "starrockscluster.name" . }}-initpwd
|
||||
namespace: {{ template "starrockscluster.namespace" . }}
|
||||
labels:
|
||||
cluster: {{ template "starrockscluster.name" . }}
|
||||
{{- if .Values.initPassword.annotations }}
|
||||
annotations:
|
||||
{{- toYaml .Values.initPassword.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
template:
|
||||
{{- if .Values.initPassword.podAnnotations }}
|
||||
metadata:
|
||||
annotations:
|
||||
{{- toYaml .Values.initPassword.podAnnotations | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if or .Values.starrocksFESpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- include "starrockscluster.fe.imagePullSecrets" . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.starrocksFESpec.affinity .Values.starrocksCluster.componentValues.affinity }}
|
||||
affinity:
|
||||
{{- include "starrockscluster.fe.affinity" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.starrocksFESpec.tolerations .Values.starrocksCluster.componentValues.tolerations }}
|
||||
tolerations:
|
||||
{{- include "starrockscluster.fe.tolerations" . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "starrockscluster.name" . }}-initpwd
|
||||
{{- if .Values.initPassword.image }}
|
||||
image: {{ .Values.initPassword.image }}
|
||||
{{- else }}
|
||||
image: {{ .Values.starrocksFESpec.image.repository }}:{{ include "starrockscluster.fe.image.tag" . }}
|
||||
{{- end }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
{{- if .Values.initPassword.resources }}
|
||||
resources: {{- toYaml .Values.initPassword.resources | nindent 10 }}
|
||||
{{- end }}
|
||||
command:
|
||||
- /bin/bash
|
||||
args:
|
||||
- /opt/starrocks/fe_initpwd.sh
|
||||
- {{ template "starrockscluster.name" . }}-fe-0.{{ template "starrockscluster.name" . }}-fe-search
|
||||
- "{{- default 9030 (include "starrockscluster.fe.query.port" .) }}"
|
||||
env:
|
||||
- name: INIT_PWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: password
|
||||
name: {{ template "starrockscluster.initpassword.secret.name" . }}
|
||||
volumeMounts:
|
||||
- mountPath: /opt/starrocks/fe_initpwd.sh
|
||||
name: {{ template "starrockscluster.name" . }}-initpwd-shell
|
||||
subPath: fe_initpwd.sh
|
||||
volumes:
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
items:
|
||||
- key: fe_initpwd.sh
|
||||
path: fe_initpwd.sh
|
||||
name: {{ template "starrockscluster.name" . }}-initpwd-shell
|
||||
optional: false
|
||||
name: {{ template "starrockscluster.name" . }}-initpwd-shell
|
||||
restartPolicy: OnFailure
|
||||
backoffLimit: 10
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user