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