I am trying to setup NetworkPolicy to control access to pods running in acs cluster. The cluster is created using acs-engine and networkPolicy=azure.
The contents of the json file used to create the cluster:
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"kubernetesConfig": {
"networkPolicy": "azure"
},
"orchestratorRelease": "1.9"
},
...
}
The network policy that I am applying is to deny all ingress traffic to pods in my namespace:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
spec:
podSelector: {}
policyTypes:
- Ingress
The required restrictions are not effected with this NetworkPolicy.
If this even possible with "networkPolicy": "azure"?
Can someone point to right direction to achieve this?
After exploring I found that Azure CNI policy does not support Kubernetes network policies. The solution is to use CNI that supports it eg Calico.