apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: fastsync
spec:
  selector:
    matchLabels:
      app: fastsync
  serviceName: "fastsync"
  replicas: 1
  template:
    metadata:
      labels:
        app: fastsync
    spec:
      containers:
      - name: fastsync
        image: ghcr.io/fireacademy/fastsync:1.0.7
        volumeMounts:
        - mountPath: /var/www/html
          name: chia-blockchain-db
        resources:
          requests:
            cpu: "3.0"
            memory: "4G"
        ports:
          - name: http
            containerPort: 80
      volumes:
        - name: chia-blockchain-db
          configMap:
            name: chia-blockchain-db
      initContainers:
        - name: chia-blokchain-db-permission-fix
          image: busybox
          command: ["/bin/chmod","-R","777", "/var/www/html"]
          volumeMounts:
            - name: chia-blockchain-db
              mountPath: /var/www/html
  volumeClaimTemplates:
  - metadata:
      name: chia-blockchain-db
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 200G
      storageClassName: do-block-storage
