apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: profiler
  name: profiler
  namespace: profiler-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: profiler
  template:
    metadata:
      labels:
        app.kubernetes.io/name: profiler
    spec:
      containers:
        - name: profiler
          image: xyctruth/profiler:latest
          imagePullPolicy: Always
          env:
          - name: CONFIG_PATH
            value: /profiler/config/collector.yaml
          - name: DATA_PATH
            value: /profiler/data/
          resources:
            limits:
              cpu: "400m"
              memory: "500Mi"
            requests:
              cpu: "100m"
              memory: "200Mi"
          livenessProbe:
            httpGet:
              path: /api/healthz
              port: 80
            initialDelaySeconds: 180
            timeoutSeconds: 5
          readinessProbe:
            httpGet:
              path: /api/healthz
              port: 80
            initialDelaySeconds: 5
            timeoutSeconds: 1
          terminationMessagePolicy: FallbackToLogsOnError
          volumeMounts:
            - name: profiler-data
              mountPath: /profiler/data
              readOnly: false
            - name: profiler-config
              mountPath: /profiler/config
            - name: tz-config
              mountPath: /etc/localtime
      terminationGracePeriodSeconds: 120
      volumes:
        - name: profiler-config
          configMap:
            name: profiler-config
        - name: profiler-data
          persistentVolumeClaim:
            claimName: profiler-data
        - name: tz-config
          hostPath:
            path: /usr/share/zoneinfo/Asia/Shanghai