apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: porter-agent
  labels:
    control-plane: porter-agent
    controller-tools.k8s.io: "1.0"
spec:
  selector:
    matchLabels:
      app: porter-agent
  template:
    metadata:
      labels:
        app: porter-agent
    spec:
      containers:
        - name: porter-agent
          image: magicsong/porter-agent:latest
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              cpu: 100m
              memory: 30Mi
            requests:
              cpu: 100m
              memory: 20Mi
          env:
            - name: MY_NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: MY_NODE_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.hostIP
          securityContext:
            capabilities:
              add:
                - "NET_ADMIN"
      hostNetwork: true 


    