---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: blog
      component: web
  template:
    metadata:
      labels:
        app: blog
        component: web
    spec:
      containers:
      - name: wordpress
        image: wordpress:5
        imagePullPolicy: Always
        env:
        - name: WORDPRESS_DB_HOST
          value: db
        - name: WORDPRESS_DB_NAME
          value: wordpress
        - name: WORDPRESS_DB_USER
          value: wordpress
        - name: WORDPRESS_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: db
              key: password
        ports:
        - name: web
          containerPort: 80
