Skip to content

Commit

Permalink
feat(xatu): add xatu server (ethpandaops#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid authored Jan 9, 2023
1 parent c1d7169 commit 8fe97ce
Show file tree
Hide file tree
Showing 28 changed files with 754 additions and 46 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Tooling
- [`ethereum-address-metrics-exporter`](charts/ethereum-address-metrics-exporter) - A prometheus exporter for Ethereum externally owned account and contract addresses.
- [`smart-contract-verifier-http`](charts/smart-contract-verifier-http) - Smart contract verification service.
- [`web3signer`](charts/web3signer) - An open-source remote signing service.
- [`xatu-sentry`](charts/xatu-sentry) - Ethereum p2p monitoring tool that runs along side a [Ethereum consensus client](https://ethereum.org/en/developers/docs/nodes-and-clients/#consensus-clients) and collects data via the consensus client's [Beacon API](https://ethereum.github.io/beacon-APIs/).
- [`xatu-server`](charts/xatu-server) - Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.

## Development

Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions charts/xatu-sentry/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: xatu-sentry
description: Ethereum p2p monitoring tool that runs along side a Ethereum consensus client and collects data via the consensus client's Beacon API.
home: https://github.com/ethpandaops/xatu
type: application
version: 0.0.1
maintainers:
- name: samcm
email: [email protected]
- name: savid
email: [email protected]
7 changes: 3 additions & 4 deletions charts/xatu/README.md → charts/xatu-sentry/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# xatu
# xatu-sentry

![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)

Ethereum p2p monitoring tool
Ethereum p2p monitoring tool that runs along side a Ethereum consensus client and collects data via the consensus client's Beacon API.

**Homepage:** <https://github.com/ethpandaops/xatu>

Expand All @@ -18,14 +18,13 @@ Ethereum p2p monitoring tool
| config.logging | string | `"info"` | |
| config.metricsAddr | string | `":9090"` | |
| config.name | string | `"example-instance"` | |
| config.ntp_server | string | `"time.google.com"` | |
| config.outputs[0].config.address | string | `"http://localhost:8080"` | |
| config.outputs[0].config.batch_timeout | string | `"5s"` | |
| config.outputs[0].config.export_timeout | string | `"30s"` | |
| config.outputs[0].config.headers.Authorization | string | `"Someb64Value"` | |
| config.outputs[0].config.max_export_batch_size | int | `512` | |
| config.outputs[0].config.max_queue_size | int | `51200` | |
| config.outputs[0].config.ntp_server | string | `"pool.ntp.org"` | |
| config.outputs[0].config.type | string | `"http"` | |
| config.outputs[0].name | string | `"basic"` | |
| config.outputs[0].type | string | `"http"` | |
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "xatu.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "xatu-sentry.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 "xatu.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "xatu.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ include "xatu.httpPort" . }}
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "xatu-sentry.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "xatu-sentry.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ include "xatu-sentry.httpPort" . }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "xatu.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "xatu-sentry.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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "xatu.name" -}}
{{- define "xatu-sentry.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 "xatu.fullname" -}}
{{- define "xatu-sentry.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ 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 "xatu.chart" -}}
{{- define "xatu-sentry.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "xatu.labels" -}}
helm.sh/chart: {{ include "xatu.chart" . }}
{{ include "xatu.selectorLabels" . }}
{{- define "xatu-sentry.labels" -}}
helm.sh/chart: {{ include "xatu-sentry.chart" . }}
{{ include "xatu-sentry.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,22 +45,22 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "xatu.selectorLabels" -}}
app.kubernetes.io/name: {{ include "xatu.name" . }}
{{- define "xatu-sentry.selectorLabels" -}}
app.kubernetes.io/name: {{ include "xatu-sentry.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

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

{{- define "xatu.metricsPort" -}}
{{- define "xatu-sentry.metricsPort" -}}
{{ (split ":" .Values.config.metricsAddr)._1 | default ":9090" }}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "xatu.fullname" . }}
name: {{ include "xatu-sentry.fullname" . }}
labels:
{{- include "xatu.labels" . | nindent 4 }}
{{- include "xatu-sentry.labels" . | nindent 4 }}
data:
config.yaml: |-
{{ toYaml .Values.config | nindent 4 }}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "xatu.fullname" . }}
name: {{ include "xatu-sentry.fullname" . }}
labels:
{{- include "xatu.labels" . | nindent 4 }}
{{- include "xatu-sentry.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.annotations | nindent 4 }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
{{- include "xatu.selectorLabels" . | nindent 6 }}
{{- include "xatu-sentry.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "xatu.selectorLabels" . | nindent 8 }}
{{- include "xatu-sentry.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -25,7 +25,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "xatu.serviceAccountName" . }}
serviceAccountName: {{ include "xatu-sentry.serviceAccountName" . }}
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
Expand Down Expand Up @@ -70,7 +70,7 @@ spec:
{{- end }}
ports:
- name: metrics
containerPort: {{ include "xatu.metricsPort" . }}
containerPort: {{ include "xatu-sentry.metricsPort" . }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
Expand All @@ -83,7 +83,7 @@ spec:
- name: {{ $key }}
valueFrom:
secretKeyRef:
name: {{ include "xatu.fullname" $ }}-env
name: {{ include "xatu-sentry.fullname" $ }}-env
key: {{ $key }}
{{- end }}
{{- if .Values.extraEnv }}
Expand All @@ -105,4 +105,4 @@ spec:
{{- end }}
- name: config
configMap:
name: {{ include "xatu.fullname" . }}
name: {{ include "xatu-sentry.fullname" . }}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "xatu.fullname" . }}-env
name: {{ include "xatu-sentry.fullname" . }}-env
labels:
{{- include "xatu.labels" . | nindent 4 }}
{{- include "xatu-sentry.labels" . | nindent 4 }}
data:
{{- range $key, $value := .Values.secretEnv }}
{{ $key }}: {{ $value | b64enc }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "xatu.fullname" . }}
name: {{ include "xatu-sentry.fullname" . }}
labels:
{{- include "xatu.labels" . | nindent 4 }}
{{- include "xatu-sentry.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ include "xatu.metricsPort" . }}
- port: {{ include "xatu-sentry.metricsPort" . }}
targetPort: metrics
protocol: TCP
name: metrics
{{- if .Values.extraPorts }}
{{ toYaml .Values.extraPorts | nindent 4}}
{{- end }}
selector:
{{- include "xatu.selectorLabels" . | nindent 4 }}
{{- include "xatu-sentry.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "xatu.serviceAccountName" . }}
name: {{ include "xatu-sentry.serviceAccountName" . }}
labels:
{{- include "xatu.labels" . | nindent 4 }}
{{- include "xatu-sentry.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "xatu.fullname" . }}
name: {{ include "xatu-sentry.fullname" . }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
labels:
{{- include "xatu.labels" . | nindent 4 }}
{{- include "xatu-sentry.labels" . | nindent 4 }}
{{- if .Values.serviceMonitor.labels }}
{{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
{{- end }}
Expand All @@ -22,7 +22,7 @@ spec:
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
port: http
port: metrics
path: {{ .Values.serviceMonitor.path }}
scheme: {{ .Values.serviceMonitor.scheme }}
{{- if .Values.serviceMonitor.tlsConfig }}
Expand All @@ -36,7 +36,7 @@ spec:
jobLabel: "{{ .Release.Name }}"
selector:
matchLabels:
{{- include "xatu.selectorLabels" . | nindent 8 }}
{{- include "xatu-sentry.selectorLabels" . | nindent 8 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
Expand Down
3 changes: 1 addition & 2 deletions charts/xatu/values.yaml → charts/xatu-sentry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ config:
logging: "info"
metricsAddr: ":9090"
name: example-instance
ntp_server: time.google.com
ethereum:
beacon_node_address: http://localhost:5052
outputs:
- name: basic
type: http
config:
type: http
address: http://localhost:8080
ntp_server: pool.ntp.org
headers:
Authorization: Someb64Value
max_queue_size: 51200
Expand Down
23 changes: 23 additions & 0 deletions charts/xatu-server/.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/
4 changes: 2 additions & 2 deletions charts/xatu/Chart.yaml → charts/xatu-server/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: xatu
description: Ethereum p2p monitoring tool
name: xatu-server
description: Ethereum p2p monitoring tool that collects events from and controls various Xatu clients.
home: https://github.com/ethpandaops/xatu
type: application
version: 0.0.1
Expand Down
Loading

0 comments on commit 8fe97ce

Please sign in to comment.