apiVersion: apps/v1
kind: Deployment
metadata:
  name: grav
  namespace: grav
  labels:
    app: grav
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grav
  template:
    metadata:
      labels:
        app: grav
    spec:
      imagePullSecrets:
      - name: github-registry
      initContainers:
      - name: chown
        image: busybox
        command: ["sh", "-c", "chown -R 101:82 /sync/user"]
        volumeMounts:
        - name: grav-sync
          mountPath: "/sync/user"
          readOnly: false
      containers:
      - name: grav
        image: docker.pkg.github.com/y-kimura-opst/grav-sample-docker/grav:main
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        volumeMounts:
        - name: grav-sync
          mountPath: "/sync/user"
          readOnly: false
      volumes:
        - name: grav-sync
          persistentVolumeClaim:
            claimName : grav-sync