prysm-pulse/k8s/geth/miners.deploy.yaml
Preston Van Loon 740a9b76a7
Kubernetes - Part 3 of ?? (#981)
* Add nginx ingress for proof-of-work namespace

* connect beacon-chain to pow namespace geth-nodes for websocket connections

* Added relay to beacon-chain

* Route inbound TCP traffic on port 20000 to beacon-relay

* Add bootnode

* Add a basic pk

* checkpoint

* Added flag for p2p port

* Register flag with main

* Set P2P port specifically

* Add beacon chain config

* add deployvrc job

* Add deployvrc service account

* review

* gazelle

* a cluster is needed, i guess
2018-11-28 00:27:21 -05:00

117 lines
3.4 KiB
YAML

kind: StatefulSet
apiVersion: apps/v1
metadata:
name: miner
namespace: pow
labels:
universe: geth
component: miner
spec:
replicas: 1
serviceName: "miners"
selector:
matchLabels:
universe: geth
component: miner
template:
metadata:
labels:
universe: geth
component: miner
spec:
priorityClassName: production-priority
containers:
- name: miner
image: ethereum/client-go:alltools-stable
ports:
- containerPort: 8545
name: rpc
- containerPort: 8546
name: ws
- containerPort: 30303
name: discovery-tcp
protocol: TCP
- containerPort: 30303
name: discovery-udp
protocol: UDP
# Use /bin/sh -c to execute geth so that we have access to HOSTNAME in
# the command arguments.
# https://github.com/kubernetes/kubernetes/issues/57726
command:
- "/bin/sh"
- "-c"
- >
geth
--networkid=1337
--bootnodesv4=enode://$(BOOTNODE_PUBKEY)@$(GETH_BOOTNODE_V4_SERVICE_HOST):$(GETH_BOOTNODE_V4_SERVICE_PORT_BOOTNODE_UDP)
--bootnodesv5=enode://$(BOOTNODE_PUBKEY)@$(GETH_BOOTNODE_V5_SERVICE_HOST):$(GETH_BOOTNODE_V5_SERVICE_PORT_BOOTNODE_UDP)
--ethstats=$HOSTNAME:$(ETHSTATS_WS_SECRET)@$(GETH_ETHSTATS_SERVICE_HOST):$(GETH_ETHSTATS_SERVICE_PORT)
--rpc
--rpcaddr=0.0.0.0
--rpccorsdomain="*"
--ws
--datadir=/ethereum
--debug
--verbosity=4
--mine
--minerthreads=1
--etherbase=0x8882042b8e93c85312f623f058ef252c8025a7ae
--extradata=$HOSTNAME
--ethash.dagsinmem=1
--ethash.dagsondisk=2
--ethash.dagdir="/dag"
--nousb
--cache=1024
--gasprice=0
volumeMounts:
- name: chaindata
mountPath: "/ethereum"
- name: dag
mountPath: "/dag"
env:
- name: ETHSTATS_WS_SECRET
valueFrom:
secretKeyRef:
name: ethstats-secrets
key: ws
- name: BOOTNODE_PUBKEY
valueFrom:
secretKeyRef:
name: geth-bootnode-secret
key: public_key
resources:
requests:
memory: "2Gi"
cpu: "500m"
limits:
memory: "4Gi"
cpu: "500m"
initContainers:
- name: genesis
image: ethereum/client-go:alltools-stable
command: ["geth"]
args: ["--datadir=/ethereum", "init", "/data/genesis.json"]
volumeMounts:
- name: genesis
mountPath: "/data"
readOnly: true
- name: chaindata
mountPath: "/ethereum"
volumes:
- name: chaindata
emptyDir: {}
- name: genesis
secret:
secretName: geth-genesis
items:
- key: json
path: genesis.json
volumeClaimTemplates:
- metadata:
name: dag
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi