Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa7717b3b1 |
@@ -25,7 +25,6 @@ ArgoCD homelab project
|
|||||||
| **longhorn** | [](https://ag.hexor.cy/applications/argocd/longhorn) |
|
| **longhorn** | [](https://ag.hexor.cy/applications/argocd/longhorn) |
|
||||||
| **postgresql** | [](https://ag.hexor.cy/applications/argocd/postgresql) |
|
| **postgresql** | [](https://ag.hexor.cy/applications/argocd/postgresql) |
|
||||||
| **prom-stack** | [](https://ag.hexor.cy/applications/argocd/prom-stack) |
|
| **prom-stack** | [](https://ag.hexor.cy/applications/argocd/prom-stack) |
|
||||||
| **reloader** | [](https://ag.hexor.cy/applications/argocd/reloader) |
|
|
||||||
| **system-upgrade** | [](https://ag.hexor.cy/applications/argocd/system-upgrade) |
|
| **system-upgrade** | [](https://ag.hexor.cy/applications/argocd/system-upgrade) |
|
||||||
|
|
||||||
### Games
|
### Games
|
||||||
|
|||||||
@@ -236,52 +236,29 @@ data:
|
|||||||
|
|
||||||
cd /app
|
cd /app
|
||||||
|
|
||||||
write_xray_api_port() {
|
# Start main process in background
|
||||||
API_PORT="$1"
|
./main &
|
||||||
case "$API_PORT" in
|
MAIN_PID=$!
|
||||||
""|*[!0-9]*)
|
|
||||||
return
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CURRENT_PORT=""
|
# Start continuous port monitoring in background
|
||||||
if [ -f /shared/xray-api-port ]; then
|
{
|
||||||
CURRENT_PORT=$(cat /shared/xray-api-port)
|
sleep 10 # Wait for xray to start initially
|
||||||
fi
|
LAST_PORT=""
|
||||||
|
|
||||||
if [ "$API_PORT" != "$CURRENT_PORT" ]; then
|
while true; do
|
||||||
|
API_PORT=$(netstat -tlpn | grep xray | grep 127.0.0.1 | awk '{print $4}' | cut -d: -f2 | head -1)
|
||||||
|
if [ -n "$API_PORT" ] && [ "$API_PORT" != "$LAST_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
|
||||||
|
LAST_PORT="$API_PORT"
|
||||||
fi
|
fi
|
||||||
}
|
sleep 5 # Check every 5 seconds
|
||||||
|
|
||||||
LOG_PIPE="/tmp/pasarguard-main.log"
|
|
||||||
rm -f "$LOG_PIPE"
|
|
||||||
mkfifo "$LOG_PIPE"
|
|
||||||
|
|
||||||
# Capture main logs so the Xray API listener is not confused with Xray's metrics listener.
|
|
||||||
{
|
|
||||||
while IFS= read -r line; do
|
|
||||||
echo "$line"
|
|
||||||
case "$line" in
|
|
||||||
*"transport/internet/tcp: listening TCP on 127.0.0.1:"*)
|
|
||||||
API_PORT=$(echo "$line" | sed -n 's/.*listening TCP on 127\.0\.0\.1:\([0-9][0-9]*\).*/\1/p')
|
|
||||||
write_xray_api_port "$API_PORT"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
} < "$LOG_PIPE" &
|
} &
|
||||||
LOG_READER_PID=$!
|
PORT_MONITOR_PID=$!
|
||||||
|
|
||||||
# Start main process in background
|
|
||||||
./main > "$LOG_PIPE" 2>&1 &
|
|
||||||
MAIN_PID=$!
|
|
||||||
|
|
||||||
# Wait for main process to finish
|
# Wait for main process to finish
|
||||||
wait $MAIN_PID
|
wait $MAIN_PID
|
||||||
MAIN_STATUS=$?
|
|
||||||
|
|
||||||
# Clean up log reader
|
# Clean up port monitor
|
||||||
wait $LOG_READER_PID 2>/dev/null
|
kill $PORT_MONITOR_PID 2>/dev/null
|
||||||
rm -f "$LOG_PIPE"
|
|
||||||
exit $MAIN_STATUS
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ spec:
|
|||||||
mountPath: /scripts
|
mountPath: /scripts
|
||||||
containers:
|
containers:
|
||||||
- name: pasarguard-node
|
- name: pasarguard-node
|
||||||
image: pasarguard/node:v0.5.0
|
image: pasarguard/node:v0.4.0
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
@@ -116,20 +116,14 @@ spec:
|
|||||||
- name: metrics
|
- name: metrics
|
||||||
containerPort: 9550
|
containerPort: 9550
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
startupProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /scrape
|
path: /scrape
|
||||||
port: metrics
|
port: metrics
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 36
|
|
||||||
livenessProbe:
|
|
||||||
tcpSocket:
|
|
||||||
port: metrics
|
|
||||||
initialDelaySeconds: 60
|
initialDelaySeconds: 60
|
||||||
periodSeconds: 30
|
periodSeconds: 30
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
failureThreshold: 6
|
failureThreshold: 3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /scrape
|
path: /scrape
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: RUST_LOG
|
- name: RUST_LOG
|
||||||
value: "info"
|
value: "info"
|
||||||
- name: WEB_PETTING_DEBUG
|
|
||||||
value: "false"
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: "256Mi"
|
memory: "256Mi"
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
apiVersion: argoproj.io/v1alpha1
|
|
||||||
kind: Application
|
|
||||||
metadata:
|
|
||||||
name: reloader
|
|
||||||
namespace: argocd
|
|
||||||
spec:
|
|
||||||
project: core
|
|
||||||
destination:
|
|
||||||
namespace: reloader
|
|
||||||
server: https://kubernetes.default.svc
|
|
||||||
source:
|
|
||||||
repoURL: ssh://git@gt.hexor.cy:30022/ab/homelab.git
|
|
||||||
targetRevision: HEAD
|
|
||||||
path: k8s/core/reloader
|
|
||||||
syncPolicy:
|
|
||||||
automated:
|
|
||||||
selfHeal: true
|
|
||||||
prune: true
|
|
||||||
syncOptions:
|
|
||||||
- CreateNamespace=true
|
|
||||||
- ServerSideApply=true
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
||||||
kind: Kustomization
|
|
||||||
|
|
||||||
resources:
|
|
||||||
- app.yaml
|
|
||||||
|
|
||||||
helmCharts:
|
|
||||||
- name: reloader
|
|
||||||
repo: https://stakater.github.io/stakater-charts
|
|
||||||
version: 2.2.12
|
|
||||||
releaseName: reloader
|
|
||||||
namespace: reloader
|
|
||||||
valuesFile: values.yaml
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
reloader:
|
|
||||||
watchGlobally: true
|
|
||||||
autoReloadAll: true
|
|
||||||
reloadOnCreate: true
|
|
||||||
reloadOnDelete: false
|
|
||||||
reloadStrategy: annotations
|
|
||||||
ignoreConfigMaps: false
|
|
||||||
ignoreSecrets: false
|
|
||||||
ignoreJobs: false
|
|
||||||
ignoreCronJobs: false
|
|
||||||
enableHA: true
|
|
||||||
syncAfterRestart: true
|
|
||||||
logLevel: info
|
|
||||||
rbac:
|
|
||||||
enabled: true
|
|
||||||
deployment:
|
|
||||||
replicas: 2
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 10m
|
|
||||||
memory: 128Mi
|
|
||||||
limits:
|
|
||||||
cpu: 150m
|
|
||||||
memory: 512Mi
|
|
||||||
Reference in New Issue
Block a user