Skip to content

Commit a096e02

Browse files
jaer-tsunJaeryn
andauthored
Modify Makefile to build CNI archive for Windows AKS Swift and add the corresponding conflist (#1319)
Co-authored-by: Jaeryn <[email protected]>
1 parent 5ec6a3f commit a096e02

File tree

2 files changed

+55
-9
lines changed

2 files changed

+55
-9
lines changed

Makefile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,12 @@ cni-archive: azure-vnet-binary azure-vnet-ipam-binary azure-vnet-ipamv6-binary a
418418
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)
419419
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
420420

421+
$(MKDIR) $(CNI_SWIFT_BUILD_DIR)
422+
cp cni/azure-$(GOOS)-swift.conflist $(CNI_SWIFT_BUILD_DIR)/10-azure.conflist
423+
cp telemetry/azure-vnet-telemetry.config $(CNI_SWIFT_BUILD_DIR)/azure-vnet-telemetry.config
424+
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)
425+
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
426+
421427
#baremetal mode is windows only (at least for now)
422428
ifeq ($(GOOS),windows)
423429
$(MKDIR) $(CNI_BAREMETAL_BUILD_DIR)
@@ -426,15 +432,6 @@ ifeq ($(GOOS),windows)
426432
cd $(CNI_BAREMETAL_BUILD_DIR) && $(ARCHIVE_CMD) $(CNI_BAREMETAL_ARCHIVE_NAME) azure-vnet$(EXE_EXT) 10-azure.conflist
427433
endif
428434

429-
#swift mode is linux only
430-
ifeq ($(GOOS),linux)
431-
$(MKDIR) $(CNI_SWIFT_BUILD_DIR)
432-
cp cni/azure-$(GOOS)-swift.conflist $(CNI_SWIFT_BUILD_DIR)/10-azure.conflist
433-
cp telemetry/azure-vnet-telemetry.config $(CNI_SWIFT_BUILD_DIR)/azure-vnet-telemetry.config
434-
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)
435-
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
436-
endif
437-
438435
# Create a CNM archive for the target platform.
439436
.PHONY: cnm-archive
440437
cnm-archive: cnm-binary

cni/azure-windows-swift.conflist

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"cniVersion": "0.3.0",
3+
"name": "azure",
4+
"adapterName" : "",
5+
"plugins": [
6+
{
7+
"type": "azure-vnet",
8+
"mode": "bridge",
9+
"bridge": "azure0",
10+
"executionMode": "aksswift",
11+
"capabilities": {
12+
"portMappings": true,
13+
"dns": true
14+
},
15+
"ipam": {
16+
"type": "azure-cns"
17+
},
18+
"dns": {
19+
"Nameservers": [
20+
"10.0.0.10",
21+
"168.63.129.16"
22+
],
23+
"Search": [
24+
"svc.cluster.local"
25+
]
26+
},
27+
"AdditionalArgs": [
28+
{
29+
"Name": "EndpointPolicy",
30+
"Value": {
31+
"Type": "OutBoundNAT",
32+
"ExceptionList": [
33+
"10.240.0.0/16",
34+
"10.0.0.0/8"
35+
]
36+
}
37+
},
38+
{
39+
"Name": "EndpointPolicy",
40+
"Value": {
41+
"Type": "ROUTE",
42+
"DestinationPrefix": "10.0.0.0/8",
43+
"NeedEncap": true
44+
}
45+
}
46+
]
47+
}
48+
]
49+
}

0 commit comments

Comments
 (0)