kind: Deployment
apiVersion: apps/v1
metadata:
  name: cfs-broker
  namespace: monitoring
spec:

  replicas: 1
  selector:
    matchLabels:
      app: cfs-broker
  strategy:
    rollingUpdate:
      maxSurge: 100%
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: cfs-broker
        name: cfs-broker
    spec:
      containers:
        - image: ghostbaby/cfs-broker:v0.0.2
          imagePullPolicy: Always
          securityContext:
            privileged: true
          name: cfs-broker
          command: ["/app/cfs-broker"]
          args: ["-config","/etc/cfs-broker/config/config.json"]
          ports:
            - containerPort: 80
              name: web
          lifecycle:
            preStop:
              exec:
                command:
                  - /bin/sh
                  - -c
                  - sleep 30
          resources:
            limits:
              cpu: "1"
              memory: 1Gi
            requests:
              cpu: "1"
              memory: 1Gi
          volumeMounts:
            - name: config-volume
              mountPath: /etc/cfs-broker/config
            - mountPath: /data/kubepods
              name: kubepods
            - mountPath: /var/run
              name: docker
      terminationGracePeriodSeconds: 120
      nodeSelector:
        beta.kubernetes.io/os: linux
      securityContext:
        runAsUser: 0
        fsGroup: 0
      volumes:
        - name: config-volume
          configMap:
            name: cfs-broker
        - hostPath:
            path: /sys/fs/cgroup/cpu,cpuacct/kubepods.slice
            type: Directory
          name: kubepods
        - hostPath:
            path: /var/run
          name: docker