signal-sidecar-script
This commit is contained in:
parent
1a85de6cda
commit
c754dc80bc
2 changed files with 31 additions and 16 deletions
|
@ -0,0 +1,15 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: signal-sidecar-script
|
||||||
|
namespace: openbao
|
||||||
|
data:
|
||||||
|
sidecar.sh: |
|
||||||
|
#!/bin/sh
|
||||||
|
echo "Starting sidecar listener on port 8080..."
|
||||||
|
while true; do
|
||||||
|
# Listen for an HTTP request (basic netcat-based server)
|
||||||
|
echo -e "HTTP/1.1 200 OK\n\nSIGHUP sent to OpenBAO" | nc -l -p 8080 -q 1
|
||||||
|
# Send SIGHUP signal
|
||||||
|
kill -SIGHUP $(pidof bao) || echo "OpenBAO process not found"
|
||||||
|
done
|
|
@ -23,22 +23,18 @@ server:
|
||||||
mountPath: /etc/passwd
|
mountPath: /etc/passwd
|
||||||
subPath: passwd
|
subPath: passwd
|
||||||
- name: logrotate2
|
- name: logrotate2
|
||||||
image: imroc/logrotate:latest
|
image: apline:latest
|
||||||
imagePullPolicy: IfNotPresent
|
command: ["/bin/sh", "-c", "chmod +x /app/sidecar.sh && /app/sidecar.sh"]
|
||||||
env:
|
securityContext:
|
||||||
- name: LOGROTATE_FILE_PATTERN
|
runAsUser: 100
|
||||||
value: "/openbao/logs/openbao/*.log"
|
ports:
|
||||||
- name: LOGROTATE_FILESIZE
|
- containerPort: 8080
|
||||||
value: "1M"
|
|
||||||
- name: LOGROTATE_FILENUM
|
|
||||||
value: "10"
|
|
||||||
- name: CRON_EXPR
|
|
||||||
value: "*/1 * * * *"
|
|
||||||
- name: CROND_LOGLEVEL
|
|
||||||
value: "7"
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: host-log-storage
|
- name: passwd-volume
|
||||||
mountPath: /openbao/logs
|
mountPath: /etc/passwd
|
||||||
|
subPath: passwd
|
||||||
|
- name: sidecar-script
|
||||||
|
mountPath: /app
|
||||||
volumes:
|
volumes:
|
||||||
- name: logrotate-config-volume
|
- name: logrotate-config-volume
|
||||||
configMap:
|
configMap:
|
||||||
|
@ -51,7 +47,11 @@ server:
|
||||||
- name: host-log-storage
|
- name: host-log-storage
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /var/log
|
path: /var/log
|
||||||
type: Directory
|
type: Directory
|
||||||
|
- name: sidecar-script
|
||||||
|
configMap:
|
||||||
|
name: signal-sidecar-script
|
||||||
|
defaultMode: 0755
|
||||||
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /openbao/logs
|
- mountPath: /openbao/logs
|
||||||
|
|
Loading…
Reference in a new issue