From 307204d37879958308df2f2ffacc558fa5f2cc9f Mon Sep 17 00:00:00 2001 From: Pierre Besson Date: Tue, 23 Jan 2024 15:06:05 +0100 Subject: [PATCH] Add genereric command/params for bridge-relay (#326) * switch to generic params list for bridge-relay configuration * fix CI values for bridge-relay --- charts/bridges-common-relay/Chart.yaml | 2 +- charts/bridges-common-relay/README.md | 12 ++----- .../bridges-common-relay/ci/kind-values.yaml | 9 +++-- .../templates/deployment.yaml | 21 ++--------- charts/bridges-common-relay/values.yaml | 35 ++----------------- 5 files changed, 14 insertions(+), 65 deletions(-) diff --git a/charts/bridges-common-relay/Chart.yaml b/charts/bridges-common-relay/Chart.yaml index 16dc640a..38072eba 100644 --- a/charts/bridges-common-relay/Chart.yaml +++ b/charts/bridges-common-relay/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: bridges-common-relay description: A Helm chart for bridges-common-relay type: application -version: 0.2.5 +version: 1.0.0 maintainers: - name: Parity url: https://github.com/paritytech/helm-charts diff --git a/charts/bridges-common-relay/README.md b/charts/bridges-common-relay/README.md index dc5beb73..f1b78418 100644 --- a/charts/bridges-common-relay/README.md +++ b/charts/bridges-common-relay/README.md @@ -18,7 +18,7 @@ This is intended behaviour. Make sure to run `git add -A` once again to stage ch # Parity Bridges Common helm chart -![Version: 0.2.5](https://img.shields.io/badge/Version-0.2.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) This helm chart installs [Parity Bridges Common](https://github.com/paritytech/parity-bridges-common) relayer. @@ -51,20 +51,12 @@ helm install bridges-common-relay parity/bridges-common-relay | imagePullSecrets | list | `[]` | Reference to one or more secrets to be used when pulling images. ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ | | nameOverride | string | `""` | Provide a name in place of node for `app:` labels | | nodeSelector | object | `{}` | Define which Nodes the Pods are scheduled on | +| params | list | `[]` | | | podAnnotations | object | `{}` | Annotations to add to the Pod | | podSecurityContext | object | `{}` | SecurityContext holds pod-level security attributes and common container settings. ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ | | prometheus | object | `{"enabled":false,"port":9615}` | Expose metrics via Prometheus format in /metrics endpoint. | | prometheus.enabled | bool | `false` | Expose Prometheus metrics | | prometheus.port | int | `9615` | The port for exposed Prometheus metrics | -| relayHeaders.enabled | bool | `false` | | -| relayHeaders.name | string | `"kusama-to-bridge-hub-polkadot"` | | -| relayHeaders.params.source-host | string | `"ws://rpc.example"` | | -| relayHeaders.params.source-port | int | `9955` | | -| relayHeaders.params.target-host | string | `"ws://rpc.example"` | | -| relayHeaders.params.target-port | int | `9944` | | -| relayHeadersAndMessages.enabled | bool | `false` | | -| relayHeadersAndMessages.name | string | `"bridge-hub-rococo-bridge-hub-wococo"` | | -| relayHeadersAndMessages.params | object | `{}` | | | replicaCount | int | `1` | | | resources | object | `{}` | Resource limits & requests | | secrets | object | `{}` | Secrets will be mounted to pod /secrets/{key} | diff --git a/charts/bridges-common-relay/ci/kind-values.yaml b/charts/bridges-common-relay/ci/kind-values.yaml index 319c3f76..650db681 100644 --- a/charts/bridges-common-relay/ci/kind-values.yaml +++ b/charts/bridges-common-relay/ci/kind-values.yaml @@ -1,2 +1,7 @@ -relayHeaders: - enabled: true +params: + - relay-headers + - kusama-to-bridge-hub-polkadot + - --source-host=ws://rpc.example + - --source-port=9955 + - --target-host=ws://rpc.example + - --target-port=9944 diff --git a/charts/bridges-common-relay/templates/deployment.yaml b/charts/bridges-common-relay/templates/deployment.yaml index 7093c445..ac2ac975 100644 --- a/charts/bridges-common-relay/templates/deployment.yaml +++ b/charts/bridges-common-relay/templates/deployment.yaml @@ -33,25 +33,8 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} args: - {{- if .Values.relayHeaders.enabled }} - - "relay-headers" - - "{{ .Values.relayHeaders.name }}" - {{- range $key, $value := .Values.relayHeaders.params }} - - "--{{ $key }} {{ $value }}" - {{- end }} - {{- end }} - {{- if .Values.relayHeadersAndMessages.enabled }} - - "relay-headers-and-messages" - - "{{ .Values.relayHeadersAndMessages.name }}" - {{- range $key, $value := .Values.relayHeadersAndMessages.params }} - {{- if kindIs "slice" $value }} - {{- range $param := $value }} - - "--{{ $key }} {{ $param }}" - {{- end }} - {{- else }} - - "--{{ $key }} {{ $value }}" - {{- end }} - {{- end }} + {{- range $param := .Values.params }} + - {{ $param | quote }} {{- end }} {{- if .Values.prometheus.enabled }} - "--prometheus-host 0.0.0.0" diff --git a/charts/bridges-common-relay/values.yaml b/charts/bridges-common-relay/values.yaml index 19af5f56..59e26fb5 100644 --- a/charts/bridges-common-relay/values.yaml +++ b/charts/bridges-common-relay/values.yaml @@ -30,39 +30,8 @@ serviceAccount: # -- Service Account name name: "" -relayHeaders: - enabled: false - name: kusama-to-bridge-hub-polkadot - params: - source-host: ws://rpc.example - source-port: 9955 - target-host: ws://rpc.example - target-port: 9944 - # target-signer: //Bob - # or - # target-signer-file: /path/to/bob/seed - -relayHeadersAndMessages: - enabled: false - name: bridge-hub-rococo-bridge-hub-wococo - params: {} - # rococo-host: localhost - # rococo-port: 9942 - # bridge-hub-rococo-host: localhost - # bridge-hub-rococo-port: 8943 - # bridge-hub-rococo-signer: //Charlie - # wococo-headers-to-bridge-hub-rococo-signer: //Bob - # wococo-parachains-to-bridge-hub-rococo-signer: //Bob - # bridge-hub-rococo-transactions-mortality: 4 - # wococo-host: localhost - # wococo-port: 9945 - # bridge-hub-wococo-host: localhost - # bridge-hub-wococo-port: 8945 - # bridge-hub-wococo-signer-file: /secrets/bridge-hub-wococo-signer-file - # rococo-headers-to-bridge-hub-wococo-signer: //Bob - # rococo-parachains-to-bridge-hub-wococo-signer: //Bob - # bridge-hub-wococo-transactions-mortality: 4 - # lane: ["00000001", "00000002"] +params: [] + # -- Secrets will be mounted to pod /secrets/{key} secrets: {}