Skip to content

Commit 3ed50e5

Browse files
committed
feat(acns) add advanced network policies options for az create and update commands
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
1 parent ecf19d1 commit 3ed50e5

File tree

10 files changed

+4674
-108
lines changed

10 files changed

+4674
-108
lines changed

src/azure-cli/azure/cli/command_modules/acs/_consts.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
CONST_PRIVATE_DNS_ZONE_NONE = "none"
9494

9595
# role assignment for kubelet
96-
CONST_MANAGED_IDENTITY_OPERATOR_ROLE = 'Managed Identity Operator'
97-
CONST_MANAGED_IDENTITY_OPERATOR_ROLE_ID = 'f1a07417-d97a-45cb-824c-7a7467783830'
96+
CONST_MANAGED_IDENTITY_OPERATOR_ROLE = "Managed Identity Operator"
97+
CONST_MANAGED_IDENTITY_OPERATOR_ROLE_ID = "f1a07417-d97a-45cb-824c-7a7467783830"
9898

9999
# role assignment for vnet subnet
100100
CONST_NETWORK_CONTRIBUTOR_ROLE_ID = "4d97b98b-1d4f-4787-a291-c67834d212e7"
@@ -134,6 +134,11 @@
134134
CONST_NETWORK_POLICY_CALICO = "calico"
135135
CONST_NETWORK_POLICY_NONE = "none"
136136

137+
# ACNS advanced network policies
138+
CONST_ADVANCED_NETWORKPOLICIES_NONE = "None"
139+
CONST_ADVANCED_NETWORKPOLICIES_FQDN = "FQDN"
140+
CONST_ADVANCED_NETWORKPOLICIES_L7 = "L7"
141+
137142
# network pod ip allocation mode
138143
CONST_NETWORK_POD_IP_ALLOCATION_MODE_DYNAMIC_INDIVIDUAL = "DynamicIndividual"
139144
CONST_NETWORK_POD_IP_ALLOCATION_MODE_STATIC_BLOCK = "StaticBlock"
@@ -190,15 +195,15 @@
190195

191196
# all supported addons
192197
ADDONS = {
193-
'http_application_routing': CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME,
194-
'monitoring': CONST_MONITORING_ADDON_NAME,
195-
'virtual-node': CONST_VIRTUAL_NODE_ADDON_NAME,
196-
'kube-dashboard': CONST_KUBE_DASHBOARD_ADDON_NAME,
197-
'azure-policy': CONST_AZURE_POLICY_ADDON_NAME,
198-
'ingress-appgw': CONST_INGRESS_APPGW_ADDON_NAME,
198+
"http_application_routing": CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME,
199+
"monitoring": CONST_MONITORING_ADDON_NAME,
200+
"virtual-node": CONST_VIRTUAL_NODE_ADDON_NAME,
201+
"kube-dashboard": CONST_KUBE_DASHBOARD_ADDON_NAME,
202+
"azure-policy": CONST_AZURE_POLICY_ADDON_NAME,
203+
"ingress-appgw": CONST_INGRESS_APPGW_ADDON_NAME,
199204
"confcom": CONST_CONFCOM_ADDON_NAME,
200-
'open-service-mesh': CONST_OPEN_SERVICE_MESH_ADDON_NAME,
201-
'azure-keyvault-secrets-provider': CONST_AZURE_KEYVAULT_SECRETS_PROVIDER_ADDON_NAME,
205+
"open-service-mesh": CONST_OPEN_SERVICE_MESH_ADDON_NAME,
206+
"azure-keyvault-secrets-provider": CONST_AZURE_KEYVAULT_SECRETS_PROVIDER_ADDON_NAME,
202207
"web_application_routing": CONST_WEB_APPLICATION_ROUTING_KEY_NAME,
203208
}
204209

@@ -249,8 +254,8 @@
249254

250255
# consts for decorator pattern
251256
class DecoratorMode(Enum):
252-
"""Enumerations used to distinguish whether to handle creation or update.
253-
"""
257+
"""Enumerations used to distinguish whether to handle creation or update."""
258+
254259
CREATE = 1
255260
UPDATE = 2
256261

@@ -259,6 +264,7 @@ class AgentPoolDecoratorMode(Enum):
259264
"""Enumerations used to distinguish whether to deal with the default system agentpool in the context of the cluster
260265
or any specific agentpool.
261266
"""
267+
262268
MANAGED_CLUSTER = 1
263269
STANDALONE = 2
264270

0 commit comments

Comments
 (0)