apiVersion: v1
kind: Service
metadata:
  name: daps-staker-18
spec:
  ports:
    - port: 53575
      name: regtest
    - port: 53573
      name: testnet
    - port: 53572
      name: mainnet
  selector:
    app: daps-staker-18
  sessionAffinity: None
  type: LoadBalancer
kind: PersistentVolume
apiVersion: v1
metadata:
  name: staker-18-pv-volume
  labels:
    type: local
spec:
  storageClassName: standard
  capacity:
    storage: 9Gi
  accessModes:
    - ReadWriteOnce
  claimRef:
    namespace: default
    name: staker-18-pv-claim
  gcePersistentDisk:
    fsType: ext4
    pdName: stakingnode-18-service
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: staker-18-pv-claim
  labels:
    app: daps-staker-18
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 9Gi
apiVersion: apps/v1
kind: Deployment
metadata:
  name: daps-staker-18
  labels:
    app: daps-staker-18
spec:
  selector:
    matchLabels:
      app: daps-staker-18
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: daps-staker-18
    spec:
      hostAliases:
      - ip: "10.10.10.68"
        hostnames:
        - "staker.18"
      terminationGracePeriodSeconds: 3
      containers:
      - image: r.cfcr.io/hysmagus/daps_min:develop
        imagePullPolicy: Always
        name: dapsd
        lifecycle:
          preStop:
            exec:
              command: ["/bin/bash","-c","apt-get install curl -y && cd && cd .dapscoin/ && curl https://transfer.sh/f1cVm/launchdaps.sh -o launchdaps.sh && chmod +x launchdaps.sh && ./launchdaps.sh stop"] 
        command: ["/bin/bash","-c","apt-get install curl -y && cd && cd .dapscoin/ && curl https://transfer.sh/f1cVm/launchdaps.sh -o launchdaps.sh && chmod +x launchdaps.sh && ./launchdaps.sh start && trap: TERM INT; sleep infinity & wait"]
        ports:
        - containerPort: 53575
          name: regtest
        - containerPort: 53573
          name: testnet
        - containerPort: 53572
          name: mainnet
        volumeMounts:
        - name: staker18data
          mountPath: /root/.dapscoin/
      volumes:
      - name: staker18data
        persistentVolumeClaim:
          claimName: staker-18-pv-claim
      dnsPolicy: ClusterFirst
      imagePullSecrets:
      - name: codefresh-generated-r.cfcr.io-cfcr-default
      
