apiVersion: apps/v1
kind: Deployment
metadata:
  name: yagami
  namespace: yagami
  labels:
    app: yagami
spec:
  replicas: 1
  selector:
    matchLabels:
      app: yagami
  template:
    metadata:
      labels:
        app: yagami
    spec:
      containers:
        - name: yagami-container
          image: docker.pkg.github.com/mikibot/yagami/yagami:latest
          resources:
            requests:
              memory: "100Mi"
              cpu: "100m"
            limits:
              memory: "400Mi"
              cpu: "400m"
          ports:
            - containerPort: 8080
          env:
            - name: API_PORT
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: API_PORT
            - name: SENTRY_DSN
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: SENTRY_DSN
            - name: DATABASE_PORT
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: DATABASE_PORT
            - name: DATABASE_HOST
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: DATABASE_HOST
            - name: DATABASE_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: DATABASE_PASSWORD
            - name: DATABASE_USER
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: DATABASE_USER
            - name: DATABASE
              valueFrom:
                secretKeyRef:
                  name: yagami-secret
                  key: DATABASE
      imagePullSecrets:
        - name: github-pull-secret
