---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: tus-php-server
  labels:
    app: tus-php
spec:
  replicas: 3
  selector:
    matchLabels:
      app: tus-php-server

  template:
    metadata:
      name: tus-php-server
      labels:
        app: tus-php-server

    spec:
      volumes:
        - name: uploads
          persistentVolumeClaim:
            claimName: pvc-tus-php-uploads

      containers:
        - name: tus-php-server
          image: tus-php-server-k8s
          imagePullPolicy: Never
          ports:
            - containerPort: 8081
          volumeMounts:
            - name: uploads
              mountPath: /var/www/uploads
              readOnly: false
          env:
            - name: REDIS_HOST
              value: "tus-php-redis"
            - name: REDIS_PORT
              value: "6379"
