Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Kubernetes/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions Kubernetes/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: DockerCompose-to-K8S
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
30 changes: 30 additions & 0 deletions Kubernetes/templates/beacon-chain-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v1
kind: Service
metadata:
name: beacon-chain
namespace: {{ .Release.Namespace }}
spec:
selector:
app: beacon-chain
ports:
- name: grpc-port
protocol: TCP
port: 4000
targetPort: 4000
- name: http-port
protocol: TCP
port: 3500
targetPort: 3500
- name: api-port
protocol: TCP
port: 8080
targetPort: 8080
- name: pprof-port
protocol: TCP
port: 6060
targetPort: 6060
- name: metrics-port
protocol: TCP
port: 9090
targetPort: 9090
type: ClusterIP
94 changes: 94 additions & 0 deletions Kubernetes/templates/beacon-chain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: beacon-chain
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: beacon-chain
template:
metadata:
labels:
app: beacon-chain
spec:
serviceAccountName: kubectl-sa
initContainers:
# - name: create-beacon-chain-genesis
# image: "{{ .Values.image.createBeaconChainGenesis }}"
# args:
# - testnet
# - generate-genesis
# - --fork=capella
# - --num-validators=64
# - --genesis-time-delay=60
# - --output-ssz={{ .Values.volumes.consensus }}/genesis.ssz
# - --chain-config-file={{ .Values.volumes.consensus }}/config.yml
# - --geth-genesis-json-in={{ .Values.volumes.execution }}/genesis.json
# - --geth-genesis-json-out={{ .Values.volumes.execution }}/genesis.json
# volumeMounts:
# - name: consensus
# mountPath: {{ .Values.volumes.consensus }}
# - name: execution
# mountPath: {{ .Values.volumes.execution }}
- name: wait-for-create-beacon-chain-genesis
image: "{{ .Values.image.kubectlImage }}" # This image includes kubectl and can be used to run wait commands
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
command:
- /bin/sh
- -c
- |
echo "Waiting for create-beacon-chain-genesis Job to complete..."
until kubectl get job create-beacon-chain-genesis -n {{ .Release.Namespace }} -o jsonpath='{.status.succeeded}' | grep "1"; do
echo "Job not completed yet. Checking again in 10 seconds..."
sleep 10
done
echo "create-beacon-chain-genesis Job completed successfully."
containers:
- name: beacon-chain
image: "{{ .Values.image.beaconChain }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
volumeMounts:
- name: consensus
mountPath: {{ .Values.volumes.consensus }}
- name: execution
mountPath: {{ .Values.volumes.execution }}
- name: jwtsecret-volume
mountPath: {{ .Values.volumes.execution }}/jwtsecret
subPath: jwtsecret
args:
- --datadir={{ .Values.volumes.consensus }}/beacondata
- --min-sync-peers=0
- --genesis-state={{ .Values.volumes.consensus }}/genesis.ssz
- --bootstrap-node=
- --interop-eth1data-votes
- --chain-config-file={{ .Values.volumes.consensus }}/config.yml
- --contract-deployment-block=0
- --chain-id=32382
- --rpc-host=0.0.0.0
- --grpc-gateway-host=0.0.0.0
- --execution-endpoint=http://geth:8551 #geth clusterIP service
- --accept-terms-of-use
- --jwt-secret={{ .Values.volumes.execution }}/jwtsecret
- --suggested-fee-recipient=0x1d6197196c227e2be52c917b62343f7815638b2d
- --minimum-peers-per-subnet=0
- --enable-debug-rpc-endpoints
- --force-clear-db
ports:
{{- range .Values.ports.beaconChain }}
- containerPort: {{ . }}
{{- end }}

volumes:
- name: consensus
hostPath:
path: {{ .Values.volumes.localconsensus }}
- name: execution
hostPath:
path: {{ .Values.volumes.localexecution }}
- name: jwtsecret-volume
secret:
secretName: jwtsecret
nodeSelector:
kubernetes.io/arch: amd64
35 changes: 35 additions & 0 deletions Kubernetes/templates/consensus-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: mqube-config
namespace: {{ .Release.Namespace }}
data:
config.yml: |
CONFIG_NAME: interop
PRESET_BASE: interop

# Genesis
GENESIS_FORK_VERSION: 0x20000089

# Altair
ALTAIR_FORK_EPOCH: 0
ALTAIR_FORK_VERSION: 0x20000090

# Merge
BELLATRIX_FORK_EPOCH: 0
BELLATRIX_FORK_VERSION: 0x20000091
TERMINAL_TOTAL_DIFFICULTY: 0

# Capella
CAPELLA_FORK_EPOCH: 0
CAPELLA_FORK_VERSION: 0x20000092
MAX_WITHDRAWALS_PER_PAYLOAD: 16

DENEB_FORK_VERSION: 0x20000093

# Time parameters
SECONDS_PER_SLOT: 12
SLOTS_PER_EPOCH: 6

# Deposit contract
DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242
36 changes: 36 additions & 0 deletions Kubernetes/templates/create-beacon-chain-genesis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: batch/v1
kind: Job
metadata:
name: create-beacon-chain-genesis
spec:
template:
spec:
containers:
- name: create-beacon-chain-genesis
image: "{{ .Values.image.createBeaconChainGenesis }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
args:
- testnet
- generate-genesis
- --fork=capella
- --num-validators=64
- --genesis-time-delay=60
- --output-ssz={{ .Values.volumes.consensus }}/genesis.ssz
- --chain-config-file={{ .Values.volumes.consensus }}/config.yml
- --geth-genesis-json-in={{ .Values.volumes.execution }}/genesis.json
- --geth-genesis-json-out={{ .Values.volumes.execution }}/genesis.json
volumeMounts:
- name: consensus
mountPath: {{ .Values.volumes.consensus }}
- name: execution
mountPath: {{ .Values.volumes.execution }}
restartPolicy: OnFailure
volumes:
- name: consensus
hostPath:
path: {{ .Values.volumes.localconsensus }}
- name: execution
hostPath:
path: {{ .Values.volumes.localexecution }}
nodeSelector:
kubernetes.io/arch: amd64
9 changes: 9 additions & 0 deletions Kubernetes/templates/enable-job-listing-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: {{ .Release.Namespace }}
name: job-reader
rules:
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get", "list"]
Loading