Skip to content

Commit

Permalink
Merge pull request #375 from celo-org/op-conductor-mon
Browse files Browse the repository at this point in the history
OP Conductor mon chart
  • Loading branch information
alvarof2 committed Aug 7, 2024
2 parents fe2c741 + ae62747 commit 74bef32
Show file tree
Hide file tree
Showing 10 changed files with 400 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The charts are published to the OCI registry at `oci://us-west1-docker.pkg.dev/d
- [op-batcher](./charts/op-batcher/README.md) - Celo implementation for op-batcher client (Optimism Rollup)
- [op-bootnode](./charts/op-bootnode/README.md) - Celo implementation for op-bootnode (Optimism Rollup)
- [op-conductor](./charts/op-conductor/README.md) - Helm chart deploying OP Conductor, a HA controller for op-node
- [op-conductor-mon](./charts/op-conductor-mon/README.md) - A Helm chart for OP Conductor monitoring
- [op-geth](./charts/op-geth/README.md) - Celo implementation for op-geth execution engine (Optimism Rollup)
- [op-node](./charts/op-node/README.md) - Celo implementation for op-node consensus engine (Optimism Rollup)
- [op-proposer](./charts/op-proposer/README.md) - Celo implementation for op-proposer client (Optimism Rollup)
Expand Down
23 changes: 23 additions & 0 deletions charts/op-conductor-mon/.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/
12 changes: 12 additions & 0 deletions charts/op-conductor-mon/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v2
name: op-conductor-mon
description: A Helm chart for OP Conductor monitoring
type: application
version: 0.1.0
appVersion: "main"
maintainers:
- name: cLabs
email: [email protected]
url: https://clabs.co
sources:
- https://github.com/celo-org/op-signer-service
48 changes: 48 additions & 0 deletions charts/op-conductor-mon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# op-conductor-mon

![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: main](https://img.shields.io/badge/AppVersion-main-informational?style=flat-square)

A Helm chart for OP Conductor monitoring

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| cLabs | <[email protected]> | <https://clabs.co> |

## Source Code

* <https://github.com/celo-org/op-signer-service>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Kubernetes pod affinity |
| config | string | `""` | Config as string. Minimal example at https://github.com/ethereum-optimism/optimism/blob/develop/proxyd/example.config.toml |
| fullnameOverride | string | `""` | Chart full name override |
| image.pullPolicy | string | `"IfNotPresent"` | Image pullpolicy |
| image.repository | string | `"us-docker.pkg.dev/oplabs-tools-artifacts/images/op-conductor-mon"` | Image repository |
| image.tag | string | `"main"` | Image tag Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | Image pull secrets |
| livenessProbe | object | `{"httpGet":{"path":"/healthz","port":"healthz"}}` | Liveness probe configuration |
| nameOverride | string | `""` | Chart name override |
| nodeSelector | object | `{}` | Kubernetes node selector |
| podAnnotations | object | `{}` | Custom pod annotations |
| podLabels | object | `{}` | Custom pod labels |
| podSecurityContext | object | `{}` | Custom pod security context |
| readinessProbe | object | `{"httpGet":{"path":"/healthz","port":"healthz"}}` | Readiness probe configuration |
| replicaCount | int | `1` | Number of deployment replicas |
| resources | object | `{}` | Container resources |
| securityContext | object | `{}` | Custom container security context |
| service.healthzPort | int | `8080` | Healthz port |
| service.metricsPort | int | `7300` | Metrics port |
| service.type | string | `"ClusterIP"` | K8S service type |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? |
| 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 v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)
31 changes: 31 additions & 0 deletions charts/op-conductor-mon/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
config: |
log_level: info
dry_run: false
metrics:
enabled: true
host: 0.0.0.0
port: {{ .Values.service.metricsPort | default 7300 }}
healthz:
enabled: true
host: 0.0.0.0
port: {{ .Values.service.healthzPort | default 8080 }}
poll_interval: 30s
node_state_expiration: 1h
rpc_timeout: 15s
nodes:
op-conductor:
rpc_address: http://op-conductor:8545
op-conductor-replica:
rpc_address: http://op-conductor-replica:8545
op-conductor-fullnode:
rpc_address: http://op-conductor-fullnode:8545
podAnnotations:
prometheus.io/path: /metrics
prometheus.io/port: "7030"
prometheus.io/scrape: "true"
62 changes: 62 additions & 0 deletions charts/op-conductor-mon/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "op-conductor-mon.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 "op-conductor-mon.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 "op-conductor-mon.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "op-conductor-mon.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "op-conductor-mon.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/op-conductor-mon/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "op-conductor-mon.fullname" . }}
labels:
{{- include "op-conductor-mon.labels" . | nindent 4 }}
data:
config: |
{{- tpl .Values.config . | nindent 4 }}
76 changes: 76 additions & 0 deletions charts/op-conductor-mon/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "op-conductor-mon.fullname" . }}
labels:
{{- include "op-conductor-mon.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "op-conductor-mon.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "op-conductor-mon.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "op-conductor-mon.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
command:
- /bin/bash
- -c
args:
- |
/app/op-conductor-mon /app/op-cpnductor-mon.toml
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: healthz
containerPort: {{ .Values.service.healthzPort | default 8080 }}
protocol: TCP
- name: metrics
containerPort: {{ .Values.service.metricsPort | default 7300 }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /app/op-cpnductor-mon.toml
subPath: config
volumes:
- name: config
configMap:
name: {{ include "op-conductor-mon.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 }}
13 changes: 13 additions & 0 deletions charts/op-conductor-mon/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "op-conductor-mon.serviceAccountName" . }}
labels:
{{- include "op-conductor-mon.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
Loading

0 comments on commit 74bef32

Please sign in to comment.