Skip to content

Commit 5a3ba8d

Browse files
authored
feat: add immutable geth (#235)
1 parent acd231a commit 5a3ba8d

8 files changed

Lines changed: 308 additions & 0 deletions

File tree

charts/immutable-geth/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/immutable-geth/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: immutable-geth
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "v1.0.0-beta.16"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "immutable-geth.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "immutable-geth.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "immutable-geth.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "immutable-geth.labels" -}}
37+
helm.sh/chart: {{ include "immutable-geth.chart" . }}
38+
{{ include "immutable-geth.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "immutable-geth.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "immutable-geth.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "immutable-geth.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "immutable-geth.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.ingress.create -}}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: {{ include "immutable-geth.fullname" . }}
6+
annotations:
7+
cert-manager.io/issuer: gcp-cas-issuer
8+
cert-manager.io/issuer-kind: GoogleCASClusterIssuer
9+
cert-manager.io/issuer-group: cas-issuer.jetstack.io
10+
kubernetes.io/ingress.class: "gce-internal"
11+
# Since no static ip address is provided, only https can be used as
12+
# protocol for the GCP-managed load balancer
13+
# See https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balance-ingress#https_between_client_and_load_balancer
14+
kubernetes.io/ingress.allow-http: "false"
15+
external-dns.alpha.kubernetes.io/hostname: {{ .Values.ingress.hostname }}
16+
spec:
17+
tls:
18+
- hosts:
19+
- {{ .Values.ingress.hostname }}
20+
secretName: "{{ .Values.ingress.hostname }}-secret-tls"
21+
rules:
22+
- host: {{ .Values.ingress.hostname }}
23+
http:
24+
paths:
25+
- path: /
26+
pathType: Prefix
27+
backend:
28+
service:
29+
name: {{ include "immutable-geth.fullname" . }}
30+
port:
31+
name: http
32+
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "immutable-geth.fullname" . }}
5+
labels:
6+
{{- include "immutable-geth.labels" . | nindent 4 }}
7+
annotations:
8+
{{ toYaml .Values.service.annotations | indent 4 }}
9+
spec:
10+
type: {{ .Values.service.type }}
11+
ports:
12+
- port: {{ .Values.service.http.port }}
13+
targetPort: http
14+
protocol: TCP
15+
name: http
16+
# StatefulSets require headless services
17+
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations
18+
clusterIP: {{ .Values.service.clusterIP }}
19+
selector:
20+
{{- include "immutable-geth.selectorLabels" . | nindent 4 }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "immutable-geth.serviceAccountName" . }}
6+
labels:
7+
{{- include "immutable-geth.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
13+
{{- end }}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ include "immutable-geth.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "immutable-geth.labels" . | nindent 4 }}
8+
spec:
9+
replicas: {{ .Values.replicaCount }}
10+
selector:
11+
matchLabels:
12+
{{- include "immutable-geth.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
{{- with .Values.podAnnotations }}
16+
annotations:
17+
{{- toYaml . | nindent 8 }}
18+
{{- end }}
19+
labels:
20+
{{- include "immutable-geth.labels" . | nindent 8 }}
21+
{{- with .Values.podLabels }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
spec:
25+
securityContext:
26+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
27+
serviceAccountName: {{ include "immutable-geth.serviceAccountName" . }}
28+
initContainers:
29+
- name: init
30+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
31+
command:
32+
- geth
33+
args:
34+
- immutable
35+
- bootstrap
36+
- rpc
37+
- --zkevm=testnet
38+
- --datadir={{ .Values.storage.path | quote }}
39+
volumeMounts:
40+
- mountPath: {{ .Values.storage.path | quote }}
41+
name: data
42+
containers:
43+
- name: {{ .Chart.Name }}
44+
securityContext:
45+
{{- toYaml .Values.securityContext | nindent 12 }}
46+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
47+
imagePullPolicy: {{ .Values.image.pullPolicy }}
48+
command:
49+
- geth
50+
args:
51+
- --zkevm=testnet
52+
- --config=/etc/geth/testnet-public.toml
53+
- --datadir={{ .Values.storage.path }}
54+
- --http
55+
- --http.port={{ .Values.service.http.port }}
56+
- --http.addr=0.0.0.0
57+
- --http.corsdomain=*
58+
- --http.vhosts=*
59+
- --http.api=admin,engine,net,eth,web3,debug,miner
60+
- --gossipdefault
61+
- --disabletxpoolgossip
62+
- --rpcproxy
63+
ports:
64+
- name: http
65+
containerPort: {{ .Values.service.http.port }}
66+
protocol: TCP
67+
resources:
68+
{{- toYaml .Values.resources | nindent 12 }}
69+
volumeMounts:
70+
- mountPath: {{ .Values.storage.path | quote }}
71+
name: data
72+
volumeClaimTemplates:
73+
- metadata:
74+
name: data
75+
spec:
76+
accessModes: [ "ReadWriteOnce" ]
77+
resources:
78+
requests:
79+
storage: {{ .Values.storage.size }}

charts/immutable-geth/values.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
replicaCount: 1
2+
3+
image:
4+
repository: ghcr.io/immutable/immutable-geth/immutable-geth
5+
pullPolicy: IfNotPresent
6+
tag: "v1.0.0-beta.16"
7+
8+
serviceAccount:
9+
create: true
10+
automount: true
11+
annotations: {}
12+
name: ""
13+
14+
podAnnotations: {}
15+
podLabels: {}
16+
17+
podSecurityContext: {}
18+
19+
securityContext: {}
20+
21+
storage:
22+
path: /data
23+
size: 500Gi
24+
25+
service:
26+
type: ClusterIP
27+
clusterIP: None
28+
http:
29+
port: 8545
30+
annotations: {}
31+
32+
ingress:
33+
create: true
34+
hostname: something.dev.polygon
35+
36+
resources: {}
37+
38+
livenessProbe:
39+
httpGet:
40+
path: /
41+
port: http
42+
readinessProbe:
43+
httpGet:
44+
path: /
45+
port: http
46+
47+
volumes: []
48+
49+
volumeMounts: []
50+
51+
nodeSelector: {}
52+
53+
tolerations: []
54+
55+
affinity: {}

0 commit comments

Comments
 (0)