-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support custom ingress rules on the chart to support external Ingress (…
…#11829) * Support custom ingress rules on the chart to allow external Ingress to reach pods * Simplify values to be passed in with the helm --set flag
- Loading branch information
Showing
3 changed files
with
50 additions
and
27 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
charts/chainlink-cluster/templates/networkpolicy-default-deny.yaml
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
charts/chainlink-cluster/templates/networkpolicy-default.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: default | ||
spec: | ||
podSelector: | ||
matchLabels: {} | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
ingress: | ||
{{- if and .Values.networkPolicyDefault.ingress.allowCustomCidrs (not (empty .Values.networkPolicyDefault.ingress.customCidrs)) }} | ||
# Using a comma separated list to make it easy to pass in with: | ||
# `helm template ... --set networkPolicyDefault.ingress.customCidrs=...` | ||
{{- $cidrs := splitList "," .Values.networkPolicyDefault.ingress.customCidrs }} | ||
- from: | ||
{{- range $cidr := $cidrs }} | ||
- ipBlock: | ||
cidr: {{ $cidr | quote }} | ||
{{- end }} | ||
{{- else }} | ||
# Deny all ingress if no rules are specified. Rules can still be specified in other templates. | ||
- {} | ||
{{- end }} | ||
egress: | ||
- to: | ||
- namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: "{{ $.Release.Namespace }}" | ||
- to: | ||
- namespaceSelector: | ||
matchLabels: | ||
kubernetes.io/metadata.name: kube-system | ||
podSelector: | ||
matchLabels: | ||
k8s-app: kube-dns | ||
ports: | ||
- protocol: TCP | ||
port: 53 | ||
- protocol: UDP | ||
port: 53 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters