apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: eth2stats
  namespace: ethereum-2
  labels:
    app.kubernetes.io/name: eth2stats
    app.kubernetes.io/version: v0.0.16
spec:
  serviceName: eth2stats
  selector:
    matchLabels:
      app.kubernetes.io/name: eth2stats
  template:
    metadata:
      labels:
        app.kubernetes.io/name: eth2stats
        app.kubernetes.io/version: v0.0.16
    spec:
      serviceAccountName: eth2stats
      containers:
      - name: eth2stats
        image: docker.io/alethio/eth2stats-client:v0.0.16
        imagePullPolicy: Always
        args:
        - run
        - --eth2stats.node-name=AllYouCanStake.de
        - --data.folder=/var/lib/eth2stats
        - --eth2stats.addr=grpc.medalla.eth2stats.io:443
        - --eth2stats.tls=true
        - --beacon.type=prysm
        - --beacon.addr=beacon-chain:4000
        - --beacon.tls-cert=/etc/tls/ca.crt
        - --beacon.metrics-addr=http://beacon-chain:8080/metrics
        resources:
          requests:
            cpu: 10m
            memory: 32Mi
          limits:
            cpu: 20m
            memory: 64Mi
        volumeMounts:
        - mountPath: /etc/tls
          name: tls
          readOnly: true
        - mountPath: /var/lib/eth2stats
          name: data
        securityContext:
          runAsNonRoot: true
          runAsUser: 65534
          readOnlyRootFilesystem: true
          capabilities:
            drop: ["ALL"]
      securityContext:
        fsGroup: 65534
      volumes:
      - name: tls
        secret:
          secretName: eth2stats-tls
  volumeClaimTemplates:
  - metadata:
      name: data
    spec:
      storageClassName: standard-rwo
      accessModes:
      - ReadWriteOnce
      volumeMode: Filesystem
      resources:
        requests:
          storage: 1Gi
