apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: omsagent
  namespace: kube-system
spec:
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate
  selector:
    matchLabels:
      app: omsagent
  template:
   metadata:
    labels:
     app: omsagent
     agentVersion: 1.6.0-163
     dockerProviderVersion: 1.0.0-34
   spec:
    serviceAccount: omsagent
    containers:
      - name: omsagent
        image: "microsoft/oms"
        imagePullPolicy: Always
        securityContext:
          privileged: true
        ports:
        - containerPort: 25225
          protocol: TCP
        - containerPort: 25224
          protocol: UDP
        resources:
          limits:
            cpu: 150m
            memory: 750Mi
          requests:
            cpu: 50m
            memory: 200Mi
        volumeMounts:
         - mountPath: /var/run/docker.sock
           name: docker-sock
         - mountPath: /var/log
           name: host-log
         - mountPath: /etc/omsagent-secret
           name: omsagent-secret
           readOnly: true
         - mountPath: /var/lib/docker/containers
           name: containerlog-path
        livenessProbe:
         exec:
          command:
          - /bin/bash
          - -c
          - ps -ef | grep omsagent | grep -v "grep"
         initialDelaySeconds: 60
         periodSeconds: 60
    nodeSelector:
     beta.kubernetes.io/os: linux
    # Tolerate a NoSchedule taint on master that ACS Engine sets.
    tolerations:
     - key: "node-role.kubernetes.io/master"
       operator: "Equal"
       value: "true"
       effect: "NoSchedule"
    volumes:
     - name: docker-sock
       hostPath:
        path: /var/run/docker.sock
     - name: host-log
       hostPath:
        path: /var/log
     - name: omsagent-secret
       secret:
        secretName: omsagent-secret
     - name: containerlog-path
       hostPath:
        path: /var/lib/docker/containers
