apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-wp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp-wp
  template:
    metadata:
      labels:
        app: myapp-wp
    spec:
      containers:
      - name: myapp-wp
        image: wordpress:php8.0
        resources:
          limits:
            memory: "512Mi"
            cpu: "500m"
        ports:
        - containerPort: 80
          name: http-port
        env:
          - name: WORDPRESS_DB_PASSWORD
            valueFrom:
              secretKeyRef:
               name: wp-mysecret
               key: db-password
          - name: WORDPRESS_DB_HOST
            value: mysql
      - name: mysql
        image: mysql:5.7
        resources:
          limits:
            memory: "512Mi"
            cpu: "500m"
        ports:
          - containerPort: 3306
            name: mysql-port
        env:
          - name: MYSQL_ROOT_PASSWORD
            valueFrom:
              secretKeyRef:
               name: wp-mysecret
               key: db-password  