apiVersion: apps/v1
kind: Deployment

metadata:
  name: grader-metrics-deployment
  labels:
    app.kubernetes.io/name: grader-metrics
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: grader-metrics
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: grader-metrics
        app.kubernetes.io/version: "20211026"
    spec:
      containers:
      - name: grader-metrics
        command:
          - "python3"
          - "./grader_metrics.py"
          - "--grader-prometheus=http://grader-service:6060/metrics"
        image: omegaup/grader_metrics:20211026
        env:
          - name: CONNECTION_STRING
            valueFrom:
              secretKeyRef:
                name: grader-metrics-secret
                key: CONNECTION_STRING
        resources:
          limits:
            cpu: "2m"
            memory: "50Mi"
          requests:
            cpu: "1m"
            memory: "40Mi"
