- 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
|
missingok
|
||||||
notifempty
|
notifempty
|
||||||
postrotate
|
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
|
endscript
|
||||||
}
|
}
|
|
@ -5,9 +5,21 @@ metadata:
|
||||||
namespace: openbao
|
namespace: openbao
|
||||||
data:
|
data:
|
||||||
sidecar.sh: |
|
sidecar.sh: |
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
echo "Starting sidecar listener on port 8080..."
|
echo "Sending SIGHUP to OpenBAO..."
|
||||||
while true; do
|
kill -SIGHUP $(pidof bao) || echo "OpenBAO process not found"
|
||||||
echo -e "HTTP/1.1 200 OK\n\nSIGHUP sent to OpenBAO" | nc -l -p 8080
|
|
||||||
kill $(pidof bao) || echo "OpenBAO process not found"
|
nginx.conf: |
|
||||||
done
|
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:
|
securityContext:
|
||||||
runAsUser: 100
|
runAsUser: 100
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8081
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: passwd-volume
|
- name: passwd-volume
|
||||||
mountPath: /etc/passwd
|
mountPath: /etc/passwd
|
||||||
subPath: passwd
|
subPath: passwd
|
||||||
- name: sidecar-script
|
- name: sidecar-script
|
||||||
mountPath: /tmp
|
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:
|
volumes:
|
||||||
- name: logrotate-config-volume
|
- name: logrotate-config-volume
|
||||||
configMap:
|
configMap:
|
||||||
|
|
Loading…
Reference in a new issue