apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: miweb-certbot-pv-claim
  labels:
    app: miweb
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 200M
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: miweb-certbot
  labels:
    app: miweb
spec:
  selector:
    matchLabels:
      app: miweb
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: miweb
        tier: frontend
    spec:
      containers:
      - name: certbot
        image: certbot/certbot:latest
        volumeMounts:
        - name: miweb-certbot-folder
          mountPath: /var/www/certbot
      imagePullSecrets:
      - name: reg-cred-secret
      volumes:
      - name: miweb-certbot-folder
        persistentVolumeClaim:
          claimName: miweb-certbot-pv-claim
