kind: Deployment
apiVersion: apps/v1
metadata:
  name: wordpress
spec:
  replicas: 1
  selector:
    matchLabels:
      name: wordpress
  template:
    metadata:
      labels:
        name: wordpress
    spec:
      containers:
        - image: wordpress:5.8.2-php7.4-apache
          name: wordpress
          ports:
            - name: http
              containerPort: 80
          env:
            - name: WORDPRESS_DB_HOST
              value: mysql
            - name: WORDPRESS_DB_USER
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: MYSQL_USER
            - name: WORDPRESS_DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: MYSQL_PASSWORD
            - name: WORDPRESS_DB_NAME
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: MYSQL_DATABASE
          # livenessProbe:
          #   httpGet:
          #     path: /
          #     port: http
          # readinessProbe:
          #   httpGet:
          #     path: /
          #     port: http
      terminationGracePeriodSeconds: 30
      restartPolicy: Always
