Skip to content

Commit

Permalink
Make helm chart features optional: node, db, geth (#12830)
Browse files Browse the repository at this point in the history
  • Loading branch information
chainchad authored Apr 15, 2024
1 parent e9ea7c8 commit fe8fac7
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 18 deletions.
2 changes: 2 additions & 0 deletions charts/chainlink-cluster/templates/chainlink-cm.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.chainlink.enabled }}
{{- range $cfg := .Values.chainlink.nodes }}
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -69,3 +70,4 @@ data:
{{ end }}
---
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.db.enabled }}
{{- range $cfg := .Values.chainlink.nodes }}
apiVersion: apps/v1
{{ if $.Values.db.stateful }}
Expand Down Expand Up @@ -150,3 +151,4 @@ spec:
{{- end }}
---
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
{{- if and .Values.db.enabled .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -18,4 +18,4 @@ spec:
ports:
- protocol: TCP
port: 5432
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/chainlink-cluster/templates/chainlink-db-service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.db.enabled }}
{{- range $cfg := .Values.chainlink.nodes }}
apiVersion: v1
kind: Service
Expand All @@ -13,4 +14,5 @@ spec:
port: 5432
targetPort: 5432
---
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.chainlink.enabled }}
{{- range $index, $cfg := .Values.chainlink.nodes }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -126,3 +127,4 @@ spec:
{{- end }}
---
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
{{- if and .Values.chainlink.enabled .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -15,4 +15,4 @@ spec:
- podSelector:
matchLabels:
app: {{ $.Release.Name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.chainlink.enabled }}
{{- range $cfg := .Values.chainlink.nodes }}
apiVersion: v1
kind: Service
Expand All @@ -15,4 +16,5 @@ spec:
instance: {{ $cfg.name }}
type: ClusterIP
---
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if $.Values.prometheusMonitor }}
{{- if and .Values.chainlink.enabled .Values.prometheusMonitor }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
Expand Down
4 changes: 3 additions & 1 deletion charts/chainlink-cluster/templates/chainlink-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.chainlink.enabled }}
{{- range $cfg := .Values.chainlink.nodes }}
apiVersion: v1
kind: Secret
Expand All @@ -9,4 +10,5 @@ data:
apicredentials: bm90cmVhbEBmYWtlZW1haWwuY2hudHdvY2hhaW5zCg==
node-password: VC50TEhrY213ZVBUL3AsXXNZdW50andIS0FzcmhtIzRlUnM0THVLSHd2SGVqV1lBQzJKUDRNOEhpbXdnbWJhWgo=
---
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/chainlink-cluster/templates/geth-config-map.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if (hasKey .Values "geth") }}
{{ if and (hasKey .Values "geth") .Values.geth.enabled }}
{{- range $cfg := .Values.geth.chains }}
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -152,4 +152,4 @@ data:
}
---
{{- end }}
{{ end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/chainlink-cluster/templates/geth-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if (hasKey .Values "geth") }}
{{ if and (hasKey .Values "geth") .Values.geth.enabled }}
{{- range $cfg := .Values.geth.chains }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -127,4 +127,4 @@ spec:
{{- end }}
---
{{- end }}
{{ end }}
{{- end }}
4 changes: 3 additions & 1 deletion charts/chainlink-cluster/templates/geth-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if and (hasKey .Values "geth") .Values.geth.enabled }}
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
Expand All @@ -20,4 +21,5 @@ spec:
port: 8544
- protocol: TCP
port: 8546
{{- end }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/chainlink-cluster/templates/geth-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if (hasKey .Values "geth") }}
{{ if and (hasKey .Values "geth") .Values.geth.enabled }}
{{- range $cfg := .Values.geth.chains }}
apiVersion: v1
kind: Service
Expand All @@ -18,4 +18,4 @@ spec:
type: ClusterIP
---
{{- end }}
{{ end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
{{- if and .Values.mockserver.enabled .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -18,4 +18,4 @@ spec:
ports:
- protocol: TCP
port: 1080
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
{{- if and .Values.mockserver.enabled .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down
3 changes: 3 additions & 0 deletions charts/chainlink-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# image: ethereum/client-go
# version: stable
chainlink:
enabled: true
podSecurityContext:
fsGroup: 14933
securityContext:
Expand Down Expand Up @@ -88,6 +89,7 @@ chainlink:
#
# if you are running long tests
db:
enabled: true
podSecurityContext:
fsGroup: 999
securityContext:
Expand All @@ -109,6 +111,7 @@ db:
memory: 1024Mi
# default cluster shipped with latest Geth ( dev mode by default )
geth:
enabled: true
podSecurityContext:
fsGroup: 999
securityContext:
Expand Down

0 comments on commit fe8fac7

Please sign in to comment.