---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpress
  namespace: wordpress-stack
  labels:
    app.kubernetes.io/name: wordpress
    app.kubernetes.io/tier: frontend
    app.kubernetes.io/version: "0.1"
    app.kubernetes.io/environment: dev
    app.kubernetes.io/namespace: wordpress-stack
    app.kubernetes.io/part-of: wordpress-project
spec:
    replicas: 1
    selector:
      matchLabels:
        app.kubernetes.io/name: wordpress
        app.kubernetes.io/tier: frontend
        app.kubernetes.io/version: "0.1"
        app.kubernetes.io/environment: dev
        app.kubernetes.io/namespace: wordpress-stack
        app.kubernetes.io/part-of: wordpress-project
    template:
      metadata:
        labels:
          app.kubernetes.io/name: wordpress
          app.kubernetes.io/tier: frontend
          app.kubernetes.io/version: "0.1"
          app.kubernetes.io/environment: dev
          app.kubernetes.io/namespace: wordpress-stack
          app.kubernetes.io/part-of: wordpress-project
      spec:
        containers:
          - name: wordpress
            image: wordpress:5
            envFrom:
              - secretRef:
                  name: wordpress-credentials
            ports:
              - containerPort: 80
            volumeMounts:
              - name: wordpress-storage
                mountPath: /var/www/html
        volumes:
          - name: wordpress-storage
            persistentVolumeClaim:
              claimName: wordpress-storage


