apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: litecoin
spec:
  selector:
    matchLabels:
      app: litecoin
  serviceName: litecoin
  replicas: 1
  template:
    metadata:
      labels:
        app: litecoin
    spec:
      initContainers:
       - name: chown-volume
         image: busybox
         command: ["sh", "-c", "chown -R 1000:1000 /data"]
         volumeMounts:
         - name: data
           mountPath: /data
      containers:
      - name: litecoin
        image: litecoin
        volumeMounts:
        - name: data
          mountPath: /.litecoin
        resources:
          limits:
            cpu: 100m     # this is a small cluster, I would also need to spend
            memory: 100Mi # more time to actually monitor avg usage to set proper req/limits
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 80Gi
