-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(helm): add support for NetworkPolicies in v2 Helm chart (#3164)
* feat(helm): add support for NetworkPolicies in v2 Helm chart * feat(helm): add MySQL and PostgreSQL ports to NetworkPolicy
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
v2/charts/azure-service-operator/templates/networkpolicies.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,55 @@ | ||
{{- if .Values.networkPolicies.enable }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: azure-service-operator-allow-ingress | ||
namespace: {{ .Release.namespace }} | ||
spec: | ||
ingress: | ||
- from: | ||
- ipBlock: | ||
cidr: 0.0.0.0/0 | ||
podSelector: | ||
matchLabels: | ||
control-plane: controller-manager | ||
policyTypes: | ||
- Ingress | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: azure-service-operator-allow-egress | ||
namespace: {{ .Release.namespace }} | ||
spec: | ||
egress: | ||
- ports: | ||
# Required for communication with the Azure API | ||
- port: 443 | ||
protocol: TCP | ||
to: | ||
- ipBlock: | ||
cidr: 0.0.0.0/0 | ||
# Required for communication with the Kubernetes API | ||
- port: {{ .Values.networkPolicies.kubernetesApiPort }} | ||
protocol: TCP | ||
to: | ||
- ipBlock: | ||
cidr: {{ .Values.networkPolicies.kubernetesApiCIDR }} | ||
# Required for communication with MySQL servers when using MySQL user object | ||
- port: 3306 | ||
protocol: TCP | ||
to: | ||
- ipBlock: | ||
cidr: {{ .Values.networkPolicies.mysqlCIDR }} | ||
# Required for communication with PostgreSQL servers when using PostgreSQL user object | ||
- port: 5432 | ||
protocol: TCP | ||
to: | ||
- ipBlock: | ||
cidr: {{ .Values.networkPolicies.postgresqlCIDR }} | ||
podSelector: | ||
matchLabels: | ||
control-plane: controller-manager | ||
policyTypes: | ||
- Egress | ||
{{- end }} |
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