-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add chart for bee-localchain (#205)
- Loading branch information
Иван Vandot
authored
Apr 13, 2024
1 parent
8e78a1b
commit 91cb197
Showing
15 changed files
with
478 additions
and
8 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
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/ |
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,17 @@ | ||
apiVersion: v2 | ||
appVersion: latest | ||
name: bee-localchain | ||
version: 0.1.0 | ||
description: BZZ Token Service Helm chart for Kubernetes | ||
home: https://www.ethswarm.org | ||
icon: https://docs.ethswarm.org/img/swarm-logo-2.svg | ||
keywords: | ||
- blockchain | ||
- ethereum | ||
- bee | ||
maintainers: | ||
- name: vandot | ||
email: vandot@ethswarm.org | ||
sources: | ||
- https://github.com/ethersphere/bee-localchain | ||
type: application |
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,99 @@ | ||
# Bee localchain Helm Chart | ||
|
||
[Bee localchain](https://github.com/ethersphere/bee-localchain) is a lightweight Prometheus proxy that will output Ethereum wallet balances from a list of addresses you specify. | ||
|
||
## Prerequisites | ||
|
||
Make sure you have Helm [installed](https://helm.sh/docs/intro/install/) installed. | ||
|
||
## Get Repo Info | ||
|
||
```bash | ||
helm repo add ethersphere https://ethersphere.github.io/helm | ||
helm repo update | ||
``` | ||
|
||
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._ | ||
|
||
## QuickStart | ||
|
||
```bash | ||
$ helm install --generate-name ethersphere/bee-localchain | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart deploys a [Bee localchain](https://github.com/ethersphere/bee-localchain) onto a Kubernetes cluster using the Helm package manager. | ||
|
||
## Prerequisites | ||
|
||
* Kubernetes 1.15 | ||
* Helm 3.0 | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```bash | ||
$ helm install my-release ethersphere/bee-localchain | ||
``` | ||
|
||
The command deploys Bee localchain on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `my-release` deployment: | ||
|
||
```bash | ||
$ helm delete my-release | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The default configuration values for this chart are listed in **values.yaml**. | ||
|
||
## Helmsman Usage | ||
|
||
### Prerequisites | ||
|
||
* Kubernetes 1.15 | ||
* Helm 3.0 | ||
* Helmsman 3.0 | ||
|
||
### Installing | ||
|
||
Create bee-localchain.yaml file as shown bellow: | ||
|
||
```yaml | ||
namespaces: | ||
bee-localchain: | ||
|
||
helmRepos: | ||
ethersphere: "https://ethersphere.github.io/helm" | ||
|
||
apps: | ||
bee-localchain: | ||
name: bee-localchain | ||
namespace: bee-localchain | ||
description: "Bee localchain" | ||
chart: "ethersphere/bee-localchain" | ||
version: "0.1.0" | ||
enabled: true | ||
wait: true | ||
timeout: 120 | ||
|
||
``` | ||
|
||
Execute following command: | ||
```bash | ||
$ helmsman -apply -f bee-localchain.yaml | ||
``` | ||
|
||
### Uninstalling | ||
|
||
Execute following command: | ||
```bash | ||
$ helmsman -destroy -f bee-localchain.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,21 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "bee-localchain.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "bee-localchain.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "bee-localchain.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "bee-localchain.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Use http://127.0.0.1:8545 to access your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8545:8545 | ||
{{- end }} |
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 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "bee-localchain.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 "bee-localchain.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "bee-localchain.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "bee-localchain.labels" -}} | ||
helm.sh/chart: {{ include "bee-localchain.chart" . }} | ||
{{ include "bee-localchain.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "bee-localchain.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "bee-localchain.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "bee-localchain.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "bee-localchain.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
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: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "bee-localchain.fullname" . }} | ||
labels: | ||
{{- include "bee-localchain.labels" . | nindent 4 }} | ||
spec: | ||
{{- if not .Values.autoscaling.enabled }} | ||
replicas: {{ .Values.replicaCount }} | ||
{{- end }} | ||
strategy: | ||
{{- toYaml .Values.strategy | nindent 4 }} | ||
selector: | ||
matchLabels: | ||
{{- include "bee-localchain.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "bee-localchain.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "bee-localchain.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: rpc | ||
containerPort: 8545 | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: rpc | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: rpc | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
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,28 @@ | ||
{{- if .Values.autoscaling.enabled }} | ||
apiVersion: autoscaling/v2beta1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "bee-localchain.fullname" . }} | ||
labels: | ||
{{- include "bee-localchain.labels" . | nindent 4 }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ include "bee-localchain.fullname" . }} | ||
minReplicas: {{ .Values.autoscaling.minReplicas }} | ||
maxReplicas: {{ .Values.autoscaling.maxReplicas }} | ||
metrics: | ||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
{{- end }} | ||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.