apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: diary
    role: worker
  name: diary-worker
  namespace: blog
spec:
  replicas: 1
  selector:
    matchLabels:
      app: diary
      role: worker
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: diary
        role: worker
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: diary-secret
        env:
        - name: BLOG_TITLE
          value: diary.takutakahashi.dev
        - name: BLOG_URL
          value: diary.takutakahashi.dev
        - name: BLOG_GA
          value: "G-P6ESSZ61CV"
        - name: BLOG_THEME_URL
          value: "https://github.com/Mitrichius/hugo-theme-anubis.git"
        image: takutakahashi/blog.tpl
        imagePullPolicy: Always
        name: worker
        volumeMounts:
        - mountPath: /src/public
          name: public
        - mountPath: /src/images
          name: images
        - mountPath: /src/content/posts
          name: content
      volumes:
      - name: public
        persistentVolumeClaim:
          claimName: diary-assets
      - name: images
        persistentVolumeClaim:
          claimName: image-assets
      - emptyDir: {}
        name: content
