apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpress
  labels:
    app: wordpress
spec:
  selector:
    matchLabels:
      app: wordpress
  template:
    metadata:
      labels:
        app: wordpress
    spec:
      containers:
      - name: wordpress
        image: wordpress:v1
        imagePullPolicy: Never
        ports:
          - containerPort: 5050
        livenessProbe:
          initialDelaySeconds: 20
          periodSeconds: 10
          timeoutSeconds: 5
          tcpSocket:
            port: 5050
        volumeMounts:
        - name: wordpress-data
          mountPath: /var/www/html
        - name: wordpress-config
          mountPath: /var/www/localhost/htdocs/wp-config.php
          subPath: wp-config.php
          readOnly: true
      volumes:
      - name: wordpress-config
        configMap:
          name: wordpress
      - name: wordpress-data
        persistentVolumeClaim:
          claimName: wordpress
