---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: streamlit-webapp
  namespace: at-app-frontend
spec:
  replicas: 1
  minReadySeconds: 20
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  selector:
    matchLabels:
        app: streamlit-webapp
  template:
    metadata:
      labels:
        app: streamlit-webapp
    spec:
      volumes:
      - name: google-cloud-key
        secret:
          secretName: storage-key
      containers:
      - name: streamlit-webapp
        image: app
        volumeMounts:
        - name: google-cloud-key
          mountPath: /var/secrets/google
        env:
        - name: GOOGLE_APPLICATION_CREDENTIALS
          value: /var/secrets/google/key.json
        - name: GCS_BUCKET
          value: "{{ secrets.projects.auto-finder.bucket }}"
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 8501
        resources:
          requests:
            memory: "400Mi"
            cpu: "200m" # 1000 = 1cpu, 200 = 0.2 cpu
          limits:
            memory: "600Mi"
            cpu: "400m"
 
