apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend-deployment
  labels:
    app: frontend
spec:
  minReadySeconds: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  replicas: 1
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
      - name: wordpress
        image: wordpress:5.3.2
        ports:
        - containerPort: 80
        env:
        - name: WORDPRESS_DB_HOST
          valueFrom:
            configMapKeyRef:
              name: frontend-config
              key: wordpress_db_host
        - name: WORDPRESS_DB_USER
          valueFrom:
            configMapKeyRef:
              name: frontend-config
              key: wordpress_db_user
        - name: WORDPRESS_DB_PASSWORD
          valueFrom:
            configMapKeyRef:
              name: frontend-config
              key: wordpress_db_password
        - name: WORDPRESS_DB_NAME
          valueFrom:
            configMapKeyRef:
              name: frontend-config
              key: wordpress_db_name
