github.com/smartcontractkit/chainlink-testing-framework/libs@v0.0.0-20240227141906-ec710b4eb1a3/charts/geth-reorg/templates/geth-miner.deployment.yaml (about)

     1  apiVersion: apps/v1
     2  kind: Deployment
     3  metadata:
     4    name: {{ template "ethereum.fullname" . }}-miner-node
     5    labels:
     6      app: {{ template "ethereum.fullname" . }}-miner-node
     7      chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
     8      release: {{ .Release.Name }}
     9      heritage: {{ .Release.Service }}
    10  spec:
    11    replicas: {{ .Values.geth.miner.replicas }}
    12    selector:
    13      matchLabels:
    14        app: {{ template "ethereum.fullname" . }}-miner-node
    15        release: {{ .Release.Name }}
    16    template:
    17      metadata:
    18        labels:
    19          app: {{ template "ethereum.fullname" . }}-miner-node
    20          release: {{ .Release.Name }}
    21          miner: "0"
    22      spec:
    23        containers:
    24          - name: geth-miner
    25            image: {{ .Values.geth.image.repository }}:{{ .Values.geth.image.tag }}
    26            imagePullPolicy: {{ .Values.imagePullPolicy }}
    27            command: ["/bin/sh"]
    28            args:
    29              - "-c"
    30              - "geth --nousb --metrics --nocompaction --syncmode full --gcmode archive --bootnodes=`cat /root/.ethereum/bootnodes` --http --http.corsdomain \"*\" --http.api admin,debug,web3,eth,txpool,personal,miner,net --http.addr 0.0.0.0 --http.port=9544 --ws --ws.origins \"*\" --ws.api admin,debug,web3,eth,txpool,personal,miner,net --ws.addr 0.0.0.0 --ws.port=9546 --mine --miner.extradata \"miner\" --miner.threads 1 --miner.gasprice 1 --miner.gastarget 400000000000000 --miner.gaslimit 400000000000000 --miner.noverify --miner.etherbase 0 --networkid=${NETWORK_ID} --password /root/.ethereum/keystore/password.txt --verbosity=5"
    31            env:
    32              - name: NETWORK_ID
    33                valueFrom:
    34                  configMapKeyRef:
    35                    name: {{ template "ethereum.fullname" . }}-geth-config
    36                    key: networkid
    37            resources:
    38              requests:
    39                memory: {{ .Values.geth.miner.resources.requests.memory }}
    40                cpu: {{ .Values.geth.miner.resources.requests.cpu }}
    41              limits:
    42                memory: {{ .Values.geth.miner.resources.limits.memory }}
    43                cpu: {{ .Values.geth.miner.resources.limits.cpu }}
    44            ports:
    45              - name: http-rpc-miner
    46                containerPort: 9544
    47              - name: ws-rpc-miner
    48                containerPort: 9546
    49              - name: discovery-udp
    50                containerPort: 30303
    51                protocol: UDP
    52              - name: discovery-tcp
    53                containerPort: 30303
    54            volumeMounts:
    55              - name: data
    56                mountPath: /root/.ethereum
    57              - name: config
    58                mountPath: /root/.ethereum/keystore/key1
    59                subPath: key1
    60              - name: config
    61                mountPath: /root/.ethereum/keystore/key2
    62                subPath: key2
    63              - name: config
    64                mountPath: /root/.ethereum/keystore/key3
    65                subPath: key3
    66              - name: config
    67                mountPath: /root/.ethereum/keystore/key4
    68                subPath: key4
    69              - name: config
    70                mountPath: /root/.ethereum/keystore/key5
    71                subPath: key5
    72              - name: config
    73                mountPath: /root/.ethereum/keystore/key6
    74                subPath: key6
    75              - name: config
    76                mountPath: /root/.ethereum/keystore/key7
    77                subPath: key7
    78              - name: config
    79                mountPath: /root/.ethereum/keystore/key8
    80                subPath: key8
    81              - name: config
    82                mountPath: /root/.ethereum/keystore/key9
    83                subPath: key9
    84              - name: config
    85                mountPath: /root/.ethereum/keystore/key10
    86                subPath: key10
    87              - name: config
    88                mountPath: /root/.ethereum/keystore/key11
    89                subPath: key11
    90              - name: config
    91                mountPath: /root/.ethereum/keystore/key12
    92                subPath: key12
    93              - name: config
    94                mountPath: /root/.ethereum/keystore/key13
    95                subPath: key13
    96              - name: config
    97                mountPath: /root/.ethereum/keystore/key14
    98                subPath: key14
    99              - name: config
   100                mountPath: /root/.ethereum/keystore/key15
   101                subPath: key15
   102              - name: config
   103                mountPath: /root/.ethereum/keystore/key16
   104                subPath: key16
   105              - name: config
   106                mountPath: /root/.ethereum/keystore/key17
   107                subPath: key17
   108              - name: config
   109                mountPath: /root/.ethereum/keystore/key18
   110                subPath: key18
   111              - name: config
   112                mountPath: /root/.ethereum/keystore/key19
   113                subPath: key19
   114              - name: config
   115                mountPath: /root/.ethereum/keystore/key20
   116                subPath: key20
   117              - name: config
   118                mountPath: /root/.ethereum/keystore/password.txt
   119                subPath: password.txt
   120        initContainers:
   121          - name: init-genesis
   122            image: {{ .Values.geth.image.repository }}:{{ .Values.geth.image.tag }}
   123            imagePullPolicy: {{ .Values.imagePullPolicy }}
   124            args:
   125              - "init"
   126              - "/var/geth/genesis.json"
   127            volumeMounts:
   128              - name: data
   129                mountPath: /root/.ethereum
   130              - name: config
   131                mountPath: /var/geth
   132          - name: get-bootnodes
   133            image: {{ .Values.geth.image.repository }}:{{ .Values.geth.image.tag }}
   134            imagePullPolicy: {{ .Values.imagePullPolicy }}
   135            command: ["/bin/sh"]
   136            args:
   137              - "-c"
   138              - |-
   139                apk add --no-cache curl;
   140                CNT=0;
   141                echo "retreiving bootnodes from $BOOTNODE_REGISTRAR_SVC"
   142                while [ $CNT -le 90 ]
   143                do
   144                  curl -m 5 -s $BOOTNODE_REGISTRAR_SVC | xargs echo -n >> /geth/bootnodes;
   145                  if [ -s /geth/bootnodes ]
   146                  then
   147                    cat /geth/bootnodes;
   148                    exit 0;
   149                  fi;
   150  
   151                  echo "no bootnodes found. retrying $CNT...";
   152                  sleep 2 || break;
   153                  CNT=$((CNT+1));
   154                done;
   155                echo "WARNING. unable to find bootnodes. continuing but geth may not be able to find any peers.";
   156                exit 0;
   157            env:
   158              - name: BOOTNODE_REGISTRAR_SVC
   159                value: {{ template "ethereum.fullname" . }}-node-registrar.{{ .Release.Namespace }}
   160            volumeMounts:
   161              - name: data
   162                mountPath: /geth
   163        volumes:
   164          - name: data
   165            emptyDir: {}
   166          - name: config
   167            configMap:
   168              name: {{ template "ethereum.fullname" . }}-geth-config
   169  {{- with .Values.nodeSelector }}
   170        nodeSelector:
   171  {{ toYaml . | indent 8 }}
   172  {{- end }}
   173  {{- with .Values.affinity }}
   174        affinity:
   175  {{ toYaml . | indent 8 }}
   176  {{- end }}
   177  {{- with .Values.tolerations }}
   178        tolerations:
   179  {{ toYaml . | indent 8 }}
   180  {{- end }}