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

Provide Windows container image #957

Open
dbaid opened this issue Sep 30, 2021 · 14 comments
Open

Provide Windows container image #957

dbaid opened this issue Sep 30, 2021 · 14 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@dbaid
Copy link

dbaid commented Sep 30, 2021

Question

I am testing this case for migrating old .net application.
https://github.com/michael-chi/migrate-for-anthos-aspnet
But the GKE windows container got connection issue with Cloud SQL Server.
I can't find cloud auth proxy container image for windows to be the sidecar.
Would you mind helping me this issue ???

Regards,
Steven

@dbaid dbaid added the type: question Request for information or clarification. label Sep 30, 2021
@enocom enocom assigned enocom and unassigned jackwotherspoon Sep 30, 2021
@enocom
Copy link
Member

enocom commented Sep 30, 2021

We provide three containers based on distroless, alpine, and buster. There is no Windows image presently. So I'm going to mark this as a feature request.

Do you have any thoughts on what an ideal Windows image might look like, e.g., containerd vs Docker, LTSC vs SAC, etc?

Some docs here: https://cloud.google.com/kubernetes-engine/docs/concepts/node-images.

@enocom enocom changed the title Cloud auth proxy windows container image for sql server feature request: provide Windows container image Sep 30, 2021
@enocom enocom added priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: question Request for information or clarification. labels Sep 30, 2021
@enocom enocom changed the title feature request: provide Windows container image Provide Windows container image Sep 30, 2021
@dbaid
Copy link
Author

dbaid commented Oct 1, 2021

I tried to build a container image by myself and deploy iis 3.5 and the proxy image.
I am not sure if some thing wrong with my image,because application seems even not connect to the proxy.
My Dockerfile:

FROM mcr.microsoft.com/windows/servercore:ltsc2019
RUN mkdir C:\test
WORKDIR /test
COPY cloud_sql_proxy_x64.exe .
COPY key.json .
COPY cloudsql.ps1 .
ENTRYPOINT powershell -Command c:\test\cloudsql.ps1

MyPod Info :

kubectl get pods

NAME                          READY   STATUS    RESTARTS   AGE
myworkload-6dfdf99b6f-m24bd   2/2     Running   0          15h

The Pod Details:

kubectl describe pod  myworkload-6dfdf99b6f-m24bd

Name:         myworkload-6dfdf99b6f-m24bd
Namespace:    default
Priority:     0
Node:         gke-0331a2-sxs7/10.140.0.9
Start Time:   Thu, 30 Sep 2021 09:15:55 +0000
Labels:       app=myworkload
              pod-template-hash=6dfdf99b6f
Annotations:  <none>
Status:       Running
IP:           10.8.1.5
IPs:
  IP:           10.8.1.5
Controlled By:  ReplicaSet/myworkload-6dfdf99b6f
Containers:
  myworkload-container:
    Container ID:   docker://642d928afa5be6bc787c9cb8e86a3b3011861c8ccd00019791e785eb282eb7f0
    Image:          gcr.io/mytest9999/myimagename:v1.0.0
    Image ID:       docker-pullable://gcr.io/mytest9999/myimagename@sha256:3384badbc0695cc53ebd4812b7580de4d3fe7f3a6d1467b8b0b7b6c8ab12a667
    Port:           80/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Thu, 30 Sep 2021 09:23:14 +0000
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-98htb (ro)
  cloudsql-proxy:
    Container ID:   docker://1a4d1ae6f81eff818f7ea9be6528f1ee2f9f74295c49529c86b8f88f95cbcd4d
    Image:          gcr.io/mytest9999/cloudsql-proxy:latest
    Image ID:       docker-pullable://gcr.io/mytest9999/cloudsql-proxy@sha256:9126f6145758b0db5ebb0e4d387240cf98f68f4642e5dec3ea2030a9878dc080
    Port:           1433/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Thu, 30 Sep 2021 09:23:27 +0000
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-98htb (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  default-token-98htb:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-98htb
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  kubernetes.io/os=windows
Tolerations:     node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                 node.kubernetes.io/os=windows:NoSchedule
                 node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:          <none>

This issue may not an issue with proxy image , maybe anthos , or others....
Do you have any advices ??
vm_wtih_proxy
This image (IIS in compute engine) shows proxy received request
container_with_proxy
But in container env, proxy seems not receive anything.

@enocom
Copy link
Member

enocom commented Oct 1, 2021

Here are some ideas:

  1. Verify that you can make a successful connection to the Cloud SQL instance using a Compute Engine VM or from a local machine. Right now, I see The instance or operation is not in an appropriate state....
  2. Deploy a simple application to the cluster that uses the proxy as a sidecar, and check the application logs -- the logs you posted above indicate the application is failing to connect to the proxy, which suggests an application config error.

@dbaid
Copy link
Author

dbaid commented Oct 1, 2021 via email

@dbaid
Copy link
Author

dbaid commented Oct 6, 2021

Hello ,
I am studying "Architecting with Google Kubernetes " on googlecourses to know more about GKE .
Therefore, close this issue first.
Thank you for your support.

Regards,
Steven

@dbaid dbaid closed this as completed Oct 6, 2021
@enocom
Copy link
Member

enocom commented Oct 6, 2021

I suspect it's a common enough use case to run the proxy on a Windows VM. So I'm going to re-open this as a feature request for providing a Windows container.

@enocom enocom reopened this Oct 6, 2021
@dbaid
Copy link
Author

dbaid commented Oct 7, 2021 via email

@enocom enocom added the windows label Dec 2, 2021
@enocom enocom removed their assignment Dec 2, 2021
@enocom enocom added priority: p3 Desirable enhancement or fix. May not be included in next release. and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Dec 2, 2021
@enocom enocom added priority: p0 Highest priority. Critical issue. P0 implies highest priority. and removed priority: p3 Desirable enhancement or fix. May not be included in next release. labels Oct 13, 2022
@enocom
Copy link
Member

enocom commented Oct 13, 2022

Bumping up the priority as there's significant interest in this.

@enocom
Copy link
Member

enocom commented Oct 13, 2022

We'll probably use mcr.microsoft.com/windows/servercore:ltsc2022 as the base image based on what I see here: https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/main/windows-container-samples.

@enocom
Copy link
Member

enocom commented Oct 13, 2022

@enocom
Copy link
Member

enocom commented Oct 13, 2022

Here's a rough take on what we might do. I'm not sure what the licensing details would be of distributing this.

FROM --platform=windows/amd64 golang:1 as build

WORKDIR /go/src/cloud-sql-proxy
COPY . .

RUN go get ./...
RUN GOOS=windows GOARCH=amd64 \
    go build -ldflags "-X main.metadataString=container.windows"

# Final stage
FROM --platform=windows/amd64 mcr.microsoft.com/windows/servercore:ltsc2022

COPY --from=build /go/src/cloud-sql-proxy/cloud-sql-proxy /cloud-sql-proxy
ENTRYPOINT ["/cloud-sql-proxy"]

@enocom enocom self-assigned this Oct 13, 2022
@github-actions github-actions bot removed the windows label Nov 4, 2022
@enocom
Copy link
Member

enocom commented Nov 16, 2022

And bumping it back down after some further discussion. Feel free to thumbs-up this issue if it's interesting for you.

@enocom enocom added priority: p2 Moderately-important priority. Fix may not be included in next release. and removed priority: p0 Highest priority. Critical issue. P0 implies highest priority. labels Nov 16, 2022
@balys
Copy link

balys commented Nov 18, 2022

hi @enocom, we currently have a project where not having a windows based cloudsql-proxy image is a blocker. Would it be possible to add this?

@enocom
Copy link
Member

enocom commented Nov 18, 2022

Is there any reason why you can't build your own container image using the example from #957 (comment)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

6 participants