Merge pull request #99670 from jsturtevant/windows-gmsa

Include nltest in the windows busybox image
This commit is contained in:
Kubernetes Prow Robot 2021-03-15 05:01:05 -07:00 committed by GitHub
commit b458d97feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 8 deletions

View File

@ -398,7 +398,12 @@ func createPodWithGmsa(f *framework.Framework, serviceAccountName string) string
Containers: []v1.Container{ Containers: []v1.Container{
{ {
Name: podName, Name: podName,
Image: imageutils.GetPauseImageName(), Image: imageutils.GetE2EImage(imageutils.BusyBox),
Command: []string{
"powershell.exe",
"-Command",
"sleep -Seconds 600",
},
}, },
}, },
SecurityContext: &v1.PodSecurityContext{ SecurityContext: &v1.PodSecurityContext{

View File

@ -59,11 +59,21 @@ var _ = SIGDescribe("[Feature:Windows] GMSA Kubelet [Slow]", func() {
Containers: []v1.Container{ Containers: []v1.Container{
{ {
Name: container1Name, Name: container1Name,
Image: imageutils.GetPauseImageName(), Image: imageutils.GetE2EImage(imageutils.BusyBox),
Command: []string{
"powershell.exe",
"-Command",
"sleep -Seconds 600",
},
}, },
{ {
Name: container2Name, Name: container2Name,
Image: imageutils.GetPauseImageName(), Image: imageutils.GetE2EImage(imageutils.BusyBox),
Command: []string{
"powershell.exe",
"-Command",
"sleep -Seconds 600",
},
SecurityContext: &v1.SecurityContext{ SecurityContext: &v1.SecurityContext{
WindowsOptions: &v1.WindowsSecurityContextOptions{ WindowsOptions: &v1.WindowsSecurityContextOptions{
GMSACredentialSpec: generateDummyCredSpecs(container2Domain), GMSACredentialSpec: generateDummyCredSpecs(container2Domain),

View File

@ -104,7 +104,7 @@ limitations when it comes to the Windows images:
which won't work properly on Windows. See https://github.com/moby/buildkit/issues/1560 which won't work properly on Windows. See https://github.com/moby/buildkit/issues/1560
- The base image for all the Windows images is nanoserver, which is ~10 times smaller than Windows Servercore. - The base image for all the Windows images is nanoserver, which is ~10 times smaller than Windows Servercore.
Most binaries added to the image will work out of the box, but some will not due to missing dependencies Most binaries added to the image will work out of the box, but some will not due to missing dependencies
(**atention**: the image will still build successfully, even if the added binaries will not work). (**attention**: the image will still build successfully, even if the added binaries will not work).
For example, `coredns.exe` requires `netapi32.dll`, which cannot be found on a nanoserver image, but For example, `coredns.exe` requires `netapi32.dll`, which cannot be found on a nanoserver image, but
we can copy it from a servercore image (see the agnhost image's `Dockerfile_windows` file as an example). we can copy it from a servercore image (see the agnhost image's `Dockerfile_windows` file as an example).
A good rule of thumb is to use 64-bit applications instead of 32-bit as they have fewer dependencies. A good rule of thumb is to use 64-bit applications instead of 32-bit as they have fewer dependencies.

View File

@ -16,4 +16,4 @@
ARG BASEIMAGE ARG BASEIMAGE
FROM $BASEIMAGE FROM $BASEIMAGE
LABEL image_version="1.29" LABEL image_version="1.29-1"

View File

@ -14,6 +14,7 @@
ARG BASEIMAGE ARG BASEIMAGE
ARG REGISTRY ARG REGISTRY
ARG OS_VERSION
# We're using a Linux image to unpack the archive, then we're copying it over to Windows. # We're using a Linux image to unpack the archive, then we're copying it over to Windows.
FROM --platform=linux/amd64 alpine:3.6 as prep FROM --platform=linux/amd64 alpine:3.6 as prep
@ -55,7 +56,7 @@ RUN mkdir /curl-full /curl-dir && \
# Windows Stage # Windows Stage
FROM --platform=linux/amd64 $REGISTRY/windows-servercore-cache:1.0-linux-amd64-$OS_VERSION as servercore-helper
FROM e2eteam/powershell-helper:6.2.7 as ps-helper FROM e2eteam/powershell-helper:6.2.7 as ps-helper
FROM $BASEIMAGE FROM $BASEIMAGE
@ -66,6 +67,11 @@ COPY --from=prep /netcat-dir/nc64.exe /bin/nc.exe
COPY --from=prep /dig-dir /dig COPY --from=prep /dig-dir /dig
COPY --from=prep /vcruntime140.dll /Windows/System32/ COPY --from=prep /vcruntime140.dll /Windows/System32/
# include nltest
COPY --from=servercore-helper /Windows/System32/nltest.exe /Windows/System32/nltest.exe
COPY --from=servercore-helper /Windows/System32/en-US/nltest.exe.mui /Windows/System32/en-US/nltest.exe.mui
COPY --from=servercore-helper /Windows/System32/ntdsapi.dll /Windows/System32/ntdsapi.dll
# include powershell and its Module analysis cache. # include powershell and its Module analysis cache.
COPY --from=ps-helper ["/PowerShell", "/Program Files/PowerShell"] COPY --from=ps-helper ["/PowerShell", "/Program Files/PowerShell"]
@ -86,5 +92,5 @@ ENV PATH="C:\dig\;C:\bin;C:\curl;C:\Windows\System32;C:\Windows;C:\Program Files
# Persist %PSCORE% ENV variable for user convenience # Persist %PSCORE% ENV variable for user convenience
PSCORE="C:\Program Files\PowerShell\pwsh.exe" PSCORE="C:\Program Files\PowerShell\pwsh.exe"
LABEL image_version="1.29" LABEL image_version="1.29-1"
ENTRYPOINT ["cmd.exe", "/s", "/c"] ENTRYPOINT ["cmd.exe", "/s", "/c"]

View File

@ -1 +1 @@
1.29 1.29-1