Reworked pasarguard nodes daemonset.
Some checks failed
Update Kubernetes Services Wiki / Generate and Update K8s Wiki (push) Successful in 10s
Check with kubeconform / lint (push) Has been cancelled
Auto-update README / Generate README and Create MR (push) Has been cancelled

This commit is contained in:
Ultradesu
2025-12-08 18:30:34 +02:00
parent bb9ce21bb4
commit 4241c81fc0
2 changed files with 33 additions and 5 deletions

View File

@@ -13,11 +13,11 @@ data:
# NODE_NAME is already set via environment variable
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
# Get DNS name from node label xray-node-address
DNS_NAME=$(kubectl get node "${NODE_NAME}" -o jsonpath='{.metadata.labels.xray-node-address}')
# Get DNS name from node label xray-public-address
DNS_NAME=$(kubectl get node "${NODE_NAME}" -o jsonpath='{.metadata.labels.xray-public-address}')
if [ -z "${DNS_NAME}" ]; then
echo "ERROR: Node ${NODE_NAME} does not have label 'xray-node-address'"
echo "ERROR: Node ${NODE_NAME} does not have label 'xray-public-address'"
exit 1
fi
@@ -112,7 +112,7 @@ data:
echo "Creating Service: ${SERVICE_NAME} for node ${NODE_NAME} (short: ${NODE_SHORT_NAME})"
# Create Service with pod selector
# Create Service with pod selector including node name
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Service
@@ -126,6 +126,7 @@ data:
type: ClusterIP
selector:
app: pasarguard-node-ingress
node-name: ${NODE_SHORT_NAME}
ports:
- name: proxy
port: 443