apiVersion: apps/v1
kind: Deployment
metadata:
  name: eduroom-grading-server-deployment
spec:
  selector:
    matchLabels:
      app: eduroom-grading-server-deployment
  template:
    metadata:
      labels:
        app: eduroom-grading-server-deployment
    spec:
      restartPolicy: Always
      containers:
        - name: eduroom-grading-server
          image: judge0/judge0:latest
          securityContext:
            privileged: true
          # resources:
          #   limits:
          #     memory: "128Mi"
          #     cpu: "500m"
          ports:
            - containerPort: 3000
          envFrom:
            - configMapRef:
                name: grader-env-configmap
            # - secretRef:
            #     name: eduroom-grader-secret
        - name: eduroom-grading-worker
          image: judge0/judge0:latest
          command:
            - "./scripts/workers"
          securityContext:
            privileged: true
          # resources:
          #   limits:
          #     memory: "128Mi"
          #     cpu: "500m"
          envFrom:
            - configMapRef:
                name: grader-env-configmap
            # - secretRef:
            #     name: eduroom-grader-secret
        - name: eduroom-grading-db
          image: postgres:13.0
          # resources:
          #   limits:
          #     memory: "128Mi"
          #     cpu: "500m"
          ports:
            - containerPort: 5432
          envFrom:
            - configMapRef:
                name: grader-env-configmap
            # - secretRef:
            #     name: eduroom-grader-secret
        - name: eduroom-grading-redis
          image: redis:6.0
          # resources:
          #   limits:
          #     memory: "128Mi"
          #     cpu: "500m"
          command: ["/bin/sh", "-c", 'docker-entrypoint.sh --appendonly yes --requirepass "$$REDIS_PASSWORD"']
          ports:
            - containerPort: 6379
          envFrom:
            - configMapRef:
                name: grader-env-configmap
            # - secretRef:
            #     name: eduroom-grader-secret
