diff --git a/charts/chainlink-cluster/templates/chainlink-db-networkpolicy.yaml b/charts/chainlink-cluster/templates/chainlink-db-networkpolicy.yaml index e5d029b7865..5f7e7706ced 100644 --- a/charts/chainlink-cluster/templates/chainlink-db-networkpolicy.yaml +++ b/charts/chainlink-cluster/templates/chainlink-db-networkpolicy.yaml @@ -1,3 +1,4 @@ +{{- if .Values.networkPolicies.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -21,3 +22,4 @@ spec: ports: - protocol: TCP port: 5432 +{{- end }} \ No newline at end of file diff --git a/charts/chainlink-cluster/templates/chainlink-node-networkpolicy.yaml b/charts/chainlink-cluster/templates/chainlink-node-networkpolicy.yaml index 321bc531626..e63759a994f 100644 --- a/charts/chainlink-cluster/templates/chainlink-node-networkpolicy.yaml +++ b/charts/chainlink-cluster/templates/chainlink-node-networkpolicy.yaml @@ -1,3 +1,4 @@ +{{- if .Values.networkPolicies.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -17,3 +18,4 @@ spec: - podSelector: matchLabels: app: runner +{{- end }} \ No newline at end of file diff --git a/charts/chainlink-cluster/templates/geth-networkpolicy.yaml b/charts/chainlink-cluster/templates/geth-networkpolicy.yaml index 5be59136251..025d6184501 100644 --- a/charts/chainlink-cluster/templates/geth-networkpolicy.yaml +++ b/charts/chainlink-cluster/templates/geth-networkpolicy.yaml @@ -1,3 +1,4 @@ +{{- if .Values.networkPolicies.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -23,3 +24,4 @@ spec: port: 8544 - protocol: TCP port: 8546 +{{- end }} \ No newline at end of file diff --git a/charts/chainlink-cluster/templates/mockserver-networkpolicy.yaml b/charts/chainlink-cluster/templates/mockserver-networkpolicy.yaml index 074b1ab089a..6ac4f658e37 100644 --- a/charts/chainlink-cluster/templates/mockserver-networkpolicy.yaml +++ b/charts/chainlink-cluster/templates/mockserver-networkpolicy.yaml @@ -1,3 +1,4 @@ +{{- if .Values.networkPolicies.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -21,3 +22,4 @@ spec: ports: - protocol: TCP port: 1080 +{{- end }} \ No newline at end of file diff --git a/charts/chainlink-cluster/templates/networkpolicy-default.yaml b/charts/chainlink-cluster/templates/networkpolicy-default.yaml index f2d9416cf15..a2cc23ed7f9 100644 --- a/charts/chainlink-cluster/templates/networkpolicy-default.yaml +++ b/charts/chainlink-cluster/templates/networkpolicy-default.yaml @@ -1,3 +1,4 @@ +{{- if .Values.networkPolicies.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -39,3 +40,4 @@ spec: port: 53 - protocol: UDP port: 53 +{{- end }} \ No newline at end of file diff --git a/charts/chainlink-cluster/templates/runner-networkpolicy.yaml b/charts/chainlink-cluster/templates/runner-networkpolicy.yaml index 2bb6ac98625..b75a2ffa772 100644 --- a/charts/chainlink-cluster/templates/runner-networkpolicy.yaml +++ b/charts/chainlink-cluster/templates/runner-networkpolicy.yaml @@ -1,3 +1,4 @@ +{{- if .Values.networkPolicies.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: @@ -17,3 +18,4 @@ spec: - podSelector: matchLabels: app: runner +{{- end }} \ No newline at end of file diff --git a/charts/chainlink-cluster/values.yaml b/charts/chainlink-cluster/values.yaml index 24914a40a91..3e58cbaea24 100644 --- a/charts/chainlink-cluster/values.yaml +++ b/charts/chainlink-cluster/values.yaml @@ -284,6 +284,9 @@ nodeSelector: tolerations: affinity: +networkPolicies: + enabled: true + # Configure the default network policy. networkPolicyDefault: ingress: