From 895730f5b4a3f760fc8f6448379e308f6519d18b Mon Sep 17 00:00:00 2001 From: Jaeryn Date: Mon, 4 Apr 2022 15:42:59 -0700 Subject: [PATCH] Modify Makefile to build CNI archive for Windows AKS Swift and add the corresponding conflist --- Makefile | 15 ++++------ cni/azure-windows-swift.conflist | 49 ++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 cni/azure-windows-swift.conflist diff --git a/Makefile b/Makefile index b8a42a6d97..b246681b2b 100644 --- a/Makefile +++ b/Makefile @@ -418,6 +418,12 @@ cni-archive: azure-vnet-binary azure-vnet-ipam-binary azure-vnet-ipamv6-binary a cp $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT) $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) $(CNI_MULTITENANCY_BUILD_DIR) cd $(CNI_MULTITENANCY_BUILD_DIR) && $(ARCHIVE_CMD) $(CNI_MULTITENANCY_ARCHIVE_NAME) azure-vnet$(EXE_EXT) azure-vnet-ipam$(EXE_EXT) azure-vnet-telemetry$(EXE_EXT) 10-azure.conflist azure-vnet-telemetry.config + $(MKDIR) $(CNI_SWIFT_BUILD_DIR) + cp cni/azure-$(GOOS)-swift.conflist $(CNI_SWIFT_BUILD_DIR)/10-azure.conflist + cp telemetry/azure-vnet-telemetry.config $(CNI_SWIFT_BUILD_DIR)/azure-vnet-telemetry.config + cp $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT) $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) $(CNI_SWIFT_BUILD_DIR) + cd $(CNI_SWIFT_BUILD_DIR) && $(ARCHIVE_CMD) $(CNI_SWIFT_ARCHIVE_NAME) azure-vnet$(EXE_EXT) azure-vnet-ipam$(EXE_EXT) azure-vnet-telemetry$(EXE_EXT) 10-azure.conflist azure-vnet-telemetry.config + #baremetal mode is windows only (at least for now) ifeq ($(GOOS),windows) $(MKDIR) $(CNI_BAREMETAL_BUILD_DIR) @@ -426,15 +432,6 @@ ifeq ($(GOOS),windows) cd $(CNI_BAREMETAL_BUILD_DIR) && $(ARCHIVE_CMD) $(CNI_BAREMETAL_ARCHIVE_NAME) azure-vnet$(EXE_EXT) 10-azure.conflist endif -#swift mode is linux only -ifeq ($(GOOS),linux) - $(MKDIR) $(CNI_SWIFT_BUILD_DIR) - cp cni/azure-$(GOOS)-swift.conflist $(CNI_SWIFT_BUILD_DIR)/10-azure.conflist - cp telemetry/azure-vnet-telemetry.config $(CNI_SWIFT_BUILD_DIR)/azure-vnet-telemetry.config - cp $(CNI_BUILD_DIR)/azure-vnet$(EXE_EXT) $(CNI_BUILD_DIR)/azure-vnet-ipam$(EXE_EXT) $(CNI_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) $(CNI_SWIFT_BUILD_DIR) - cd $(CNI_SWIFT_BUILD_DIR) && $(ARCHIVE_CMD) $(CNI_SWIFT_ARCHIVE_NAME) azure-vnet$(EXE_EXT) azure-vnet-ipam$(EXE_EXT) azure-vnet-telemetry$(EXE_EXT) 10-azure.conflist azure-vnet-telemetry.config -endif - # Create a CNM archive for the target platform. .PHONY: cnm-archive cnm-archive: cnm-binary diff --git a/cni/azure-windows-swift.conflist b/cni/azure-windows-swift.conflist new file mode 100644 index 0000000000..34d09a0b3d --- /dev/null +++ b/cni/azure-windows-swift.conflist @@ -0,0 +1,49 @@ +{ + "cniVersion": "0.3.0", + "name": "azure", + "adapterName" : "", + "plugins": [ + { + "type": "azure-vnet", + "mode": "bridge", + "bridge": "azure0", + "executionMode": "aksswift", + "capabilities": { + "portMappings": true, + "dns": true + }, + "ipam": { + "type": "azure-cns" + }, + "dns": { + "Nameservers": [ + "10.0.0.10", + "168.63.129.16" + ], + "Search": [ + "svc.cluster.local" + ] + }, + "AdditionalArgs": [ + { + "Name": "EndpointPolicy", + "Value": { + "Type": "OutBoundNAT", + "ExceptionList": [ + "10.240.0.0/16", + "10.0.0.0/8" + ] + } + }, + { + "Name": "EndpointPolicy", + "Value": { + "Type": "ROUTE", + "DestinationPrefix": "10.0.0.0/8", + "NeedEncap": true + } + } + ] + } + ] +}