apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: azure-imds-agent-app
  namespace: giantswarm
spec:
  selector:
    matchLabels:
      name: azure-imds-agent-app
  template:
    metadata:
      labels:
        name: azure-imds-agent-app
        app: azure-imds-agent-app
    spec:
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
      containers:
        - name: azure-imds-agent-app
          image: quay.io/giantswarm/azure-imds-agent-app:0.1.0
          args:
            - "daemon"
            - "--config.dirs=/var/run/azure-imds-agent-app/configmap/"
            - "--config.files=config"
          volumeMounts:
            - name: azure-imds-agent-app-configmap
              mountPath: /var/run/azure-imds-agent-app/configmap/
              readOnly: true
          ports:
            - containerPort: 8000
              protocol: TCP
          resources:
            requests:
              cpu: 50m
              memory: 50Mi
            limits:
              cpu: 250m
              memory: 100Mi
      terminationGracePeriodSeconds: 30
      securityContext:
        runAsGroup: 1000
        runAsUser: 1000
      volumes:
        - name: azure-imds-agent-app-configmap
          configMap:
            name: azure-imds-agent-app-configmap
            items:
              - key: config.yaml
                path: config.yaml
