apiVersion: v1
kind: Pod
metadata:
  name: installer
  labels:
    app: wordpress
    tier: installer
spec:
  securityContext:
    fsGroup: 1000
  containers:
  - image: rohitpx/wp-cli:1.0
    name: installer
    env:
    - name: WORDPRESS_URL
      value: "http://wordpress"
    - name: WORDPRESS_THEME
      value: "twentysixteen"
    - name: WORDPRESS_PLUGINS
      value: "bj-lazy-load.zip,contact-form-7.5.0.4.zip,woocommerce.3.4.5.zip,wordpress-seo.8.3.zip"
    - name: WORDPRESS_DB_HOST
      value: wordpress-mysql
    - name: WORDPRESS_DB_PASSWORD
      valueFrom:
         secretKeyRef:
           name: mysql-pass
           key: password
    volumeMounts:
    - name: wordpress-persistent-storage
      mountPath: /wordpress
    readinessProbe:
      exec:
        command:
        - cat
        - /tmp/alive
      initialDelaySeconds: 5
      periodSeconds: 5
  volumes:
  - name: wordpress-persistent-storage
    persistentVolumeClaim:
      claimName: wp-pv-claim
