apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-deployment
  labels:
    section: kurabu-api
    kind: deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kurabu-api
  template:
    metadata:
      labels:
        section: kurabu-api
        kind: pod
    spec:
      containers:
      - name: kurabu-api
        imagePullPolicy: Always
        image: kurabu-api
        env:
          - name: CLIENT_ID
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.CLIENT_ID
          - name: CLIENT_SECRET
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.CLIENT_SECRET
          - name: PASSWORD_ENCR
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.PASSWORD_ENCR
          - name: JWT_ENCRYPTION
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.JWT_ENCRYPTION
          - name: DATABASE_URL
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.DATABASE_URL
          - name: SENDGRID_API_KEY
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.SENDGRID_API_KEY
          - name: MIGRATION_LOCATION
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.MIGRATION_LOCATION
          - name: EMAIL_DOMAIN
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.EMAIL_DOMAIN
          - name: SQL_SSL
            valueFrom:
              secretKeyRef:
                name: secret-config
                key: api.SQL_SSL

        resources:
          requests:
            memory: "250Mi"
            cpu: "100m"
          limits:
            memory: "1000Mi"
            cpu: "250m"
        ports:
        - containerPort: 15000
        

      
         