Skip to content

Commit 4b37d3d

Browse files
authored
Merge pull request #6 from ethpandaops/feat/add-panda-pulse-cron
feat(charts): adds panda-pulse cron
2 parents 2acc824 + bc5b98c commit 4b37d3d

File tree

11 files changed

+306
-11
lines changed

11 files changed

+306
-11
lines changed

.github/workflows/lint-test.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111
with:
1212
fetch-depth: 0
1313

1414
- name: Set up Helm
15-
uses: azure/setup-helm@v1
15+
uses: azure/setup-helm@v4
1616
with:
17-
version: v3.7.0
17+
version: v3.16.2
1818

19-
- uses: actions/setup-python@v2
19+
- uses: actions/setup-python@v5
2020
with:
21-
python-version: 3.7
21+
python-version: 3.12
2222

2323
- name: Run pre-commit hooks
24-
uses: pre-commit/action@v3.0.0
24+
uses: pre-commit/action@v3.0.1
2525

2626
- name: Set up chart-testing
27-
uses: helm/chart-testing-action@v2.1.0
27+
uses: helm/chart-testing-action@v2.6.1
28+
with:
29+
version: "v3.11.0"
2830

2931
- name: Run chart-testing (list-changed)
3032
id: list-changed
@@ -38,7 +40,7 @@ jobs:
3840
run: ct lint --config ct.yaml
3941

4042
- name: Create kind cluster
41-
uses: helm/kind-action@v1.2.0
43+
uses: helm/kind-action@v1.10.0
4244
if: steps.list-changed.outputs.changed == 'true'
4345

4446
- name: Run chart-testing (install)

.github/workflows/release.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
1818

@@ -22,9 +22,9 @@ jobs:
2222
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
2323
2424
- name: Set up Helm
25-
uses: azure/setup-helm@v1
25+
uses: azure/setup-helm@v4
2626
with:
27-
version: v3.7.0
27+
version: v3.16.2
2828

2929
- name: Add repo dependencies
3030
run: helm repo add bitnami https://charts.bitnami.com/bitnami

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ helm search repo ethpandaops-general-helm-charts
2727

2828
- [`cloudflare-tunnel`](charts/cloudflare-tunnel)
2929
- [`chproxy`](charts/chproxy)
30+
- [`panda-pulse`](charts/panda-pulse)
3031
- [`raw-configmap`](charts/raw-configmap)
3132

3233
## Development

charts/panda-pulse/.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/panda-pulse/Chart.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
name: panda-pulse
3+
description: A Helm chart for Panda Pulse - Ethereum network monitoring and reporting tool
4+
type: application
5+
version: 0.0.1
6+
appVersion: "latest"
7+
maintainers:
8+
- name: matty
9+
email: matt.evans@ethereum.org

charts/panda-pulse/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# panda-pulse
2+
3+
![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
4+
5+
A Helm chart for Panda Pulse - Ethereum network monitoring and reporting tool
6+
7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| matty | matt.evans@ethereum.org | |
12+
13+
## Values
14+
15+
| Key | Type | Default | Description |
16+
|-----|------|---------|-------------|
17+
| affinity | object | `{}` | |
18+
| config.discordChannel | string | `"YOUR_DISCORD_CHANNEL_ID"` | |
19+
| config.ethereumCl | string | `""` | |
20+
| config.ethereumEl | string | `""` | |
21+
| config.grafanaBaseUrl | string | `""` | |
22+
| config.network | string | `"YOUR_PREFERRED_NETWORK"` | |
23+
| config.prometheusDatasourceId | string | `""` | |
24+
| fullnameOverride | string | `""` | |
25+
| image.pullPolicy | string | `"IfNotPresent"` | |
26+
| image.repository | string | `"ethpandaops/panda-pulse"` | |
27+
| image.tag | string | `"latest"` | |
28+
| imagePullSecrets | list | `[]` | |
29+
| nameOverride | string | `""` | |
30+
| nodeSelector | object | `{}` | |
31+
| podAnnotations | object | `{}` | |
32+
| podSecurityContext | object | `{}` | |
33+
| resources.limits.cpu | string | `"1000m"` | |
34+
| resources.limits.memory | string | `"1Gi"` | |
35+
| resources.requests.cpu | string | `"100m"` | |
36+
| resources.requests.memory | string | `"128Mi"` | |
37+
| schedule | string | `"0 7 * * *"` | |
38+
| secrets.discordBotToken | string | `"YOUR_DISCORD_BOT_TOKEN"` | |
39+
| secrets.grafanaServiceToken | string | `"YOUR_GRAFANA_SERVICE_TOKEN"` | |
40+
| secrets.openrouterApiKey | string | `""` | |
41+
| securityContext | object | `{}` | |
42+
| serviceAccount.annotations | object | `{}` | |
43+
| serviceAccount.create | bool | `true` | |
44+
| serviceAccount.name | string | `""` | |
45+
| tolerations | list | `[]` | |
46+
47+
----------------------------------------------
48+
Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0)
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 "panda-pulse.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 "panda-pulse.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 "panda-pulse.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "panda-pulse.labels" -}}
37+
helm.sh/chart: {{ include "panda-pulse.chart" . }}
38+
{{ include "panda-pulse.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 "panda-pulse.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "panda-pulse.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 "panda-pulse.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "panda-pulse.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: {{ include "panda-pulse.fullname" . }}
5+
labels:
6+
{{- include "panda-pulse.labels" . | nindent 4 }}
7+
spec:
8+
schedule: {{ .Values.schedule | quote }}
9+
concurrencyPolicy: Forbid
10+
jobTemplate:
11+
spec:
12+
template:
13+
metadata:
14+
{{- with .Values.podAnnotations }}
15+
annotations:
16+
{{- toYaml . | nindent 12 }}
17+
{{- end }}
18+
labels:
19+
{{- include "panda-pulse.selectorLabels" . | nindent 12 }}
20+
spec:
21+
{{- with .Values.imagePullSecrets }}
22+
imagePullSecrets:
23+
{{- toYaml . | nindent 12 }}
24+
{{- end }}
25+
serviceAccountName: {{ include "panda-pulse.serviceAccountName" . }}
26+
securityContext:
27+
{{- toYaml .Values.podSecurityContext | nindent 12 }}
28+
containers:
29+
- name: {{ .Chart.Name }}
30+
securityContext:
31+
{{- toYaml .Values.securityContext | nindent 16 }}
32+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
33+
imagePullPolicy: {{ .Values.image.pullPolicy }}
34+
args:
35+
- --network={{ required "A valid network is required" .Values.config.network }}
36+
- --discord-channel={{ required "A valid Discord channel ID is required" .Values.config.discordChannel }}
37+
{{- if .Values.config.ethereumCl }}
38+
- --ethereum-cl={{ .Values.config.ethereumCl }}
39+
{{- end }}
40+
{{- if .Values.config.ethereumEl }}
41+
- --ethereum-el={{ .Values.config.ethereumEl }}
42+
{{- end }}
43+
{{- if .Values.config.grafanaBaseUrl }}
44+
- --grafana-base-url={{ .Values.config.grafanaBaseUrl }}
45+
{{- end }}
46+
{{- if .Values.config.prometheusDatasourceId }}
47+
- --prometheus-datasource-id={{ .Values.config.prometheusDatasourceId }}
48+
{{- end }}
49+
env:
50+
- name: GRAFANA_SERVICE_TOKEN
51+
valueFrom:
52+
secretKeyRef:
53+
name: {{ include "panda-pulse.fullname" . }}
54+
key: grafana-service-token
55+
- name: DISCORD_BOT_TOKEN
56+
valueFrom:
57+
secretKeyRef:
58+
name: {{ include "panda-pulse.fullname" . }}
59+
key: discord-bot-token
60+
{{- if .Values.secrets.openrouterApiKey }}
61+
- name: OPENROUTER_API_KEY
62+
valueFrom:
63+
secretKeyRef:
64+
name: {{ include "panda-pulse.fullname" . }}
65+
key: openrouter-api-key
66+
{{- end }}
67+
resources:
68+
{{- toYaml .Values.resources | nindent 16 }}
69+
{{- with .Values.nodeSelector }}
70+
nodeSelector:
71+
{{- toYaml . | nindent 12 }}
72+
{{- end }}
73+
{{- with .Values.affinity }}
74+
affinity:
75+
{{- toYaml . | nindent 12 }}
76+
{{- end }}
77+
{{- with .Values.tolerations }}
78+
tolerations:
79+
{{- toYaml . | nindent 12 }}
80+
{{- end }}
81+
restartPolicy: OnFailure
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "panda-pulse.fullname" . }}
5+
labels:
6+
{{- include "panda-pulse.labels" . | nindent 4 }}
7+
type: Opaque
8+
data:
9+
grafana-service-token: {{ required "A valid Grafana service token is required" .Values.secrets.grafanaServiceToken | b64enc }}
10+
discord-bot-token: {{ required "A valid Discord bot token is required" .Values.secrets.discordBotToken | b64enc }}
11+
{{- if .Values.secrets.openrouterApiKey }}
12+
openrouter-api-key: {{ .Values.secrets.openrouterApiKey | b64enc }}
13+
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "panda-pulse.serviceAccountName" . }}
6+
labels:
7+
{{- include "panda-pulse.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- end }}

charts/panda-pulse/values.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
image:
2+
repository: ethpandaops/panda-pulse
3+
tag: latest
4+
pullPolicy: IfNotPresent
5+
6+
imagePullSecrets: []
7+
nameOverride: ""
8+
fullnameOverride: ""
9+
10+
schedule: "0 7 * * *" # Run at 7am UTC daily
11+
12+
config:
13+
network: "YOUR_PREFERRED_NETWORK" # required
14+
discordChannel: "YOUR_DISCORD_CHANNEL_ID" # required
15+
ethereumCl: "" # optional
16+
ethereumEl: "" # optional
17+
grafanaBaseUrl: "" # optional
18+
prometheusDatasourceId: "" # optional
19+
20+
secrets:
21+
grafanaServiceToken: "YOUR_GRAFANA_SERVICE_TOKEN" # required
22+
discordBotToken: "YOUR_DISCORD_BOT_TOKEN" # required
23+
openrouterApiKey: "" # optional
24+
25+
resources:
26+
limits:
27+
cpu: 1000m
28+
memory: 1Gi
29+
requests:
30+
cpu: 100m
31+
memory: 128Mi
32+
33+
serviceAccount:
34+
create: true
35+
annotations: {}
36+
name: ""
37+
38+
podAnnotations: {}
39+
podSecurityContext: {}
40+
securityContext: {}
41+
42+
nodeSelector: {}
43+
tolerations: []
44+
affinity: {}

0 commit comments

Comments
 (0)