Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,25 @@ data:
client.security.sasl.mechanism: {{ upper $internalMechanism }}
{{- end }}
{{- end }}

entrypoint.sh: |
#!/bin/sh
set -e

COMPONENT="$1"

FLUSS_SERVER_ID=${POD_NAME##*-}
cp /opt/conf/server.yaml $FLUSS_HOME/conf

BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}"
ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.${COMPONENT}-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}"

echo "" >> $FLUSS_HOME/conf/server.yaml
echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml
echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml

if [ "$COMPONENT" = "tablet" ]; then
echo "tablet-server.id: ${FLUSS_SERVER_ID}" >> $FLUSS_HOME/conf/server.yaml
fi

exec bin/${COMPONENT}-server.sh start-foreground
15 changes: 2 additions & 13 deletions helm/templates/sts-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,8 @@ spec:
containerPort: {{ .Values.listeners.client.port }}
command:
- "/bin/sh"
- "-c"
- |
export FLUSS_SERVER_ID=${POD_NAME##*-} && \
cp /opt/conf/server.yaml $FLUSS_HOME/conf && \

BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}" && \
ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.coordinator-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}" && \

echo "" >> $FLUSS_HOME/conf/server.yaml && \
echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \
echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \

bin/coordinator-server.sh start-foreground
- "/opt/conf/entrypoint.sh"
- "coordinator"
livenessProbe:
failureThreshold: 100
timeoutSeconds: 1
Expand Down
16 changes: 2 additions & 14 deletions helm/templates/sts-tablet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,8 @@ spec:
containerPort: {{ .Values.listeners.client.port }}
command:
- "/bin/sh"
- "-c"
- |
export FLUSS_SERVER_ID=${POD_NAME##*-} && \
cp /opt/conf/server.yaml $FLUSS_HOME/conf && \

BIND_LISTENERS="INTERNAL://${POD_IP}:{{ .Values.listeners.internal.port }}, CLIENT://${POD_IP}:{{ .Values.listeners.client.port }}" && \
ADVERTISED_LISTENERS="CLIENT://${POD_NAME}.tablet-server-hs.${POD_NAMESPACE}.svc.cluster.local:{{ .Values.listeners.client.port }}" && \

echo "" >> $FLUSS_HOME/conf/server.yaml && \
echo "tablet-server.id: ${FLUSS_SERVER_ID}" >> $FLUSS_HOME/conf/server.yaml && \
echo "bind.listeners: ${BIND_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \
echo "advertised.listeners: ${ADVERTISED_LISTENERS}" >> $FLUSS_HOME/conf/server.yaml && \

bin/tablet-server.sh start-foreground
- "/opt/conf/entrypoint.sh"
- "tablet"
livenessProbe:
failureThreshold: 100
timeoutSeconds: 1
Expand Down
6 changes: 3 additions & 3 deletions helm/tests/security_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ tests:
path: data["server.yaml"]
pattern: 'security\.sasl\.enabled\.mechanisms: PLAIN,PLAIN'
- it: writes server yaml using expected destination path
template: templates/sts-tablet.yaml
template: templates/configmap.yaml
asserts:
- matchRegex:
path: spec.template.spec.containers[0].command[2]
path: data["entrypoint.sh"]
pattern: 'cp /opt/conf/server\.yaml \$FLUSS_HOME/conf'
- matchRegex:
path: spec.template.spec.containers[0].command[2]
path: data["entrypoint.sh"]
pattern: '>> \$FLUSS_HOME/conf/server\.yaml'
Loading