diff --git a/Makefile b/Makefile index 14e1512c12..d0cf5f33ea 100644 --- a/Makefile +++ b/Makefile @@ -247,7 +247,6 @@ endif ## Image name definitions. ACNCLI_IMAGE = acncli -CNI_PLUGIN_IMAGE = azure-cni-plugin CNI_DROPGZ_IMAGE = cni-dropgz CNI_DROPGZ_TEST_IMAGE = cni-dropgz-test CNS_IMAGE = azure-cns @@ -255,7 +254,6 @@ NPM_IMAGE = azure-npm ## Image platform tags. ACNCLI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(ACN_VERSION) -CNI_PLUGIN_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_VERSION) CNI_DROPGZ_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_DROPGZ_VERSION) CNI_DROPGZ_TEST_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_DROPGZ_TEST_VERSION) CNS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNS_VERSION) @@ -440,21 +438,6 @@ npm-image-pull: ## pull cns container image. IMAGE=$(NPM_IMAGE) \ TAG=$(NPM_PLATFORM_TAG) -# cni-plugin - Specifically used for windows clusters, will be removed once we have Dropgz for windows -cni-plugin-image-name-and-tag: # util target to print the CNI plugin image name and tag. - @echo $(IMAGE_REGISTRY)/$(CNI_PLUGIN_IMAGE):$(CNI_PLUGIN_PLATFORM_TAG) - -cni-plugin-image: ## build cni plugin container image. - $(MAKE) container \ - DOCKERFILE=cni/build/$(OS).Dockerfile \ - IMAGE=$(CNI_PLUGIN_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID) --build-arg OS_VERSION=$(OS_VERSION)' \ - PLATFORM=$(PLATFORM) \ - TAG=$(CNI_PLUGIN_PLATFORM_TAG) \ - OS=$(OS) \ - ARCH=$(ARCH) \ - OS_VERSION=$(OS_VERSION) - ## Legacy diff --git a/cni/build/windows.Dockerfile b/cni/build/windows.Dockerfile deleted file mode 100644 index 285382dd37..0000000000 --- a/cni/build/windows.Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -ARG OS_VERSION -FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.20 AS builder -ARG VERSION -ARG CNI_AI_PATH -ARG CNI_AI_ID -WORKDIR /azure-container-networking -COPY . . -RUN GOOS=windows CGO_ENABLED=0 go build -a -o azure-vnet.exe -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/network/plugin/main.go -RUN GOOS=windows CGO_ENABLED=0 go build -a -o azure-vnet-telemetry.exe -trimpath -ldflags "-X main.version="$VERSION" -X "$CNI_AI_PATH"="$CNI_AI_ID"" -gcflags="-dwarflocationlists=true" cni/telemetry/service/telemetrymain.go -RUN GOOS=windows CGO_ENABLED=0 go build -a -o azure-vnet-ipam.exe -trimpath -ldflags "-X main.version="$VERSION"" -gcflags="-dwarflocationlists=true" cni/ipam/plugin/main.go - -FROM mcr.microsoft.com/windows/servercore:${OS_VERSION} -SHELL ["powershell", "-command"] -COPY --from=builder /azure-container-networking/azure-vnet.exe azure-vnet.exe -COPY --from=builder /azure-container-networking/azure-vnet-telemetry.exe azure-vnet-telemetry.exe -COPY --from=builder /azure-container-networking/telemetry/azure-vnet-telemetry.config azure-vnet-telemetry.config -COPY --from=builder /azure-container-networking/azure-vnet-ipam.exe azure-vnet-ipam.exe - -# This would be replaced with dropgz version of windows. -COPY --from=builder /azure-container-networking/hack/scripts/updatecni.ps1 updatecni.ps1 -ENTRYPOINT ["powershell.exe", ".\\updatecni.ps1"] diff --git a/hack/scripts/updatecni.ps1 b/hack/scripts/updatecni.ps1 deleted file mode 100644 index 630c5fbbc7..0000000000 --- a/hack/scripts/updatecni.ps1 +++ /dev/null @@ -1,57 +0,0 @@ -Write-Host $env:CONTAINER_SANDBOX_MOUNT_POINT -$sourceCNI = $env:CONTAINER_SANDBOX_MOUNT_POINT + "azure-vnet.exe" -$sourceIpam = $env:CONTAINER_SANDBOX_MOUNT_POINT + "azure-vnet-ipam.exe" -$sourceTelemetry = $env:CONTAINER_SANDBOX_MOUNT_POINT + "azure-vnet-telemetry.exe" -$sourceTelemetryConfig = $env:CONTAINER_SANDBOX_MOUNT_POINT + "azure-vnet-telemetry.config" - -$sourceCNIVersion = & "$sourceCNI" -v -$currentVersion = "" -$sourceTelemetryVersion = & "$sourceTelemetry" -v -$currentTelemetryVersion = "" - -$cniExists = Test-Path "C:\k\azurecni\bin\azure-vnet.exe" -$telemetryExists = Test-Path "C:\k\azurecni\bin\azure-vnet-telemetry.exe" - -Write-Host "Source $sourceCNIVersion" -Write-Host "Source Telemetry $sourceTelemetryVersion" - -if ($cniExists) { - $currentVersion = & "C:\k\azurecni\bin\azure-vnet.exe" -v -} - -if($telemetryExists){ - $currentTelemetryVersion = & "C:\k\azurecni\bin\azure-vnet-telemetry.exe" -v -} - - -Write-Host "Current Host $currentVersion" -Write-Host "Current Telemetry $currentTelemetryVersion" - -## check telemetry was already installed so not to get stuck in a infinite loop of rebooting and killing the process -if ($currentTelemetryVersion -ne $sourceTelemetryVersion){ - $processes = Get-Process -Name azure-vnet-telemetry -ErrorAction SilentlyContinue - for ($i = 0; $i -lt $processes.Count; $i++) { - Write-Host "Killing azure-vnet-telemetry process..." - $processes[$i].Kill() - } - Write-Host "copying azure-vnet-telemetry to windows node..." - Remove-Item "C:\k\azurecni\bin\azure-vnet-telemetry.exe" - Copy-Item $sourceTelemetry -Destination "C:\k\azurecni\bin" - - Write-Host "copying azure-vnet-telemetry.config to windows node..." - Remove-Item "C:\k\azurecni\bin\azure-vnet-telemetry.config" - Copy-Item $sourceTelemetryConfig -Destination "C:\k\azurecni\bin" -} - -## check CNI was already installed so not to get stuck in a infinite loop of rebooting -if ($currentVersion -ne $sourceCNIVersion){ - Write-Host "copying azure-vnet to windows node..." - Remove-Item "C:\k\azurecni\bin\azure-vnet.exe" - Copy-Item $sourceCNI -Destination "C:\k\azurecni\bin" - - Write-Host "copying azure-vnet-ipam to windows node..." - Remove-Item "C:\k\azurecni\bin\azure-vnet-ipam.exe" - Copy-Item $sourceIpam -Destination "C:\k\azurecni\bin" -} - -Start-Sleep -s 1000