prysm-pulse/k8s/geth/nodes.deploy.yaml
Preston Van Loon 7078382b82
k8s goerli config (#1517)
* Added goerli node config

* add validator configuration

* working better with istio

* cleanup

* Update bootnodes and genesis

* prepare goerli

* cleaning up geth stuff

* Working on istio

* Update somethings for istio

* Add back bootnode for internal discovery, add some labels for istio

* support ws

* ssl via lets encrypt

* Remove ingress

* Expose grafana

* allow insecure

* Add consistent loadbalancing

* use pod antiaffinity so that the public nodes are highly available

* Change app name to goerli

* Add unstable graphql

* remove redis

* lint

* gazelle and fix weights

* better affinity
2019-02-08 15:30:38 -05:00

160 lines
4.8 KiB
YAML

kind: StatefulSet
apiVersion: apps/v1
metadata:
name: node
namespace: pow
labels:
universe: geth
component: node
app: goerli
version: v1
spec:
replicas: 1
serviceName: "node"
selector:
matchLabels:
universe: geth
component: node
app: goerli
version: v1
template:
metadata:
labels:
universe: geth
component: node
app: goerli
version: v1
spec:
priorityClassName: production-priority
containers:
- name: prober
image: gcr.io/prysmaticlabs/prysm/geth-prober
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 30
- name: node
image: ethereum/client-go:alltools-stable
ports:
- 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=5
--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=💎prylabs-$HOSTNAME:$(ETHSTATS_WS_SECRET)@wss://stats.goerli.net
--rpc
--rpcapi=eth
--datadir=/ethereum
--keystore=/keystore
--verbosity=3
--nousb
--lightserv=50
--metrics
--mine
--unlock=0xd9a5179f091d85051d3c982785efd1455cec8699
--password=/secret/password
--etherbase=0xd9a5179f091d85051d3c982785efd1455cec8699
--extradata="💎 @prylabs $HOSTNAME 💎"
volumeMounts:
- name: chaindata
mountPath: /ethereum
- name: keystore
mountPath: /keystore
readOnly: true
- name: validator-pk
mountPath: /secret
readOnly: true
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: "250Mi"
cpu: "200m"
limits:
memory: "1000Mi"
cpu: "200m"
initContainers:
- name: copy-staticnodes
image: busybox
command: ["cp", "/data/static-nodes.json", "/ethereum/static-nodes.json"]
volumeMounts:
- name: networkdata
mountPath: "/data"
readOnly: true
- name: chaindata
mountPath: "/ethereum"
- name: import-validator-account
image: ethereum/client-go:alltools-stable
command: ["geth"]
args:
- account
- import
- /secret/privatekey
- --datadir=/ethereum
- --keystore=/keystore
- --password=/secret/password
volumeMounts:
- name: chaindata
mountPath: /ethereum
- name: validator-pk
mountPath: /secret
readOnly: true
- name: keystore
mountPath: /keystore
- name: init-genesis
image: ethereum/client-go:alltools-stable
command: ["geth"]
args: ["--datadir=/ethereum", "init", "/data/genesis.json"]
volumeMounts:
- name: networkdata
mountPath: "/data"
readOnly: true
- name: chaindata
mountPath: "/ethereum"
volumes:
- name: networkdata
configMap:
name: goerli
items:
- key: genesis
path: genesis.json
- key: staticnodes
path: static-nodes.json
- name: validator-pk
secret:
secretName: goerli-validator-pk
- name: keystore
emptyDir: {}
- name: chaindata
emptyDir: {} # Caching the chain seems to have issues with impossible reorg
# volumeClaimTemplates:
# - metadata:
# name: chaindata
# spec:
# accessModes: [ "ReadWriteOnce" ]
# resources:
# requests:
# storage: 50Gi