apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpress
  labels:
    app: wordpress
spec:
  selector:
    matchLabels:
      app: wordpress
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: wordpress
        tier: frontend
    spec:
      containers:
      - image: wordpress:php7.4-apache
        name: wordpress
        env:
        - name: WORDPRESS_DB_HOST
          value: "10.70.0.5"
        - name: WORDPRESS_DB_USER
          value: "wp-user"
        - name: WORDPRESS_DB_PASSWORD
          value: "senhawpuser"
        - name: WORDPRESS_DB_NAME
          value: "wpdatabase"
        ports:
        - containerPort: 80
          name: wordpress
        volumeMounts:
        - name: wordpress-persistent-storage
          mountPath: /var/www/html
      volumes:
      - name: wordpress-persistent-storage
        persistentVolumeClaim:
          claimName: nfs