Skip to content

Commit

Permalink
Fix Windows support for 2019 (#47)
Browse files Browse the repository at this point in the history
Switching Windows container image to
mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0
so that all Windows container versions are supported.
  • Loading branch information
feiskyer authored Jan 18, 2024
1 parent ef2c556 commit 92d4cac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kubectl-node_shell
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,10 @@ os="$($kubectl get node $node -o jsonpath="{.metadata.labels.kubernetes\.io/os}"

# Set pod configuration per operating system
if [ "$os" = "windows" ]; then
image="${KUBECTL_NODE_SHELL_IMAGE_WINDOWS:-mcr.microsoft.com/powershell}"
image="${KUBECTL_NODE_SHELL_IMAGE_WINDOWS:-mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0}"
name="pwsh"
pod="${name}-$(env LC_ALL=C tr -dc a-z0-9 </dev/urandom | head -c 6)"
# pwsh has to be launched via cmd.exe because of how containerd 1.6 handles the mount of the container filesystem
# see https://kubernetes.io/docs/tasks/configure-pod-container/create-hostprocess-pod/#volume-mounts
cmd_start='"cmd.exe", "/c", "%CONTAINER_SANDBOX_MOUNT_POINT%\\Program Files\\PowerShell\\latest\\pwsh.exe", "-nol", "-wd", "C:\\"'
cmd_start='"cmd.exe", "/c", "powershell.exe", "-nol"'
cmd_arg_prefix=', "-Command"'
cmd_default=''
security_context='{"privileged":true,"windowsOptions":{"hostProcess":true,"runAsUserName":"NT AUTHORITY\\SYSTEM"}}'
Expand Down

0 comments on commit 92d4cac

Please sign in to comment.