apiVersion: apps/v1
kind: Deployment
metadata:
  name: drupal
  labels:
    app: drupal
spec:
  replicas: 1
  selector:
    matchLabels:
      app: drupal
  template:
    metadata:
      labels:
        app: drupal
    spec:
      containers:
        - image: drupal
          name: drupal
          env:
          - name: DRUPAL_DB_HOST
            value: mysql:3306
          - name: DRUPAL_DB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mysql
                key: password
          ports:
            - containerPort: 80
              name: drupal
          volumeMounts:
            - name: drupal-persistent-storage
              mountPath: /opt/drupal/web/sites/default/files
      volumes:
        - name: drupal-persistent-storage
          persistentVolumeClaim:
            claimName: drupal-volumeclaim
