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

@@ -28,6 +28,9 @@ rules:
- apiGroups: ["traefik.io", "traefik.containo.us"]
resources: ["ingressroutetcps"]
verbs: ["get", "list", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "patch", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
@@ -88,12 +91,36 @@ spec:
app: pasarguard-node-ingress
spec:
serviceAccountName: pasarguard-node-ingress
# Add node name as annotation for service selector creation
initContainers:
- name: label-pod
image: bitnami/kubectl:latest
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command:
- /bin/bash
- -c
- |
# Add node label to pod
NODE_SHORT=$(echo ${NODE_NAME} | cut -d. -f1)
kubectl label pod ${POD_NAME} -n ${POD_NAMESPACE} node-name=${NODE_SHORT} --overwrite
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: xray-node-address
- key: xray-public-address
operator: Exists
initContainers:
- name: init-uuid