Skip to content

Commit

Permalink
Merge pull request #267 from celo-org/dshackle-chart
Browse files Browse the repository at this point in the history
dshackle private chart
  • Loading branch information
alvarof2 authored Apr 30, 2024
2 parents 0dd83e0 + 9968c1b commit 194c0c6
Show file tree
Hide file tree
Showing 13 changed files with 612 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts-private/dshackle/.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/
10 changes: 10 additions & 0 deletions charts-private/dshackle/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: dshackle
description: A Helm chart for dshackle - A Fault Tolerant Load Balancer for Blockchain API.
type: application
version: 0.1.0
appVersion: "0.15.1"
maintainers:
- name: cLabs
email: devops@clabs.co
url: https://clabs.co
46 changes: 46 additions & 0 deletions charts-private/dshackle/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# dshackle

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.1](https://img.shields.io/badge/AppVersion-0.15.1-informational?style=flat-square)

A Helm chart for dshackle - A Fault Tolerant Load Balancer for Blockchain API.

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| cLabs | <devops@clabs.co> | <https://clabs.co> |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Kubernetes pod affinity |
| config | string | `""` | |
| env | object | `{}` | Env. vars. from secrets as <ENV_VAR_NAME>.secretName and <ENV_VAR_NAME>.secretKey |
| fullnameOverride | string | `""` | Chart full name override |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"emeraldpay/dshackle"` | |
| image.tag | string | `"0.15.1"` | |
| imagePullSecrets | list | `[]` | Image pull secrets |
| ingress.annotations | object | `{}` | Custom Ingress annotations |
| ingress.className | string | `"nginx"` | Ingress class name |
| ingress.enabled | bool | `false` | Ingress enabled |
| ingress.hosts | list | `[]` | List of hosts to expose safe-config-service. See values.yaml for an example. |
| ingress.tls | list | `[]` | TLS secret for exposing safe-config-service with https. See values.yaml for an example. |
| livenessProbe | object | `{}` | Liveness probe configuration |
| nameOverride | string | `""` | Chart name override |
| nodeSelector | object | `{}` | Kubernetes node selector |
| podAnnotations | string | `nil` | Custom pod annotations |
| podLabels | object | `{}` | Custom pod labels |
| podSecurityContext | object | `{}` | Custom pod security context |
| readinessProbe | object | `{}` | Readiness probe configuration |
| replicaCount | int | `1` | Number of deployment replicas |
| resources | object | `{}` | Container resources |
| securityContext | object | `{}` | Custom container security context |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| tolerations | list | `[]` | Kubernetes tolerations |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs). To regenerate run `helm-docs` command at this folder.
19 changes: 19 additions & 0 deletions charts-private/dshackle/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

----------------------------------------------
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs). To regenerate run `helm-docs` command at this folder.
55 changes: 55 additions & 0 deletions charts-private/dshackle/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
replicaCount: 1

image:
repository: emeraldpay/dshackle
pullPolicy: IfNotPresent
tag: "0.15.1"

config: |
version: v1
host: 0.0.0.0
tls:
enabled: false
proxy:
host: 0.0.0.0
routes:
- id: sepolia
blockchain: sepolia-testnet
health:
host: 0.0.0.0
blockchains:
- blockchain: sepolia-testnet
min-available: 0
monitoring:
enabled: true
jvm: false
extended: false
prometheus:
bind: 0.0.0.0
enabled: true
request-log:
enabled: true
cluster:
upstreams:
- id: alchemy-sepolia
blockchain: sepolia-testnet
connection:
ethereum:
rpc:
url: "https://ethereum-sepolia-rpc.publicnode.com"
env: {}

podAnnotations:
prometheus.io/path: /metrics
prometheus.io/port: "8081"
prometheus.io/scrape: "true"

ingress:
enabled: false
13 changes: 13 additions & 0 deletions charts-private/dshackle/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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 }}{{ .path }}
{{- end }}
{{- end }}
{{- else }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "dshackle.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
90 changes: 90 additions & 0 deletions charts-private/dshackle/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "dshackle.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 "dshackle.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 "dshackle.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "dshackle.labels" -}}
helm.sh/chart: {{ include "dshackle.chart" . }}
{{ include "dshackle.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "dshackle.selectorLabels" -}}
app.kubernetes.io/name: {{ include "dshackle.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "dshackle.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "dshackle.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Container gRPC port
*/}}
{{- define "dshackle.grpc-port" -}}
2449
{{- end }}

{{/*
Container HTTP port
*/}}
{{- define "dshackle.http-port" -}}
8080
{{- end }}

{{/*
Container metrics port
*/}}
{{- define "dshackle.metrics-port" -}}
8081
{{- end }}

{{/*
Container health port
*/}}
{{- define "dshackle.health-port" -}}
8082
{{- end }}
9 changes: 9 additions & 0 deletions charts-private/dshackle/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "dshackle.fullname" . }}
labels:
{{- include "dshackle.labels" . | nindent 4 }}
data:
config: |
{{- tpl .Values.config . | nindent 4 }}
92 changes: 92 additions & 0 deletions charts-private/dshackle/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "dshackle.fullname" . }}
labels:
{{- include "dshackle.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "dshackle.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "dshackle.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "dshackle.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: http
containerPort: {{ include "dshackle.http-port" . }}
protocol: TCP
- name: metrics
containerPort: {{ include "dshackle.metrics-port" . }}
protocol: TCP
- name: health
containerPort: {{ include "dshackle.health-port" . }}
protocol: TCP
- name: grpc
containerPort: {{ include "dshackle.grpc-port" . }}
protocol: TCP
{{- with .Values.env }}
env:
{{- range $key, $value := . }}
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ $value.secretName }}
key: {{ $value.secretKey }}
{{- end }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: dshackle
mountPath: /etc/dshackle/dshackle.yaml
subPath: config
volumes:
- name: dshackle
configMap:
name: {{ include "dshackle.fullname" . }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading

0 comments on commit 194c0c6

Please sign in to comment.