-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Kubernetes configuration files for Besu
This commit introduces Kubernetes configuration files for deploying Besu nodes. Key additions include: - Helm charts for Besu genesis and node deployment - Kubernetes manifests for Besu network setup - Configuration files for Besu node operations in a Kubernetes environment
- Loading branch information
Showing
35 changed files
with
1,836 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/eth/instance/infra/kubernetes/charts/besu-genesis/.helmignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
*~ | ||
generated_config/ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
20 changes: 20 additions & 0 deletions
20
src/eth/instance/infra/kubernetes/charts/besu-genesis/Chart.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
version: 0.1.0 | ||
appVersion: latest | ||
name: besu-genesis | ||
description: Besu Genesis generator with Helm chart in Kubernetes | ||
keywords: | ||
- ethereum | ||
- besu | ||
- hyperledger | ||
- enterprise | ||
- blockchain | ||
- pegasys | ||
- consensys | ||
home: https://besu.hyperledger.org | ||
sources: | ||
- https://github.com/hyperledger/besu | ||
maintainers: | ||
- name: Joshua Fernandes | ||
email: [email protected] | ||
icon: http://besu.hyperledger.org/en/latest/favicon.ico |
29 changes: 29 additions & 0 deletions
29
src/eth/instance/infra/kubernetes/charts/besu-genesis/templates/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "besu-genesis.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "besu-genesis.fullname" -}} | ||
{{- $name := default .Chart.Name -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" $name .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "besu-genesis.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
63 changes: 63 additions & 0 deletions
63
src/eth/instance/infra/kubernetes/charts/besu-genesis/templates/genesis-job-cleanup.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "besu-genesis.name" . }}-cleanup | ||
labels: | ||
{{- if and (eq .Values.cluster.provider "azure") (.Values.cluster.cloudNativeServices) }} | ||
azure.workload.identity/use: "true" | ||
{{- end }} | ||
app.kubernetes.io/name: besu-genesis-job-cleanup | ||
app.kubernetes.io/component: genesis-job-cleanup | ||
app.kubernetes.io/part-of: {{ include "besu-genesis.fullname" . }} | ||
app.kubernetes.io/namespace: {{ .Release.Namespace }} | ||
app.kubernetes.io/managed-by: helm | ||
namespace: {{ .Release.Namespace }} | ||
annotations: | ||
helm.sh/hook-weight: "0" | ||
helm.sh/hook: "pre-delete" | ||
helm.sh/hook-delete-policy: "hook-succeeded" | ||
spec: | ||
backoffLimit: 3 | ||
completions: 1 | ||
template: | ||
metadata: | ||
labels: | ||
{{- if and (eq .Values.cluster.provider "azure") (.Values.cluster.cloudNativeServices) }} | ||
azure.workload.identity/use: "true" | ||
{{- end}} | ||
app.kubernetes.io/name: besu-genesis-job-cleanup | ||
app.kubernetes.io/component: genesis-job-cleanup | ||
app.kubernetes.io/part-of: {{ include "besu-genesis.fullname" . }} | ||
app.kubernetes.io/namespace: {{ .Release.Namespace }} | ||
app.kubernetes.io/managed-by: helm | ||
spec: | ||
{{- if and (eq .Values.cluster.provider "azure") (.Values.cluster.cloudNativeServices) }} | ||
serviceAccountName: {{ .Values.azure.serviceAccountName }} | ||
{{- else if and (eq .Values.cluster.provider "aws") (.Values.cluster.cloudNativeServices) }} | ||
serviceAccountName: {{ .Values.aws.serviceAccountName }} | ||
{{- else }} | ||
serviceAccountName: {{ include "besu-genesis.name" . }}-sa | ||
{{- end }} | ||
restartPolicy: "Never" | ||
containers: | ||
- name: delete-genesis | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
securityContext: | ||
runAsUser: 0 | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
command: | ||
- /bin/bash | ||
- -c | ||
args: | ||
- | | ||
{{- if .Values.quorumFlags.removeGenesisOnDelete }} | ||
|
||
echo "Deleting genesis configmap in k8s ..." | ||
kubectl delete configmap --namespace {{ .Release.Namespace }} besu-genesis | ||
|
||
echo "Deleting node-enodes configmap in k8s ..." | ||
kubectl delete configmap --namespace {{ .Release.Namespace }} besu-peers | ||
|
||
{{- end}} |
Oops, something went wrong.