File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 {{- end }}
5454
5555 {{- end }}
56+
57+ entrypoint.sh : |
58+ #!/bin/sh
59+ set -e
60+
61+ COMPONENT="$1"
62+
63+ FLUSS_SERVER_ID=${POD_NAME##*-}
64+ cp /opt/conf/server.yaml $FLUSS_HOME/conf
65+
66+ BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}"
67+ ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.${COMPONENT}-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}"
68+
69+ echo "" >> $FLUSS_HOME/conf/server.yaml
70+ echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml
71+ echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml
72+
73+ if [ "$COMPONENT" = "tablet" ]; then
74+ echo "tablet-server.id: ${FLUSS_SERVER_ID}" >> $FLUSS_HOME/conf/server.yaml
75+ fi
76+
77+ 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