This commit is contained in:
miwr 2025-04-23 10:32:16 +02:00
parent 3f6ec41ece
commit d45c89c0b8
3 changed files with 8 additions and 7 deletions

View file

@ -12,11 +12,11 @@ data:
start.sh: | start.sh: |
#!/bin/sh #!/bin/sh
echo "Starting mini HTTP server on port 8080..." echo "Starting mini HTTP server on port 3030..."
while true; do while true; do
echo "Waiting for HTTP POST..." echo "Waiting for HTTP POST..."
REQUEST=$(nc -l -p 8080) REQUEST=$(nc -l -p 3030)
echo "$REQUEST" | grep -q "POST /" && { echo "$REQUEST" | grep -q "POST /" && {
echo "Received POST request, sending SIGHUP..." echo "Received POST request, sending SIGHUP..."
@ -26,5 +26,5 @@ data:
RESPONSE="HTTP/1.1 405 Method Not Allowed\r\nContent-Length: 18\r\n\r\nMethod Not Allowed" RESPONSE="HTTP/1.1 405 Method Not Allowed\r\nContent-Length: 18\r\n\r\nMethod Not Allowed"
} }
echo -e "$RESPONSE" | nc -N localhost 8081 echo -e "$RESPONSE" | nc -N localhost 3031
done done

View file

@ -5,8 +5,9 @@ metadata:
namespace: openbao namespace: openbao
spec: spec:
selector: selector:
app: openbao app.kubernetes.io/instance: openbao
component: server
ports: ports:
- protocol: TCP - protocol: TCP
port: 8080 port: 3030
targetPort: 8080 targetPort: 3030

View file

@ -39,7 +39,7 @@ server:
image: alpine:latest image: alpine:latest
command: ["/bin/sh", "/tmp/start.sh"] command: ["/bin/sh", "/tmp/start.sh"]
ports: ports:
- containerPort: 8080 - containerPort: 3030
volumeMounts: volumeMounts:
- name: sidecar-script - name: sidecar-script
mountPath: /tmp/start.sh mountPath: /tmp/start.sh