diff --git a/v2/charts/azure-service-operator/templates/networkpolicies.yaml b/v2/charts/azure-service-operator/templates/networkpolicies.yaml index 689affbd019..14fefbaf7af 100644 --- a/v2/charts/azure-service-operator/templates/networkpolicies.yaml +++ b/v2/charts/azure-service-operator/templates/networkpolicies.yaml @@ -26,12 +26,27 @@ spec: # 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: 0.0.0.0/0 + 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 diff --git a/v2/charts/azure-service-operator/values.yaml b/v2/charts/azure-service-operator/values.yaml index c68aa604d5b..4f0c148f28d 100644 --- a/v2/charts/azure-service-operator/values.yaml +++ b/v2/charts/azure-service-operator/values.yaml @@ -126,4 +126,9 @@ networkPolicies: enable: true # TCP port to be configured for talking to the Kubernetes API kubernetesApiPort: 6443 - + # Destination CIDR for talking to the Kubernetes API + kubernetesApiCIDR: 0.0.0.0/0 + # Destination CIDR for talking to MySQL servers + kubernetesApiCIDR: 0.0.0.0/0 + # Destination CIDR for talking to PostgreSQL servers + kubernetesApiCIDR: 0.0.0.0/0