new service

This commit is contained in:
miwr 2025-04-22 14:42:37 +02:00
parent 350e3a804c
commit 87ce37972d
2 changed files with 18 additions and 20 deletions

View file

@ -5,21 +5,15 @@ metadata:
namespace: openbao
data:
sidecar.sh: |
#!/bin/bash
#!/bin/sh
echo "Sending SIGHUP to OpenBAO..."
kill -SIGHUP $(pidof bao) || echo "OpenBAO process not found"
nginx.conf: |
events {}
http {
server {
listen 8080;
location / {
exec /tmp/sidecar.sh;
default_type text/plain;
return 200 "SIGHUP sent to OpenBAO\n";
}
}
}
start.sh: |
#!/bin/sh
echo "Starting mini HTTP server on port 8080..."
while true; do
# Wait for HTTP POST and respond
{ echo -ne "HTTP/1.1 200 OK\r\nContent-Length: 26\r\n\r\nSIGHUP sent to OpenBAO"; \
/tmp/sidecar.sh; } | nc -l -p 8080 -q 1
done

View file

@ -35,14 +35,18 @@ server:
subPath: passwd
- name: sidecar-script
mountPath: /tmp
- name: sidecar-nginx
image: nginx:latest
- name: sidecar
image: alpine:latest
command: ["/bin/sh", "/tmp/start.sh"]
ports:
- containerPort: 8080
- containerPort: 8080
volumeMounts:
- name: sidecar-script
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
mountPath: /tmp/sidecar.sh
subPath: sidecar.sh
- name: sidecar-script
mountPath: /tmp/start.sh
subPath: start.sh
- name: sidecar-script
mountPath: /tmp/sidecar.sh
subPath: sidecar.sh