Skip to content

Commit 2b3dbd1

Browse files
authored
fix: let Windows CNS use the InClusterConfig (#3248)
* fix: let Windows CNS use the InClusterConfig Signed-off-by: Evan Baker <[email protected]> * remove pwsh from cmd Signed-off-by: Evan Baker <[email protected]> --------- Signed-off-by: Evan Baker <[email protected]>
1 parent d61a128 commit 2b3dbd1

File tree

6 files changed

+4
-20
lines changed

6 files changed

+4
-20
lines changed

.pipelines/build/dockerfiles/cns.Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ARG ARCH
66
FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b AS windows
77
ARG ARTIFACT_DIR .
88

9-
COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
10-
COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1
119
COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe
1210
ENTRYPOINT ["azure-cns.exe"]
1311
EXPOSE 10090

.pipelines/build/dockerfiles/cns.Dockerfile.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ ARG ARCH
66
FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} AS windows
77
ARG ARTIFACT_DIR .
88

9-
COPY ${ARTIFACT_DIR}/files/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
10-
COPY ${ARTIFACT_DIR}/scripts/setkubeconfigpath.ps1 setkubeconfigpath.ps1
119
COPY ${ARTIFACT_DIR}/bin/azure-cns.exe /azure-cns.exe
1210
ENTRYPOINT ["azure-cns.exe"]
1311
EXPOSE 10090

cns/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ EXPOSE 10090
3636
FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as hpc
3737

3838
FROM hpc as windows
39-
COPY --from=builder /azure-container-networking/cns/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
40-
COPY --from=builder /azure-container-networking/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1
4139
COPY --from=builder /go/bin/azure-cns /azure-cns.exe
4240
ENTRYPOINT ["azure-cns.exe"]
4341
EXPOSE 10090

cns/Dockerfile.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ EXPOSE 10090
3636
FROM --platform=windows/${ARCH} {{.WIN_HPC_PIN}} as hpc
3737

3838
FROM hpc as windows
39-
COPY --from=builder /azure-container-networking/cns/kubeconfigtemplate.yaml kubeconfigtemplate.yaml
40-
COPY --from=builder /azure-container-networking/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1
4139
COPY --from=builder /go/bin/azure-cns /azure-cns.exe
4240
ENTRYPOINT ["azure-cns.exe"]
4341
EXPOSE 10090

cns/azure-cns-windows.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,14 @@ spec:
3535
imagePullPolicy: IfNotPresent
3636
securityContext:
3737
privileged: true
38-
command: ["powershell.exe"]
38+
command: "azure-cns.exe"
3939
args:
40-
[
41-
'.\setkubeconfigpath.ps1', ";",
42-
'powershell.exe', '.\azure-cns.exe',
40+
[
4341
'-c', "tcp://$(CNSIpAddress):$(CNSPort)",
4442
'-t', "$(CNSLogTarget)",
4543
'-o', "$(CNSLogDir)",
4644
'-storefilepath', "$(CNSStoreFilePath)",
4745
'-config-path', "%CONTAINER_SANDBOX_MOUNT_POINT%\\$(CNS_CONFIGURATION_PATH)",
48-
'--kubeconfig', '.\kubeconfig',
4946
]
5047
volumeMounts:
5148
- name: log

test/integration/manifests/cns/daemonset-windows.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,9 @@ spec:
4949
securityContext:
5050
privileged: true
5151
workingDir: $env:CONTAINER_SANDBOX_MOUNT_POINT
52-
command: ["powershell.exe"]
52+
command: ["azure-cns.exe"]
5353
args:
5454
[
55-
'.\setkubeconfigpath.ps1',
56-
";",
57-
'.\azure-cns.exe',
5855
"-c",
5956
"tcp://$(CNSIpAddress):$(CNSPort)",
6057
"-t",
@@ -65,8 +62,6 @@ spec:
6562
"$(CNSStoreFilePath)",
6663
"-config-path",
6764
"%CONTAINER_SANDBOX_MOUNT_POINT%\\$(CNS_CONFIGURATION_PATH)",
68-
"--kubeconfig",
69-
'.\kubeconfig',
7065
]
7166
volumeMounts:
7267
- name: log
@@ -111,7 +106,7 @@ spec:
111106
image: acnpublic.azurecr.io/cni-dropgz:latest
112107
imagePullPolicy: Always
113108
command:
114-
- powershell.exe; $env:CONTAINER_SANDBOX_MOUNT_POINT/dropgz
109+
- $env:CONTAINER_SANDBOX_MOUNT_POINT/dropgz
115110
args:
116111
- deploy
117112
- azure-vnet

0 commit comments

Comments
 (0)