---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: wpapp-deployment
  labels:
    name: wpapp-deployment
    app: wpapp
    tier: app
spec:
  replicas: 1
  selector:
    matchLabels:
      name: wpapp-pod
      app: wpapp
      tier: app
  template:
    metadata:
      name: wpapp-pod
      labels:
        name: wpapp-pod
        app: wpapp
        tier: app
    spec:
      volumes:
      - name: wpapp-vol
        persistentVolumeClaim:
          claimName: wpapp-pvc
      containers:
      - name: wpapp-container
        image: wordpress:php8.0-apache
        imagePullPolicy: IfNotPresent
        envFrom:
        - secretRef:
            name: wpapp-secret
        - configMapRef:
            name: wpapp-cm
        ports:
        - containerPort: 80
        volumeMounts:
        - name: wpapp-vol
          mountPath: /var/www/html
