apiVersion: apps/v1
kind: Deployment
metadata:
    name: wordpress-app
spec:
    replicas: 1
    selector:
        matchLabels:
            app: wordpress-deployment
    template:
        metadata:
            labels:
                app: wordpress-deployment
        spec:
            containers:
            - name: wordpress
              image: wordpress:4-php7.0
              ports:
              - name: wordpress-port
                containerPort: 80
              env:
              - name: WORDPRESS_DB_PASSWORD
                valueFrom:
                    secretKeyRef:
                        name: wordpress-secret
                        key: db-password
              - name: WORDPRESS_DB_HOST
                value: 127.0.0.1
            - name: mysql
              image: mysql:5.7
              ports:
              - name: mysql-port
                containerPort: 3306
              env:
              - name: MYSQL_ROOT_PASSWORD
                valueFrom:
                    secretKeyRef:
                        name: wordpress-secret
                        key: db-password

