File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 client.security.sasl.mechanism: {{ upper $internalMechanism }}
4343 {{- end }}
4444 {{- end }}
45+
46+ entrypoint.sh : |
47+ #!/bin/sh
48+ set -e
49+
50+ COMPONENT="$1"
51+
52+ FLUSS_SERVER_ID=${POD_NAME##*-}
53+ cp /opt/conf/server.yaml $FLUSS_HOME/conf
54+
55+ BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}"
56+ ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.${COMPONENT}-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}"
57+
58+ echo "" >> $FLUSS_HOME/conf/server.yaml
59+ echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml
60+ echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml
61+
62+ if [ "$COMPONENT" = "tablet" ]; then
63+ echo "tablet-server.id: ${FLUSS_SERVER_ID}" >> $FLUSS_HOME/conf/server.yaml
64+ fi
65+
66+ exec bin/${COMPONENT}-server.sh start-foreground
Original file line number Diff line number Diff line change 7171 containerPort : {{ .Values.listeners.client.port }}
7272 command :
7373 - " /bin/sh"
74- - " -c"
75- - |
76- export FLUSS_SERVER_ID=${POD_NAME##*-} && \
77- cp /opt/conf/server.yaml $FLUSS_HOME/conf && \
78-
79- BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}" && \
80- ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.coordinator-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}" && \
81-
82- echo "" >> $FLUSS_HOME/conf/server.yaml && \
83- echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \
84- echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \
85-
86- bin/coordinator-server.sh start-foreground
74+ - " /opt/conf/entrypoint.sh"
75+ - " coordinator"
8776 livenessProbe :
8877 failureThreshold : 100
8978 timeoutSeconds : 1
Original file line number Diff line number Diff line change 6767 containerPort : {{ .Values.listeners.client.port }}
6868 command :
6969 - " /bin/sh"
70- - " -c"
71- - |
72- export FLUSS_SERVER_ID=${POD_NAME##*-} && \
73- cp /opt/conf/server.yaml $FLUSS_HOME/conf && \
74-
75- BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}" && \
76- ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.tablet-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}" && \
77-
78- echo "" >> $FLUSS_HOME/conf/server.yaml && \
79- echo "tablet-server.id: ${FLUSS_SERVER_ID}" >> $FLUSS_HOME/conf/server.yaml && \
80- echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \
81- echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \
82-
83- bin/tablet-server.sh start-foreground
70+ - " /opt/conf/entrypoint.sh"
71+ - " tablet"
8472 livenessProbe :
8573 failureThreshold : 100
8674 timeoutSeconds : 1
Original file line number Diff line number Diff line change @@ -274,11 +274,11 @@ tests:
274274 path : data["server.yaml"]
275275 pattern : ' security\.sasl\.enabled\.mechanisms: PLAIN,PLAIN'
276276 - it : writes server yaml using expected destination path
277- template : templates/sts-tablet .yaml
277+ template : templates/configmap .yaml
278278 asserts :
279279 - matchRegex :
280- path : spec.template.spec.containers[0].command[2 ]
280+ path : data["entrypoint.sh" ]
281281 pattern : ' cp /opt/conf/server\.yaml \$FLUSS_HOME/conf'
282282 - matchRegex :
283- path : spec.template.spec.containers[0].command[2 ]
283+ path : data["entrypoint.sh" ]
284284 pattern : ' >> \$FLUSS_HOME/conf/server\.yaml'
You can’t perform that action at this time.
0 commit comments