diff --git a/README.md b/README.md index 35133994..b176bd41 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/charts/op-conductor-mon/.helmignore b/charts/op-conductor-mon/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/op-conductor-mon/.helmignore @@ -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/ diff --git a/charts/op-conductor-mon/Chart.yaml b/charts/op-conductor-mon/Chart.yaml new file mode 100644 index 00000000..fe727a65 --- /dev/null +++ b/charts/op-conductor-mon/Chart.yaml @@ -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: devops@clabs.co + url: https://clabs.co +sources: + - https://github.com/celo-org/op-signer-service diff --git a/charts/op-conductor-mon/README.md b/charts/op-conductor-mon/README.md new file mode 100644 index 00000000..fa5b0ed4 --- /dev/null +++ b/charts/op-conductor-mon/README.md @@ -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 | | | + +## Source Code + +* + +## 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) diff --git a/charts/op-conductor-mon/ci/test-values.yaml b/charts/op-conductor-mon/ci/test-values.yaml new file mode 100644 index 00000000..6411e4d4 --- /dev/null +++ b/charts/op-conductor-mon/ci/test-values.yaml @@ -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" diff --git a/charts/op-conductor-mon/templates/_helpers.tpl b/charts/op-conductor-mon/templates/_helpers.tpl new file mode 100644 index 00000000..67ef90ff --- /dev/null +++ b/charts/op-conductor-mon/templates/_helpers.tpl @@ -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 }} diff --git a/charts/op-conductor-mon/templates/configmap.yaml b/charts/op-conductor-mon/templates/configmap.yaml new file mode 100644 index 00000000..d90ca640 --- /dev/null +++ b/charts/op-conductor-mon/templates/configmap.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/op-conductor-mon/templates/deployment.yaml b/charts/op-conductor-mon/templates/deployment.yaml new file mode 100644 index 00000000..9f6e607f --- /dev/null +++ b/charts/op-conductor-mon/templates/deployment.yaml @@ -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 }} diff --git a/charts/op-conductor-mon/templates/serviceaccount.yaml b/charts/op-conductor-mon/templates/serviceaccount.yaml new file mode 100644 index 00000000..f4b4ff93 --- /dev/null +++ b/charts/op-conductor-mon/templates/serviceaccount.yaml @@ -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 }} diff --git a/charts/op-conductor-mon/values.yaml b/charts/op-conductor-mon/values.yaml new file mode 100644 index 00000000..6b237986 --- /dev/null +++ b/charts/op-conductor-mon/values.yaml @@ -0,0 +1,125 @@ +# Default values for op-conductor-mon. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# -- Chart name override +nameOverride: "" +# -- Chart full name override +fullnameOverride: "" + +# -- Number of deployment replicas +replicaCount: 1 + +image: + # -- Image repository + repository: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-conductor-mon + # -- Image pullpolicy + pullPolicy: IfNotPresent + # -- Image tag + # Overrides the image tag whose default is the chart appVersion. + tag: "main" + +# -- Image pull secrets +imagePullSecrets: [] + +# -- Config as string. Minimal example at https://github.com/ethereum-optimism/optimism/blob/develop/proxyd/example.config.toml +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-0: +# rpc_address: http://op-conductor-0:9545 +# op-conductor-1: +# rpc_address: http://op-conductor-1:9545 +# op-conductor-3: +# rpc_address: http://op-conductor-3:9545 + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Automatically mount a ServiceAccount's API credentials? + automount: true + # -- Annotations to add to the service account + annotations: {} + # -- The name of the service account to use. If not set and create is true, a name is generated using the fullname template + name: "" + +service: + # -- K8S service type + type: ClusterIP + # -- Metrics port + metricsPort: 7300 + # -- Healthz port + healthzPort: 8080 + +# -- Custom pod annotations +podAnnotations: {} + # prometheus.io/path: /metrics + # prometheus.io/port: "7300" + # prometheus.io/scrape: "true" + +# -- Custom pod labels +podLabels: {} + +# -- Custom pod security context +podSecurityContext: {} + # fsGroup: 2000 + +# -- Custom container security context +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# -- Container resources +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# -- Liveness probe configuration +livenessProbe: + httpGet: + path: /healthz + port: healthz + +# -- Readiness probe configuration +readinessProbe: + httpGet: + path: /healthz + port: healthz + +# -- Kubernetes node selector +nodeSelector: {} + +# -- Kubernetes tolerations +tolerations: [] + +# -- Kubernetes pod affinity +affinity: {}