apiVersion: apps/v1
kind: Deployment
metadata:
  name: nextcloud
  namespace: apps
  labels:
    app: nextcloud
    openova.io/tenant: "test12-2"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: nextcloud
  template:
    metadata:
      labels:
        app: nextcloud
        openova.io/tenant: "test12-2"
    spec:
      containers:
        - name: nextcloud
          image: nextcloud:29-apache
          ports:
            - containerPort: 80
          env:
            - name: DATABASE_URL
              value: "postgresql://app:e16cde7aeb535edc96b435d7a1523cd5@postgres:5432/db_nextcloud"
            - name: POSTGRES_HOST
              value: "postgres"
            - name: POSTGRES_PORT
              value: "5432"
            - name: POSTGRES_DATABASE
              value: "db_nextcloud"
            - name: POSTGRES_USERNAME
              value: "app"
            - name: POSTGRES_PASSWORD
              value: "e16cde7aeb535edc96b435d7a1523cd5"
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: 500m
              memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: nextcloud
  namespace: apps
spec:
  selector:
    app: nextcloud
  ports:
    - port: 80
      targetPort: 80
