Skip to content

Commit

Permalink
Create network policies conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
chainchad committed Feb 5, 2024
1 parent 144143f commit fe578d8
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -21,3 +22,4 @@ spec:
ports:
- protocol: TCP
port: 5432
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
- podSelector:
matchLabels:
app: runner
{{- end }}
2 changes: 2 additions & 0 deletions charts/chainlink-cluster/templates/geth-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -23,3 +24,4 @@ spec:
port: 8544
- protocol: TCP
port: 8546
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -21,3 +22,4 @@ spec:
ports:
- protocol: TCP
port: 1080
{{- end }}
2 changes: 2 additions & 0 deletions charts/chainlink-cluster/templates/networkpolicy-default.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down Expand Up @@ -39,3 +40,4 @@ spec:
port: 53
- protocol: UDP
port: 53
{{- end }}
2 changes: 2 additions & 0 deletions charts/chainlink-cluster/templates/runner-networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
- podSelector:
matchLabels:
app: runner
{{- end }}
3 changes: 3 additions & 0 deletions charts/chainlink-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ nodeSelector:
tolerations:
affinity:

networkPolicies:
enabled: true

# Configure the default network policy.
networkPolicyDefault:
ingress:
Expand Down

0 comments on commit fe578d8

Please sign in to comment.