From 9349bc5122137dd1e1809890f198aeb7d9893e63 Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 30 Jul 2026 11:02:29 +0100 Subject: [PATCH] watcher struggling --- Nginx.kube.yaml | 60 ++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/Nginx.kube.yaml b/Nginx.kube.yaml index e24f521..9b75c6a 100644 --- a/Nginx.kube.yaml +++ b/Nginx.kube.yaml @@ -4,8 +4,8 @@ metadata: name: reverse-proxy --- apiVersion: apps/v1 -#kind: Deployment -kind: DaemonSet +kind: Deployment +#kind: DaemonSet metadata: name: reverse-proxy namespace: reverse-proxy @@ -21,9 +21,9 @@ spec: labels: app: reverse-proxy spec: - hostNetwork: true - dnsPolicy: ClusterFirstWithHostNet # required when hostNetwork: true - #nodeName: kube-master + #hostNetwork: true + #dnsPolicy: ClusterFirstWithHostNet # required when hostNetwork: true + nodeName: kube-master # Allows the sidecar to see and signal the Nginx process shareProcessNamespace: true containers: @@ -67,27 +67,27 @@ spec: cpu: 250m memory: 250Mi - - name: watcher - image: alpine:latest - command: ["/bin/sh", "-c"] - args: - - | +# - name: watcher +# image: alpine:latest +# command: ["/bin/sh", "-c"] +# args: +# - |# - apk add --no-cache inotify-tools; - # Ensure file exists so inotify doesn't fail - touch /etc/nginx/blacklisted.d/blacklisted-sessions.conf; - echo "Watcher started on /etc/nginx/blacklisted.d/blacklisted-sessions.conf" +# apk add --no-cache inotify-tools; +# # Ensure file exists so inotify doesn't fail +# touch /etc/nginx/blacklisted.d/blacklisted-sessions.conf; +# echo "Watcher started on /etc/nginx/blacklisted.d/blacklisted-sessions.conf" - while inotifywait -e modify /etc/nginx/blacklisted.d/blacklisted-sessions.conf; do - echo "Change detected, waiting 5 seconds to batch updates..." - sleep 5; +# while inotifywait -e modify /etc/nginx/blacklisted.d/blacklisted-sessions.conf; do +# echo "Change detected, waiting 5 seconds to batch updates..." +# sleep 5; - # Check if Nginx is actually running before signaling - if pgrep nginx > /dev/null; then - echo "Reloading Nginx..." - pkill -HUP nginx - fi - done +# # Check if Nginx is actually running before signaling +# if pgrep nginx > /dev/null; then +# echo "Reloading Nginx..." +# pkill -HUP nginx +# fi +# done volumeMounts: - name: blacklisted-memory-volume @@ -95,12 +95,12 @@ spec: tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods - - key: node-role.kubernetes.io/control-plane - operator: Exists - effect: NoSchedule - - key: node-role.kubernetes.io/master - operator: Exists - effect: NoSchedule + #- key: node-role.kubernetes.io/control-plane + # operator: Exists + # effect: NoSchedule + #- key: node-role.kubernetes.io/master + # operator: Exists + # effect: NoSchedule volumes: - name: reverse-proxy-log @@ -193,6 +193,6 @@ spec: type: LoadBalancer - externalTrafficPolicy: Local + #externalTrafficPolicy: Local selector: app: reverse-proxy