Skip to content

Commit

Permalink
Merge pull request #282 from RasaHQ/netpol-egress-to-k8s-api-update
Browse files Browse the repository at this point in the history
feat: Add support for defining an IP block for egress network policies
  • Loading branch information
Tomasz Czekajlo authored Mar 30, 2022
2 parents 99f8f57 + e3f8669 commit 8291396
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions charts/rasa-x/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2

version: "4.4.1"
version: "4.5.0"

appVersion: "1.0.1"

Expand Down Expand Up @@ -41,5 +41,5 @@ dependencies:
annotations:
# See: https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations
artifacthub.io/changes: |
- kind: changed
description: Bugfix for external redis with credentials
- kind: added
description: Add support for defining target for the egress-from-rabbitmq-to-k8s-api and egress-from-rasa-x-to-https network policies.
8 changes: 8 additions & 0 deletions charts/rasa-x/templates/network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,10 @@ spec:
port: 8443
- protocol: TCP
port: 443
{{- if .Values.networkPolicy.egress.apiCIDR }}
to:
{{- toYaml .Values.networkPolicy.egress.apiCIDR | nindent 6 }}
{{- end }}
---
apiVersion: {{ template "networkPolicy.apiVersion" . }}
kind: NetworkPolicy
Expand Down Expand Up @@ -1153,4 +1157,8 @@ spec:
- ports:
- protocol: TCP
port: 443
{{- if .Values.networkPolicy.egress.rasaxToHttpsCIDR }}
to:
{{- toYaml .Values.networkPolicy.egress.rasaxToHttpsCIDR | nindent 6 }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/rasa-x/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,17 @@ networkPolicy:
# - ipBlock:
# cidr: 0.0.0.0/0

egress:
# Allow for adding the specific k8s api IP/CIDR for the egress-from-rabbitmq-to-k8s-api NetworkPolicy
apiCIDR: []
#- ipBlock:
# cidr: 10.0.0.0/8

# Allow for adding the specific IP/CIDR for the egress-from-rasa-x-to-https NetworkPolicy
rasaxToHttpsCIDR: []
#- ipBlock:
# cidr: 11.0.0.0/8

# images: Settings for the images
images:
# pullPolicy to use when deploying images
Expand Down

0 comments on commit 8291396

Please sign in to comment.