- name: sidecar-nginx
image: nginx:latest ports: - containerPort: 8080 volumeMounts: - name: idecar-script mountPath: /etc/nginx subPath: nginx.conf subPathExpr: 'nginx.conf' - name: idecar-script mountPath: /tmp/sidecar.sh subPath: sidecar.sh mode: 0755 - name: passwd-volume mountPath: /etc/passwd subPath: passwd
This commit is contained in:
parent
949cf77c4e
commit
6811280b92
3 changed files with 36 additions and 8 deletions
|
@ -11,6 +11,6 @@ data:
|
|||
missingok
|
||||
notifempty
|
||||
postrotate
|
||||
kill -SIGHUP $(pidof bao)
|
||||
echo -e "POST / HTTP/1.1\r\nHost: sidecar-script-service.openbao.svc.cluster.local:8080\r\nContent-Length: 0\r\n\r\n" | nc sidecar-script-service.openbao.svc.cluster.local 8080
|
||||
endscript
|
||||
}
|
|
@ -5,9 +5,21 @@ metadata:
|
|||
namespace: openbao
|
||||
data:
|
||||
sidecar.sh: |
|
||||
#!/bin/sh
|
||||
echo "Starting sidecar listener on port 8080..."
|
||||
while true; do
|
||||
echo -e "HTTP/1.1 200 OK\n\nSIGHUP sent to OpenBAO" | nc -l -p 8080
|
||||
kill $(pidof bao) || echo "OpenBAO process not found"
|
||||
done
|
||||
#!/bin/bash
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,13 +28,29 @@ server:
|
|||
securityContext:
|
||||
runAsUser: 100
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
- containerPort: 8081
|
||||
volumeMounts:
|
||||
- name: passwd-volume
|
||||
mountPath: /etc/passwd
|
||||
subPath: passwd
|
||||
- name: sidecar-script
|
||||
mountPath: /tmp
|
||||
- name: sidecar-nginx
|
||||
image: nginx:latest
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
- name: idecar-script
|
||||
mountPath: /etc/nginx
|
||||
subPath: nginx.conf
|
||||
subPathExpr: 'nginx.conf'
|
||||
- name: idecar-script
|
||||
mountPath: /tmp/sidecar.sh
|
||||
subPath: sidecar.sh
|
||||
mode: 0755
|
||||
- name: passwd-volume
|
||||
mountPath: /etc/passwd
|
||||
subPath: passwd
|
||||
volumes:
|
||||
- name: logrotate-config-volume
|
||||
configMap:
|
||||
|
|
Loading…
Reference in a new issue