---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: prater-nimbus
  namespace: validators
spec:
  selector:
    matchLabels:
      app: prater-nimbus
  replicas: 1
  revisionHistoryLimit: 0
  template:
    metadata:
      labels:
        app: prater-nimbus
    spec:
      initContainers:
        - name: chown
          image: busybox
          command:
            - chown
            - -R
            - "1000:1000"
            - /home/user/nimbus-eth2/build/data
          volumeMounts:
            - mountPath: /home/user/nimbus-eth2/build/data
              name: prater-nimbus-data
      containers:
        - name: prater-nimbus
          resources:
            requests:
              memory: 2Gi
              cpu: 1000m
            limits:
              memory: 8Gi
              cpu: 16000m
          args: [
            "--network=prater",
            "--tcp-port=30900",
            "--udp-port=30900",
            "--enr-auto-update",
            "--data-dir=/home/user/nimbus-eth2/build/data/shared_prater_0",
            "--web3-url=ws://goerli-geth.validators.svc.cluster.local:8546",
            "--log-level=INFO",
            "--metrics",
            "--metrics-address=0.0.0.0",
            "--metrics-port=8008"
          ]
          image: statusim/nimbus-eth2:amd64-latest
          ports:
            - containerPort: 30900
            - containerPort: 8008
          volumeMounts:
            - mountPath: /home/user/nimbus-eth2/build/data
              name: prater-nimbus-data
      restartPolicy: Always
      volumes:
        - name: prater-nimbus-data
          ephemeral:
            volumeClaimTemplate:
              spec:
                accessModes: ["ReadWriteOnce"]
                resources:
                  requests:
                    storage: 50Gi
