From 6e4f5c4ffe3b177d3464ed8852e2abb5056c541b Mon Sep 17 00:00:00 2001 From: harshsingh1002 <1002.harshsingh@gmail.com> Date: Fri, 27 Jun 2025 01:14:21 +0530 Subject: [PATCH] feat: add dashboard service helm chart --- .../charts/mev-commit-dashboard/Chart.yaml | 6 ++ .../templates/_helpers.tpl | 46 +++++++++++++++ .../templates/configmap.yaml | 22 +++++++ .../templates/deployment.yaml | 49 +++++++++++++++ .../templates/service.yaml | 24 ++++++++ .../charts/mev-commit-dashboard/values.yaml | 59 +++++++++++++++++++ 6 files changed, 206 insertions(+) create mode 100644 infrastructure/charts/mev-commit-dashboard/Chart.yaml create mode 100644 infrastructure/charts/mev-commit-dashboard/templates/_helpers.tpl create mode 100644 infrastructure/charts/mev-commit-dashboard/templates/configmap.yaml create mode 100644 infrastructure/charts/mev-commit-dashboard/templates/deployment.yaml create mode 100644 infrastructure/charts/mev-commit-dashboard/templates/service.yaml create mode 100644 infrastructure/charts/mev-commit-dashboard/values.yaml diff --git a/infrastructure/charts/mev-commit-dashboard/Chart.yaml b/infrastructure/charts/mev-commit-dashboard/Chart.yaml new file mode 100644 index 000000000..35f4906c7 --- /dev/null +++ b/infrastructure/charts/mev-commit-dashboard/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: mev-commit-dashboard +description: A Helm chart for deploying mev-commit-dashboard service +type: application +version: 0.1.0 +appVersion: "1.0.0" diff --git a/infrastructure/charts/mev-commit-dashboard/templates/_helpers.tpl b/infrastructure/charts/mev-commit-dashboard/templates/_helpers.tpl new file mode 100644 index 000000000..2114ba0a0 --- /dev/null +++ b/infrastructure/charts/mev-commit-dashboard/templates/_helpers.tpl @@ -0,0 +1,46 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "mev-commit-dashboard.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +*/}} +{{- define "mev-commit-dashboard.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "mev-commit-dashboard.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "mev-commit-dashboard.labels" -}} +helm.sh/chart: {{ include "mev-commit-dashboard.chart" . }} +{{ include "mev-commit-dashboard.selectorLabels" . }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- if .Values.commonLabels }} +{{ toYaml .Values.commonLabels }} +{{- end }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "mev-commit-dashboard.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mev-commit-dashboard.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app: {{ include "mev-commit-dashboard.name" . }} +{{- end }} diff --git a/infrastructure/charts/mev-commit-dashboard/templates/configmap.yaml b/infrastructure/charts/mev-commit-dashboard/templates/configmap.yaml new file mode 100644 index 000000000..0250ad3ac --- /dev/null +++ b/infrastructure/charts/mev-commit-dashboard/templates/configmap.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mev-commit-dashboard.fullname" . }}-config + namespace: {{ .Values.namespace | default "default" }} + labels: + {{- include "mev-commit-dashboard.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +data: + DASHBOARD_RPC_URL: {{ .Values.config.rpcUrl | quote }} + DASHBOARD_HTTP_PORT: {{ .Values.config.httpPort | quote }} + DASHBOARD_START_BLOCK: {{ .Values.config.startBlock | quote }} + DASHBOARD_LOG_FMT: {{ .Values.config.logFormat | quote }} + DASHBOARD_LOG_LEVEL: {{ .Values.config.logLevel | quote }} + DASHBOARD_ORACLE_CONTRACT_ADDR: {{ .Values.config.oracleContractAddr | quote }} + DASHBOARD_PRECONF_CONTRACT_ADDR: {{ .Values.config.preconfContractAddr | quote }} + DASHBOARD_BLOCKTRACKER_CONTRACT_ADDR: {{ .Values.config.blocktrackerContractAddr | quote }} + DASHBOARD_BIDDERREGISTRY_CONTRACT_ADDR: {{ .Values.config.bidderregistryContractAddr | quote }} + DASHBOARD_PROVIDERREGISTRY_CONTRACT_ADDR: {{ .Values.config.providerregistryContractAddr | quote }} diff --git a/infrastructure/charts/mev-commit-dashboard/templates/deployment.yaml b/infrastructure/charts/mev-commit-dashboard/templates/deployment.yaml new file mode 100644 index 000000000..49fe9b662 --- /dev/null +++ b/infrastructure/charts/mev-commit-dashboard/templates/deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mev-commit-dashboard.fullname" . }} + namespace: {{ .Values.namespace | default "default" }} + labels: + {{- include "mev-commit-dashboard.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "mev-commit-dashboard.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "mev-commit-dashboard.selectorLabels" . | nindent 8 }} + {{- with .Values.commonLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: dashboard + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.service.port }} + name: http + envFrom: + - configMapRef: + name: {{ include "mev-commit-dashboard.fullname" . }}-config + resources: + requests: + cpu: {{ .Values.resources.requests.cpu | default "100m" }} + memory: {{ .Values.resources.requests.memory | default "128Mi" }} + limits: + cpu: {{ .Values.resources.limits.cpu | default "500m" }} + memory: {{ .Values.resources.limits.memory | default "512Mi" }} diff --git a/infrastructure/charts/mev-commit-dashboard/templates/service.yaml b/infrastructure/charts/mev-commit-dashboard/templates/service.yaml new file mode 100644 index 000000000..e6b5c66cb --- /dev/null +++ b/infrastructure/charts/mev-commit-dashboard/templates/service.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mev-commit-dashboard.fullname" . }} + namespace: {{ .Values.namespace | default "default" }} + labels: + {{- include "mev-commit-dashboard.labels" . | nindent 4 }} + {{- with .Values.commonAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.targetPort }} + protocol: TCP + name: http + selector: + {{- if .Values.service.customSelectors }} + {{- toYaml .Values.service.customSelectors | nindent 4 }} + {{- else }} + {{- include "mev-commit-dashboard.selectorLabels" . | nindent 4 }} + {{- end }} diff --git a/infrastructure/charts/mev-commit-dashboard/values.yaml b/infrastructure/charts/mev-commit-dashboard/values.yaml new file mode 100644 index 000000000..f56fd40c3 --- /dev/null +++ b/infrastructure/charts/mev-commit-dashboard/values.yaml @@ -0,0 +1,59 @@ +replicaCount: 1 + +image: + repository: + tag: + pullPolicy: Always + +nameOverride: "" +fullnameOverride: "" + +# Namespace to deploy resources +namespace: mev-commit-observability + +# Common labels to apply to all resources +commonLabels: {} + # team: blockchain + # environment: production + +# Common annotations to apply to all resources +commonAnnotations: {} + # prometheus.io/scrape: "true" + # prometheus.io/port: "8080" + +# Node selector for pod assignment +nodeSelector: {} + # disktype: ssd + # kubernetes.io/os: linux + +# Service configuration +service: + type: ClusterIP + port: 8080 + targetPort: 8080 + # Custom selectors for the service (if empty, uses the default selector labels) + customSelectors: {} + # app: mev-commit-dashboard + # tier: frontend + +# resource configuration +resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + +# Configuration for the Dashboard +config: + rpcUrl: "ws://:8546" + httpPort: "8080" + startBlock: "0" + logFormat: "json" + logLevel: "info" + bidderregistryContractAddr: "" + blocktrackerContractAddr: "" + oracleContractAddr: "" + preconfContractAddr: "" + providerregistryContractAddr: ""