apiVersion: apps/v1

kind: Deployment
metadata:
  name: wordpress
  labels:
    app: wordpress
spec:
  replicas: 1
  selector:
    matchLabels:
      app: wordpress
  template:
    metadata:
      labels:
        app: wordpress
    spec:
      containers:
        - image: wordpress
          name: wordpress
          env:
          - name: WORDPRESS_DB_HOST
            value: mysql:3306
          - name: WORDPRESS_DB_NAME
            value: k8sdb
          - name: WORDPRESS_DB_USER
            value: k8suser
          - name: WORDPRESS_DB_PASSWORD
            value: 1q2w3e4r
          ports:
            - containerPort: 80
              name: wordpress
