Skip to content

Commit

Permalink
feat: rework helm-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
rguichard committed Aug 28, 2023
1 parent f9933bf commit cb80206
Show file tree
Hide file tree
Showing 15 changed files with 347 additions and 327 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/helm-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: charts::ghcr-oci

on:
push:
branches:
- main
paths:
- "charts/**"
- ".github/workflows/helm-chart.yaml"
pull_request:
branches:
- main
paths:
- "charts/**"
- ".github/workflows/helm-chart.yaml"

permissions:
id-token: write
actions: write
pull-requests: write
issues: write
contents: write
packages: write

jobs:
helm-lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch main --chart-dirs charts)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --target-branch main --chart-dirs charts

helm-release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- helm-lint-test
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3
with:
version: v3.8.0

- name: 'helm:package:create'
run: |
helm package charts/
- name: 'helm:package:get_artifcat_name'
run: |
find . -name "*.tgz"
echo "ARTIFACT_NAME=$(find . -name "*.tgz" -maxdepth 1)" >> $GITHUB_ENV
- name: 'helm:package:upload'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username kilnfi --password-stdin
helm push ${{ env.ARTIFACT_NAME }} oci://${{ env.REGISTRY }}/kilnfi/helm-charts/
env:
REGISTRY: ghcr.io
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ Finally, this program exports the following sets of data from:
- Prometheus (you can use this Grafana dashboard to monitor your validators)
- Slack
- logs

Prometheus server is automatically exposed on port 8000.

Command line options
--------------------

```
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * --beacon-url TEXT URL of beacon node [required] │
Expand Down
2 changes: 1 addition & 1 deletion charts/eth-validator-watcher/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
description: A Helm chart for running eth-validator-watcher
name: eth-validator-watcher
type: application
version: 1.0.0
version: 1.1.0
maintainers:
- name: Alluvial
email: [email protected]
Expand Down
93 changes: 48 additions & 45 deletions charts/eth-validator-watcher/README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,65 @@
# eth-validator-watcher

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

A Helm chart for running eth-validator-watcher

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| Alluvial | <[email protected]> | <https://alluvial.finance> |
| Alluvial | [email protected] | https://alluvial.finance |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| args | list | `[]` | Specifies the arguments to the command line Please refer to https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#description |
| env | object | `{}` | |
| envFrom | object | `{}` | |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/kilnfi/eth-validator-watcher"` | |
| image.tag | string | `"latest"` | |
| imagePullSecrets | list | `[]` | |
| livenessProbe.exec.command[0] | string | `"/usr/bin/python3.9"` | |
| livenessProbe.exec.command[1] | string | `"/usr/local/bin/liveness_check.py"` | |
| livenessProbe.exec.command[2] | string | `"/tmp/liveness"` | |
| livenessProbe.failureThreshold | int | `10` | |
| livenessProbe.initialDelaySeconds | int | `120` | |
| livenessProbe.periodSeconds | int | `60` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| readinessProbe.exec.command[0] | string | `"/usr/bin/python3.9"` | |
| readinessProbe.exec.command[1] | string | `"/usr/local/bin/liveness_check.py"` | |
| readinessProbe.exec.command[2] | string | `"/tmp/liveness"` | |
| readinessProbe.failureThreshold | int | `10` | |
| readinessProbe.initialDelaySeconds | int | `30` | |
| readinessProbe.periodSeconds | int | `60` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| 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 |
| serviceMonitor.additionalLabels | object | `{}` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.metricRelabelings | list | `[]` | |
| serviceMonitor.namespace | string | `""` | |
| serviceMonitor.namespaceSelector | object | `{}` | |
| serviceMonitor.scrapeInterval | string | `"60s"` | |
| serviceMonitor.targetLabels | list | `[]` | |
| startupProbe | object | `{}` | |
| tolerations | list | `[]` | |
| volumeMounts | list | `[]` | |
| volumes | list | `[]` | |
| watchedKeys | list | `[]` | List of public keys to watch. See https://github.com/kilnfi/eth-validator-watcher/blob/main/README.md#command-lines-examples |
| watcher.affinity | object | `{}` | |
| watcher.config.beaconType | string | `"other"` | |
| watcher.config.beaconUrl | string | `"http://localhost:5052"` | |
| watcher.extraArgs | list | `[]` | |
| watcher.extraInitContainers | list | `[]` | |
| watcher.fullnameOverride | string | `""` | |
| watcher.image.pullPolicy | string | `"IfNotPresent"` | |
| watcher.image.repository | string | `"ghcr.io/kilnfi/eth-validator-watcher"` | |
| watcher.image.tag | string | `"v0.41.0"` | |
| watcher.imagePullSecrets | list | `[]` | |
| watcher.livenessProbe.failureThreshold | int | `1` | |
| watcher.livenessProbe.initialDelaySeconds | int | `60` | |
| watcher.livenessProbe.periodSeconds | int | `60` | |
| watcher.livenessProbe.successThreshold | int | `1` | |
| watcher.livenessProbe.timeoutSeconds | int | `1` | |
| watcher.nameOverride | string | `""` | |
| watcher.nodeSelector | object | `{}` | |
| watcher.podAnnotations | object | `{}` | |
| watcher.podLabels | object | `{}` | |
| watcher.podMonitor.additionalLabels | object | `{}` | |
| watcher.podMonitor.enabled | bool | `false` | |
| watcher.podMonitor.interval | string | `"12s"` | |
| watcher.podMonitor.relabelings | list | `[]` | |
| watcher.podMonitor.scheme | string | `"http"` | |
| watcher.podMonitor.tlsConfig | object | `{}` | |
| watcher.podSecurityContext | object | `{}` | |
| watcher.readinessProbe.failureThreshold | int | `1` | |
| watcher.readinessProbe.initialDelaySeconds | int | `60` | |
| watcher.readinessProbe.periodSeconds | int | `60` | |
| watcher.readinessProbe.successThreshold | int | `1` | |
| watcher.readinessProbe.timeoutSeconds | int | `1` | |
| watcher.replicaCount | int | `1` | |
| watcher.resources.limits.memory | string | `"2400Mi"` | |
| watcher.resources.requests.cpu | string | `"100m"` | |
| watcher.resources.requests.memory | string | `"1200Mi"` | |
| watcher.securityContext | object | `{}` | |
| watcher.service.port | int | `80` | |
| watcher.service.type | string | `"ClusterIP"` | |
| watcher.serviceAccount.annotations | object | `{}` | |
| watcher.serviceAccount.create | bool | `true` | |
| watcher.serviceAccount.labels | object | `{}` | |
| watcher.serviceAccount.name | string | `""` | |
| watcher.tolerations | list | `[]` | |
| watcher.volumeMounts | object | `{}` | |
| watcher.volumes | object | `{}` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Autogenerated from chart metadata using [helm-docs v1.7.0](https://github.com/norwoodj/helm-docs/releases/v1.7.0)
48 changes: 26 additions & 22 deletions charts/eth-validator-watcher/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "eth-validator-watcher.name" -}}
{{- define "ethereum-validator-watcher.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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 "eth-validator-watcher.fullname" -}}
{{- define "ethereum-validator-watcher.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,37 +26,41 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "eth-validator-watcher.chart" -}}
{{- define "ethereum-validator-watcher.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
Create the name of the service account to use
*/}}
{{- define "eth-validator-watcher.labels" -}}
helm.sh/chart: {{ include "eth-validator-watcher.chart" . }}
{{ include "eth-validator-watcher.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- define "ethereum-validator-watcher.serviceAccountName" -}}
{{- if .Values.watcher.serviceAccount.create }}
{{- default (include "ethereum-validator-watcher.fullname" .) .Values.watcher.serviceAccount.name }}
{{- else }}

{{- default "default" .Values.watcher.serviceAccount.name }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
Common labels
*/}}
{{- define "eth-validator-watcher.selectorLabels" -}}
app.kubernetes.io/name: {{ include "eth-validator-watcher.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- define "ethereum-validator-watcher.labels" -}}
app.kubernetes.io/name: {{ include "ethereum-validator-watcher.name" . }}
helm.sh/chart: {{ include "ethereum-validator-watcher.chart" . }}
app.kubernetes.io/instance: ethereum-validator-watcher
app.kubernetes.io/client-type: {{ .Values.clientType }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
{{- end -}}

{{/*
Create the name of the service account to use
Selector labels
*/}}
{{- define "eth-validator-watcher.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "eth-validator-watcher.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- define "ethereum-validator-watcher.matchLabels" -}}
app.kubernetes.io/name: {{ include "ethereum-validator-watcher.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/client-type: {{ .Values.clientType }}
{{- end -}}
14 changes: 0 additions & 14 deletions charts/eth-validator-watcher/templates/configmap.yaml

This file was deleted.

Loading

0 comments on commit cb80206

Please sign in to comment.