From c10658c64e3da52d0059dc356e32bce096458972 Mon Sep 17 00:00:00 2001 From: "s. rannou" Date: Wed, 21 Aug 2024 18:50:21 +0200 Subject: [PATCH 1/4] feat: add draft of k8s support --- k8s/commit-boost/.helmignore | 23 ++++ k8s/commit-boost/Chart.yaml | 9 ++ k8s/commit-boost/README.md | 55 +++++++++ k8s/commit-boost/config.toml | 10 ++ k8s/commit-boost/notes.org | 3 + k8s/commit-boost/templates/NOTES.txt | 22 ++++ k8s/commit-boost/templates/_helpers.tpl | 62 ++++++++++ k8s/commit-boost/templates/configmap.yaml | 13 ++ k8s/commit-boost/templates/deployment.yaml | 96 +++++++++++++++ k8s/commit-boost/templates/hpa.yaml | 32 +++++ k8s/commit-boost/templates/ingress.yaml | 61 ++++++++++ k8s/commit-boost/templates/service.yaml | 15 +++ .../templates/serviceaccount.yaml | 13 ++ .../templates/tests/test-connection.yaml | 15 +++ k8s/commit-boost/values.yaml | 112 ++++++++++++++++++ 15 files changed, 541 insertions(+) create mode 100644 k8s/commit-boost/.helmignore create mode 100644 k8s/commit-boost/Chart.yaml create mode 100644 k8s/commit-boost/README.md create mode 100644 k8s/commit-boost/config.toml create mode 100644 k8s/commit-boost/notes.org create mode 100644 k8s/commit-boost/templates/NOTES.txt create mode 100644 k8s/commit-boost/templates/_helpers.tpl create mode 100644 k8s/commit-boost/templates/configmap.yaml create mode 100644 k8s/commit-boost/templates/deployment.yaml create mode 100644 k8s/commit-boost/templates/hpa.yaml create mode 100644 k8s/commit-boost/templates/ingress.yaml create mode 100644 k8s/commit-boost/templates/service.yaml create mode 100644 k8s/commit-boost/templates/serviceaccount.yaml create mode 100644 k8s/commit-boost/templates/tests/test-connection.yaml create mode 100644 k8s/commit-boost/values.yaml diff --git a/k8s/commit-boost/.helmignore b/k8s/commit-boost/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/k8s/commit-boost/.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/k8s/commit-boost/Chart.yaml b/k8s/commit-boost/Chart.yaml new file mode 100644 index 00000000..49c40926 --- /dev/null +++ b/k8s/commit-boost/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: commit-boost +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: "v0.1.0-beta0" +maintainers: + - name: mxs + email: mxs@kiln.fi diff --git a/k8s/commit-boost/README.md b/k8s/commit-boost/README.md new file mode 100644 index 00000000..c1823dad --- /dev/null +++ b/k8s/commit-boost/README.md @@ -0,0 +1,55 @@ +# commit-boost + +![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: v0.1.0-beta0](https://img.shields.io/badge/AppVersion-v0.1.0--beta0-informational?style=flat-square) + +A Helm chart for Kubernetes + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| mxs | | | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| commitBoost.pbs.config | string | `"chain = \"Holesky\"\n\n[pbs]\nport = 18550\n\n[[relays]]\nurl = \"https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net\"\n\n[metrics]\nprometheus_config = \"/config/prometheus.yaml\""` | | +| commitBoost.pbs.enable | bool | `true` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"ghcr.io/kilnfi/commit-boost-pbs"` | | +| image.tag | string | `"677e8"` | | +| imagePullSecrets | list | `[]` | | +| ingress.annotations | object | `{}` | | +| ingress.className | string | `""` | | +| ingress.enabled | bool | `false` | | +| ingress.hosts[0].host | string | `"chart-example.local"` | | +| ingress.hosts[0].paths[0].path | string | `"/"` | | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | +| ingress.tls | list | `[]` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podLabels | object | `{}` | | +| podSecurityContext | object | `{}` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| securityContext | object | `{}` | | +| service.port | int | `18550` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.automount | bool | `true` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | +| volumeMounts | list | `[]` | | +| volumes | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/k8s/commit-boost/config.toml b/k8s/commit-boost/config.toml new file mode 100644 index 00000000..c6cfd3bc --- /dev/null +++ b/k8s/commit-boost/config.toml @@ -0,0 +1,10 @@ +chain = "Holesky" + +[pbs] +port = 18550 + +[[relays]] +url = "" + +[metrics] +prometheus_config = "./docker/prometheus.yml" diff --git a/k8s/commit-boost/notes.org b/k8s/commit-boost/notes.org new file mode 100644 index 00000000..f4d22226 --- /dev/null +++ b/k8s/commit-boost/notes.org @@ -0,0 +1,3 @@ +* commit-boost config requires prometheus stuff +* rolling duration for logs needs to be set to never +* metrics server? diff --git a/k8s/commit-boost/templates/NOTES.txt b/k8s/commit-boost/templates/NOTES.txt new file mode 100644 index 00000000..c4fb9926 --- /dev/null +++ b/k8s/commit-boost/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "commit-boost.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 "commit-boost.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "commit-boost.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "commit-boost.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 +{{- end }} diff --git a/k8s/commit-boost/templates/_helpers.tpl b/k8s/commit-boost/templates/_helpers.tpl new file mode 100644 index 00000000..a284eb12 --- /dev/null +++ b/k8s/commit-boost/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "commit-boost.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 "commit-boost.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 "commit-boost.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "commit-boost.labels" -}} +helm.sh/chart: {{ include "commit-boost.chart" . }} +{{ include "commit-boost.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "commit-boost.selectorLabels" -}} +app.kubernetes.io/name: {{ include "commit-boost.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "commit-boost.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "commit-boost.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/k8s/commit-boost/templates/configmap.yaml b/k8s/commit-boost/templates/configmap.yaml new file mode 100644 index 00000000..42b1b1fe --- /dev/null +++ b/k8s/commit-boost/templates/configmap.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "commit-boost.fullname" . }} + labels: + {{- include "commit-boost.labels" . | nindent 4 }} +data: + {{- if .Values.commitBoost.pbs.enable }} + config.pbs.toml: |- + {{ .Values.commitBoost.pbs.config | nindent 4 }} + {{- end }} + + prometheus.yaml: "" diff --git a/k8s/commit-boost/templates/deployment.yaml b/k8s/commit-boost/templates/deployment.yaml new file mode 100644 index 00000000..9c82b769 --- /dev/null +++ b/k8s/commit-boost/templates/deployment.yaml @@ -0,0 +1,96 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "commit-boost.fullname" . }} + labels: + {{- include "commit-boost.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "commit-boost.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "commit-boost.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "commit-boost.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + {{- if .Values.commitBoost.pbs.enable }} + - name: {{ .Chart.Name }}-pbs + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + - name: CB_CONFIG + value: /config/config.pbs.toml + - name: ROLLING_DURATION + value: never + - name: METRICS_SERVER + value: '1000' + - name: RUST_LOG + value: info + volumeMounts: + - name: commit-boost-configs + mountPath: /config + {{- with .Values.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} + volumes: + - name: commit-boost-configs + configMap: + defaultMode: 0755 + name: {{ include "commit-boost.fullname" . }} + items: + - key: prometheus.yaml + path: prometheus.yaml + {{- if .Values.commitBoost.pbs.enable }} + - key: config.pbs.toml + path: config.pbs.toml + {{- end }} + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- 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/k8s/commit-boost/templates/hpa.yaml b/k8s/commit-boost/templates/hpa.yaml new file mode 100644 index 00000000..3b6399b1 --- /dev/null +++ b/k8s/commit-boost/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "commit-boost.fullname" . }} + labels: + {{- include "commit-boost.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "commit-boost.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/k8s/commit-boost/templates/ingress.yaml b/k8s/commit-boost/templates/ingress.yaml new file mode 100644 index 00000000..2874a257 --- /dev/null +++ b/k8s/commit-boost/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "commit-boost.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "commit-boost.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/k8s/commit-boost/templates/service.yaml b/k8s/commit-boost/templates/service.yaml new file mode 100644 index 00000000..8aa258da --- /dev/null +++ b/k8s/commit-boost/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "commit-boost.fullname" . }} + labels: + {{- include "commit-boost.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "commit-boost.selectorLabels" . | nindent 4 }} diff --git a/k8s/commit-boost/templates/serviceaccount.yaml b/k8s/commit-boost/templates/serviceaccount.yaml new file mode 100644 index 00000000..cf8633f0 --- /dev/null +++ b/k8s/commit-boost/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "commit-boost.serviceAccountName" . }} + labels: + {{- include "commit-boost.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/k8s/commit-boost/templates/tests/test-connection.yaml b/k8s/commit-boost/templates/tests/test-connection.yaml new file mode 100644 index 00000000..993ccf53 --- /dev/null +++ b/k8s/commit-boost/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "commit-boost.fullname" . }}-test-connection" + labels: + {{- include "commit-boost.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "commit-boost.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/k8s/commit-boost/values.yaml b/k8s/commit-boost/values.yaml new file mode 100644 index 00000000..37ac9c0b --- /dev/null +++ b/k8s/commit-boost/values.yaml @@ -0,0 +1,112 @@ +# Default values for commit-boost. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: ghcr.io/kilnfi/commit-boost-pbs + pullPolicy: IfNotPresent + tag: "677e8" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +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: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 18550 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +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 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +commitBoost: + pbs: + enable: true + config: |- + chain = "Holesky" + + [pbs] + port = 18550 + + [[relays]] + url = "https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net" + + [metrics] + prometheus_config = "/config/prometheus.yaml" From 5ec07c96a3b75bf576eda7eec1385bf0ef6c6e02 Mon Sep 17 00:00:00 2001 From: "s. rannou" Date: Wed, 21 Aug 2024 18:53:07 +0200 Subject: [PATCH 2/4] nit: remove non-needed file --- k8s/commit-boost/config.toml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 k8s/commit-boost/config.toml diff --git a/k8s/commit-boost/config.toml b/k8s/commit-boost/config.toml deleted file mode 100644 index c6cfd3bc..00000000 --- a/k8s/commit-boost/config.toml +++ /dev/null @@ -1,10 +0,0 @@ -chain = "Holesky" - -[pbs] -port = 18550 - -[[relays]] -url = "" - -[metrics] -prometheus_config = "./docker/prometheus.yml" From dc97ea717f4822d0b4a4cb4900be29f23f25a7a1 Mon Sep 17 00:00:00 2001 From: "s. rannou" Date: Thu, 22 Aug 2024 22:15:18 +0200 Subject: [PATCH 3/4] fix: exposed port to actually match target --- k8s/commit-boost/Chart.yaml | 4 ++-- k8s/commit-boost/README.md | 5 +++-- k8s/commit-boost/templates/deployment.yaml | 15 +++++++++------ k8s/commit-boost/templates/service.yaml | 8 ++++++-- k8s/commit-boost/values.yaml | 3 ++- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/k8s/commit-boost/Chart.yaml b/k8s/commit-boost/Chart.yaml index 49c40926..ce94367f 100644 --- a/k8s/commit-boost/Chart.yaml +++ b/k8s/commit-boost/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: commit-boost description: A Helm chart for Kubernetes type: application -version: 0.1.0 -appVersion: "v0.1.0-beta0" +version: 0.0.1 +appVersion: "v0.0.1-beta0" maintainers: - name: mxs email: mxs@kiln.fi diff --git a/k8s/commit-boost/README.md b/k8s/commit-boost/README.md index c1823dad..dfbf24aa 100644 --- a/k8s/commit-boost/README.md +++ b/k8s/commit-boost/README.md @@ -1,6 +1,6 @@ # commit-boost -![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: v0.1.0-beta0](https://img.shields.io/badge/AppVersion-v0.1.0--beta0-informational?style=flat-square) +![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: v0.0.1-beta0](https://img.shields.io/badge/AppVersion-v0.0.1--beta0-informational?style=flat-square) A Helm chart for Kubernetes @@ -24,7 +24,7 @@ A Helm chart for Kubernetes | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | | image.repository | string | `"ghcr.io/kilnfi/commit-boost-pbs"` | | -| image.tag | string | `"677e8"` | | +| image.tag | string | `"55cdb"` | | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | @@ -41,6 +41,7 @@ A Helm chart for Kubernetes | replicaCount | int | `1` | | | resources | object | `{}` | | | securityContext | object | `{}` | | +| service.metrics_port | int | `10000` | | | service.port | int | `18550` | | | service.type | string | `"ClusterIP"` | | | serviceAccount.annotations | object | `{}` | | diff --git a/k8s/commit-boost/templates/deployment.yaml b/k8s/commit-boost/templates/deployment.yaml index 9c82b769..eb2b1e5b 100644 --- a/k8s/commit-boost/templates/deployment.yaml +++ b/k8s/commit-boost/templates/deployment.yaml @@ -38,17 +38,20 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - - name: http + - name: http-pbs containerPort: {{ .Values.service.port }} protocol: TCP + - name: http-metrics + containerPort: {{ .Values.service.metrics_port }} + protocol: TCP livenessProbe: httpGet: - path: / - port: http + path: /status + port: http-metrics readinessProbe: httpGet: - path: / - port: http + path: /status + port: http-metrics resources: {{- toYaml .Values.resources | nindent 12 }} env: @@ -57,7 +60,7 @@ spec: - name: ROLLING_DURATION value: never - name: METRICS_SERVER - value: '1000' + value: '{{ .Values.service.metrics_port }}' - name: RUST_LOG value: info volumeMounts: diff --git a/k8s/commit-boost/templates/service.yaml b/k8s/commit-boost/templates/service.yaml index 8aa258da..b00de6b5 100644 --- a/k8s/commit-boost/templates/service.yaml +++ b/k8s/commit-boost/templates/service.yaml @@ -8,8 +8,12 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: http + name: http-pbs + targetPort: http-pbs protocol: TCP - name: http + - port: {{ .Values.service.metrics_port }} + protocol: TCP + name: http-metrics + targetPort: http-metrics selector: {{- include "commit-boost.selectorLabels" . | nindent 4 }} diff --git a/k8s/commit-boost/values.yaml b/k8s/commit-boost/values.yaml index 37ac9c0b..93e017db 100644 --- a/k8s/commit-boost/values.yaml +++ b/k8s/commit-boost/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: ghcr.io/kilnfi/commit-boost-pbs pullPolicy: IfNotPresent - tag: "677e8" + tag: "55cdb" imagePullSecrets: [] nameOverride: "" @@ -41,6 +41,7 @@ securityContext: {} service: type: ClusterIP port: 18550 + metrics_port: 10000 ingress: enabled: false From 75ad01956b3bd3e72f545aecba2145cf21065ded Mon Sep 17 00:00:00 2001 From: "s. rannou" Date: Fri, 23 Aug 2024 09:51:34 +0200 Subject: [PATCH 4/4] feat: switch to official ghcr repo --- k8s/commit-boost/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/commit-boost/values.yaml b/k8s/commit-boost/values.yaml index 93e017db..eb332cc9 100644 --- a/k8s/commit-boost/values.yaml +++ b/k8s/commit-boost/values.yaml @@ -5,9 +5,9 @@ replicaCount: 1 image: - repository: ghcr.io/kilnfi/commit-boost-pbs + repository: ghcr.io/commit-boost/commit-boost-client/pbs:0c12f37 pullPolicy: IfNotPresent - tag: "55cdb" + tag: "0c12f37" imagePullSecrets: [] nameOverride: ""