Reworked pasarguard nodes daemonset.
This commit is contained in:
@@ -254,8 +254,7 @@ data:
|
|||||||
# Detect xray API port BEFORE starting monitoring loop
|
# Detect xray API port BEFORE starting monitoring loop
|
||||||
echo "Detecting xray API port..."
|
echo "Detecting xray API port..."
|
||||||
for i in $(seq 1 60); do
|
for i in $(seq 1 60); do
|
||||||
# Without hostNetwork, use ss to check listening ports in the same network namespace
|
API_PORT=$(netstat -tlnp 2>/dev/null | grep xray | grep 127.0.0.1 | awk '{print $4}' | cut -d: -f2 | head -1)
|
||||||
API_PORT=$(ss -tlnp 2>/dev/null | grep xray | grep 127.0.0.1 | awk '{print $4}' | sed 's/.*://' | head -1)
|
|
||||||
if [ -n "$API_PORT" ]; then
|
if [ -n "$API_PORT" ]; then
|
||||||
echo "Found xray API port: $API_PORT"
|
echo "Found xray API port: $API_PORT"
|
||||||
echo -n "$API_PORT" > /shared/xray-api-port
|
echo -n "$API_PORT" > /shared/xray-api-port
|
||||||
@@ -274,7 +273,7 @@ data:
|
|||||||
LAST_PORT="$API_PORT"
|
LAST_PORT="$API_PORT"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
API_PORT=$(ss -tlnp 2>/dev/null | grep xray | grep 127.0.0.1 | awk '{print $4}' | sed 's/.*://' | head -1)
|
API_PORT=$(netstat -tlnp 2>/dev/null | grep xray | grep 127.0.0.1 | awk '{print $4}' | cut -d: -f2 | head -1)
|
||||||
if [ -n "$API_PORT" ] && [ "$API_PORT" != "$LAST_PORT" ]; then
|
if [ -n "$API_PORT" ] && [ "$API_PORT" != "$LAST_PORT" ]; then
|
||||||
echo "API port changed from $LAST_PORT to $API_PORT"
|
echo "API port changed from $LAST_PORT to $API_PORT"
|
||||||
echo -n "$API_PORT" > /shared/xray-api-port
|
echo -n "$API_PORT" > /shared/xray-api-port
|
||||||
|
|||||||
@@ -132,14 +132,6 @@ spec:
|
|||||||
periodSeconds: 30
|
periodSeconds: 30
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /scrape
|
|
||||||
port: metrics
|
|
||||||
initialDelaySeconds: 45
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "64Mi"
|
memory: "64Mi"
|
||||||
|
|||||||
Reference in New Issue
Block a user