Reworked pasarguard nodes daemonset.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user