apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels: {component: nsx-node-agent, tier: nsx-networking, version: v1}
  name: nsx-node-agent
  namespace: nsx-system
spec:
  selector:
    matchLabels: {component: nsx-node-agent, tier: nsx-networking, version: v1}
  template:
    metadata:
      annotations: {container.apparmor.security.beta.kubernetes.io/nsx-node-agent: localhost/node-agent-apparmor}
      labels: {component: nsx-node-agent, tier: nsx-networking, version: v1}
    spec:
      containers:
      - command: [start_node_agent]
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef: {fieldPath: metadata.name}
        - {name: CONTAINER_NAME, value: nsx-node-agent}
        image: "{{.NcpImage}}"
        imagePullPolicy: IfNotPresent
        livenessProbe:
          exec:
            command: [/bin/sh, -c, check_pod_liveness nsx-node-agent 5]
          failureThreshold: 5
          initialDelaySeconds: 60
          periodSeconds: 10
          timeoutSeconds: 5
        name: nsx-node-agent
        securityContext:
          capabilities:
            add: [NET_ADMIN, SYS_ADMIN, SYS_PTRACE, DAC_READ_SEARCH]
        volumeMounts:
        - {mountPath: /etc/nsx-ujo, name: projected-volume, readOnly: true}
        - {mountPath: /var/run/openvswitch, name: openvswitch}
        - {mountPath: /var/run/nsx-ujo, name: var-run-ujo}
        - {mountPath: /host/var/run/netns, mountPropagation: HostToContainer, name: netns}
        - {mountPath: /host/proc, name: proc, readOnly: true}
        - {mountPath: /var/lib/kubelet/device-plugins/, name: device-plugins, readOnly: true}
        - {mountPath: /var/log/nsx-ujo, name: host-var-log-ujo}
      - command: [start_kube_proxy]
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef: {fieldPath: metadata.name}
        - {name: CONTAINER_NAME, value: nsx-kube-proxy}
        image: "{{.NcpImage}}"
        imagePullPolicy: IfNotPresent
        livenessProbe:
          exec:
            command: [/bin/sh, -c, check_pod_liveness nsx-kube-proxy 5]
          failureThreshold: 5
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 5
        name: nsx-kube-proxy
        securityContext:
          capabilities:
            add: [NET_ADMIN, SYS_ADMIN, SYS_PTRACE, DAC_READ_SEARCH]
        volumeMounts:
        - {mountPath: /etc/nsx-ujo, name: projected-volume, readOnly: true}
        - {mountPath: /var/run/openvswitch, name: openvswitch}
        - {mountPath: /var/log/nsx-ujo, name: host-var-log-ujo}
      - command: [start_ovs]
        image: "{{.NcpImage}}"
        imagePullPolicy: IfNotPresent
        livenessProbe:
          exec:
            command: [/bin/sh, -c, check_pod_liveness nsx-ovs 10]
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 10
        name: nsx-ovs
        securityContext:
          capabilities:
            add: [NET_ADMIN, SYS_ADMIN, SYS_NICE, SYS_MODULE]
        volumeMounts:
        - {mountPath: /etc/nsx-ujo, name: projected-volume, readOnly: true}
        - {mountPath: /etc/openvswitch, name: var-run-ujo, subPath: openvswitch-db}
        - {mountPath: /var/run/openvswitch, name: openvswitch}
        - {mountPath: /sys, name: host-sys, readOnly: true}
        - {mountPath: /host/etc/openvswitch, name: host-original-ovs-db}
        - {mountPath: /lib/modules, name: host-modules, readOnly: true}
        - {mountPath: /host/etc/os-release, name: host-os-release, readOnly: true}
        - {mountPath: /var/log/openvswitch, name: host-var-log-ujo, subPath: openvswitch}
        - {mountPath: /var/log/nsx-ujo, name: host-var-log-ujo}
      hostNetwork: true
      serviceAccountName: nsx-node-agent-svc-account
      terminationGracePeriodSeconds: 60
      tolerations:
      - {effect: NoSchedule, key: node-role.kubernetes.io/master}
      - {effect: NoSchedule, key: node.kubernetes.io/not-ready}
      - {effect: NoSchedule, key: node.kubernetes.io/unreachable}
      volumes:
      - name: projected-volume
        projected:
          sources:
          - configMap:
              items:
              - {key: ncp.ini, path: ncp.ini}
              name: nsx-node-agent-config
          - configMap:
              items:
              - {key: version, path: VERSION}
              name: nsx-ncp-version-config
      - hostPath: {path: /var/run/openvswitch}
        name: openvswitch
      - hostPath: {path: /var/run/nsx-ujo}
        name: var-run-ujo
      - hostPath: {path: /var/run/netns}
        name: netns
      - hostPath: {path: /proc}
        name: proc
      - hostPath: {path: /var/lib/kubelet/device-plugins/}
        name: device-plugins
      - hostPath: {path: /sys}
        name: host-sys
      - hostPath: {path: /lib/modules}
        name: host-modules
      - hostPath: {path: /etc/openvswitch}
        name: host-original-ovs-db
      - hostPath: {path: /etc/os-release}
        name: host-os-release
      - hostPath: {path: /var/log/nsx-ujo, type: DirectoryOrCreate}
        name: host-var-log-ujo
  updateStrategy: {type: RollingUpdate}
