Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: let Windows CNS use the InClusterConfig #3248

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cns/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ EXPOSE 10090

# skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}"
FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b 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 link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may want to leave these around in the dockerfile for a bit in case the release of cns which has this removed gets ahead of the overlaymgr release that will remove them from the manifest (or overlaymgr rolls back)

Copy link
Contributor Author

@rbtr rbtr Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we won't be releasing CNS urgently, the production impact can be mitigated entirely through a daemonset change in AKS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need to keep cns/kubeconfigtemplate.yaml and npm/examples/windows/setkubeconfigpath.ps1 in the repo any longer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likely no but they are referenced in the NPM build, and we need to make sure nothing we're building out of this branch can land on k8s <1.28

COPY --from=builder /go/bin/azure-cns /azure-cns.exe
ENTRYPOINT ["azure-cns.exe"]
EXPOSE 10090
7 changes: 2 additions & 5 deletions cns/azure-cns-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions test/integration/manifests/cns/daemonset-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -65,8 +62,6 @@ spec:
"$(CNSStoreFilePath)",
"-config-path",
"%CONTAINER_SANDBOX_MOUNT_POINT%\\$(CNS_CONFIGURATION_PATH)",
"--kubeconfig",
'.\kubeconfig',
]
volumeMounts:
- name: log
Expand Down Expand Up @@ -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
Expand Down
Loading