From 751e3c182b95c8e11d8297dbc8f3f8201dbef1b2 Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:51:55 -0500 Subject: [PATCH 1/4] Add role label to nodes in chart --- .../templates/chainlink-node-deployment.yaml | 4 ++++ charts/chainlink-cluster/values.yaml | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml b/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml index 16156ef4ffc..5e38a6e0d3f 100644 --- a/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml +++ b/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml @@ -18,6 +18,10 @@ spec: app: {{ $.Release.Name }} instance: {{ $cfg.name }} release: {{ $.Release.Name }} + # Role value should either be: botostrap or node. + # There should only be one "bootstrap" node, the rest should be "node". + # This is used for testing. + role: {{ $cfg.role }} {{- range $key, $value := $.Values.labels }} {{ $key }}: {{ $value | quote }} {{- end }} diff --git a/charts/chainlink-cluster/values.yaml b/charts/chainlink-cluster/values.yaml index 9394bda1213..20c520bd922 100644 --- a/charts/chainlink-cluster/values.yaml +++ b/charts/chainlink-cluster/values.yaml @@ -24,6 +24,7 @@ chainlink: p2p_port: 6690 nodes: - name: node-1 + role: bootstrap image: "public.ecr.aws/chainlink/chainlink:latest" # default resources are 300m/1Gi # first node need more resources to build faster inside container @@ -68,10 +69,15 @@ chainlink: # or use overridesToml to override some part of configuration # overridesToml: | - name: node-2 + role: node - name: node-3 + role: node - name: node-4 + role: node - name: node-5 + role: node - name: node-6 + role: node resources: requests: cpu: 350m @@ -276,7 +282,7 @@ ingress: port: number: 1080 # monitoring.coreos.com/v1 PodMonitor for each node -prometheusMonitor: true +prometheusMonitor: false # deployment placement, standard helm stuff podAnnotations: From 84346afdbdfedc4edc444642e2da45ee37a6b868 Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:55:10 -0500 Subject: [PATCH 2/4] Change back var --- charts/chainlink-cluster/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/chainlink-cluster/values.yaml b/charts/chainlink-cluster/values.yaml index 20c520bd922..0b20974b21b 100644 --- a/charts/chainlink-cluster/values.yaml +++ b/charts/chainlink-cluster/values.yaml @@ -282,7 +282,7 @@ ingress: port: number: 1080 # monitoring.coreos.com/v1 PodMonitor for each node -prometheusMonitor: false +prometheusMonitor: true # deployment placement, standard helm stuff podAnnotations: From ebe4ace425eba9fca7dac4bbcfff386686f2763f Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:55:53 -0500 Subject: [PATCH 3/4] Fix typo --- .../chainlink-cluster/templates/chainlink-node-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml b/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml index 5e38a6e0d3f..c3e030c7507 100644 --- a/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml +++ b/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml @@ -18,7 +18,7 @@ spec: app: {{ $.Release.Name }} instance: {{ $cfg.name }} release: {{ $.Release.Name }} - # Role value should either be: botostrap or node. + # Role value should either be: bootstrap or node. # There should only be one "bootstrap" node, the rest should be "node". # This is used for testing. role: {{ $cfg.role }} From c2b403b9cff7dfffed1d4959f3770c800915df0b Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:46:20 -0500 Subject: [PATCH 4/4] Implicitly make the first node the bootstrap node to avoid new values --- .../templates/chainlink-node-deployment.yaml | 8 ++++---- charts/chainlink-cluster/values.yaml | 6 ------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml b/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml index c3e030c7507..884cf0e535b 100644 --- a/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml +++ b/charts/chainlink-cluster/templates/chainlink-node-deployment.yaml @@ -1,4 +1,4 @@ -{{- range $cfg := .Values.chainlink.nodes }} +{{- range $index, $cfg := .Values.chainlink.nodes }} apiVersion: apps/v1 kind: Deployment metadata: @@ -18,10 +18,10 @@ spec: app: {{ $.Release.Name }} instance: {{ $cfg.name }} release: {{ $.Release.Name }} - # Role value should either be: bootstrap or node. + # Used for testing. Role value should either be: bootstrap or node. # There should only be one "bootstrap" node, the rest should be "node". - # This is used for testing. - role: {{ $cfg.role }} + # Here we set the first node to be bootstrap, the rest to be node. + role: {{ if eq $index 0 }}bootstrap{{ else }}node{{ end }} {{- range $key, $value := $.Values.labels }} {{ $key }}: {{ $value | quote }} {{- end }} diff --git a/charts/chainlink-cluster/values.yaml b/charts/chainlink-cluster/values.yaml index 0b20974b21b..9394bda1213 100644 --- a/charts/chainlink-cluster/values.yaml +++ b/charts/chainlink-cluster/values.yaml @@ -24,7 +24,6 @@ chainlink: p2p_port: 6690 nodes: - name: node-1 - role: bootstrap image: "public.ecr.aws/chainlink/chainlink:latest" # default resources are 300m/1Gi # first node need more resources to build faster inside container @@ -69,15 +68,10 @@ chainlink: # or use overridesToml to override some part of configuration # overridesToml: | - name: node-2 - role: node - name: node-3 - role: node - name: node-4 - role: node - name: node-5 - role: node - name: node-6 - role: node resources: requests: cpu: 350m