diff --git a/.pipelines/build/dockerfiles/cns.Dockerfile b/.pipelines/build/dockerfiles/cns.Dockerfile index f1fed9705d..97115c199f 100644 --- a/.pipelines/build/dockerfiles/cns.Dockerfile +++ b/.pipelines/build/dockerfiles/cns.Dockerfile @@ -6,8 +6,6 @@ ARG ARCH FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b AS windows ARG ARTIFACT_DIR . -COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml -COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe ENTRYPOINT ["azure-cns.exe"] EXPOSE 10090 diff --git a/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl b/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl index 492be61bac..fbd09997dc 100644 --- a/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl +++ b/.pipelines/build/dockerfiles/cns.Dockerfile.tmpl @@ -6,8 +6,6 @@ ARG ARCH FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} AS windows ARG ARTIFACT_DIR . -COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml -COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe ENTRYPOINT ["azure-cns.exe"] EXPOSE 10090 diff --git a/cns/Dockerfile b/cns/Dockerfile index 1c76e949b1..2539e90043 100644 --- a/cns/Dockerfile +++ b/cns/Dockerfile @@ -36,8 +36,6 @@ EXPOSE 10090 FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as hpc FROM hpc as windows -COPY --from=builder /azure-container-networking/cns/kubeconfigtemplate.yaml kubeconfigtemplate.yaml -COPY --from=builder /azure-container-networking/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY --from=builder /go/bin/azure-cns /azure-cns.exe ENTRYPOINT ["azure-cns.exe"] EXPOSE 10090 diff --git a/cns/Dockerfile.tmpl b/cns/Dockerfile.tmpl index 02a1fa4b07..34bde0dd8c 100644 --- a/cns/Dockerfile.tmpl +++ b/cns/Dockerfile.tmpl @@ -36,8 +36,6 @@ EXPOSE 10090 FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} as hpc FROM hpc as windows -COPY --from=builder /azure-container-networking/cns/kubeconfigtemplate.yaml kubeconfigtemplate.yaml -COPY --from=builder /azure-container-networking/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY --from=builder /go/bin/azure-cns /azure-cns.exe ENTRYPOINT ["azure-cns.exe"] EXPOSE 10090 diff --git a/cns/azure-cns-windows.yaml b/cns/azure-cns-windows.yaml index 1b0eba16cd..24d24c5932 100644 --- a/cns/azure-cns-windows.yaml +++ b/cns/azure-cns-windows.yaml @@ -35,17 +35,14 @@ spec: imagePullPolicy: IfNotPresent securityContext: privileged: true - command: ["powershell.exe"] + command: "azure-cns.exe" args: - [ - '.\setkubeconfigpath.ps1', ";", - 'powershell.exe', '.\azure-cns.exe', + [ '-c', "tcp://$(CNSIpAddress):$(CNSPort)", '-t', "$(CNSLogTarget)", '-o', "$(CNSLogDir)", '-storefilepath', "$(CNSStoreFilePath)", '-config-path', "%CONTAINER_SANDBOX_MOUNT_POINT%\\$(CNS_CONFIGURATION_PATH)", - '--kubeconfig', '.\kubeconfig', ] volumeMounts: - name: log diff --git a/test/integration/manifests/cns/daemonset-windows.yaml b/test/integration/manifests/cns/daemonset-windows.yaml index 04e2aaa3fa..96b8dc9c40 100644 --- a/test/integration/manifests/cns/daemonset-windows.yaml +++ b/test/integration/manifests/cns/daemonset-windows.yaml @@ -49,12 +49,9 @@ spec: securityContext: privileged: true workingDir: $env:CONTAINER_SANDBOX_MOUNT_POINT - command: ["powershell.exe"] + command: ["azure-cns.exe"] args: [ - '.\setkubeconfigpath.ps1', - ";", - '.\azure-cns.exe', "-c", "tcp://$(CNSIpAddress):$(CNSPort)", "-t", @@ -65,8 +62,6 @@ spec: "$(CNSStoreFilePath)", "-config-path", "%CONTAINER_SANDBOX_MOUNT_POINT%\\$(CNS_CONFIGURATION_PATH)", - "--kubeconfig", - '.\kubeconfig', ] volumeMounts: - name: log @@ -111,7 +106,7 @@ spec: image: acnpublic.azurecr.io/cni-dropgz:latest imagePullPolicy: Always command: - - powershell.exe; $env:CONTAINER_SANDBOX_MOUNT_POINT/dropgz + - $env:CONTAINER_SANDBOX_MOUNT_POINT/dropgz args: - deploy - azure-vnet