kube-wordpress-ssl-init-yaml

See full article.

Key Points:

  • change <your name> to your name
  • change <your domain name> to your DNS name
  • Needs port 80 exposed
apiVersion: batch/v1
kind: Job
metadata:
  name: wordpress-demo
spec:
  template:
    metadata:
      labels:
        app: wordpress-demo
    spec:
      containers:
      - name: wordpress-demo
        image: <your name>/wordpress-init
        env:
        - name: WP_SITE_DOMAIN_NAME
          value: <your domain name>
        - name: PERSISTENT_MOUNT_POINT
          value: /var/www/html
        ports:
        - containerPort: 80
          name: http
        volumeMounts:
        - name: wordpress-demo-vol
          mountPath: /var/www/html
      restartPolicy: Never
      volumes:
      - name: wordpress-demo-vol
        persistentVolumeClaim:
          claimName: wordpress-demo-claim
  backoffLimit: 0