vrapolinario / MinikubeWindowsContainers

This repo describes the steps for a prototype of Windows on MiniKube
41 stars 10 forks source link

Ingress not working when service backend is in a windows container #5

Open david-garcia-garcia opened 10 months ago

david-garcia-garcia commented 10 months ago

I was able to succesfully setup a K8S kluster with mixed windows and linux nodes thanks to this guide!

I setup the minikube ingress add-on (nginx) and was able to access services hosted on the linux nodes without issues using their hostname, but if the service is hosted on the windows node, the ingress times out when making the request to the service.

The container works, i can expose it with NodePort or exec into it. But when trying to expose it through the ingress, the ingress shows that a request is made to the ClusterIp assigned to the service (so host routing is working OK) but there must be some networking quirk that prevents the ingress from properly reaching the cluster IP for the container in the windows host.

I am totally lost, and 100% new to K8S but I believe this might be an issue considering that the project's main walkthrough does not use ingress to expose the service but a LoadBalancer service.

vrapolinario commented 10 months ago

Hi David, thanks for checking out the project. You are correct we only tested with minikube tunnel, since this is the supported way for Minikube itself. In fact, @bobsira had to make a few fixes to make it work.

As you pointed out, an ingress should work and for Linux it does. We have not yet gotten there yet for Windows. Can you validate the minikube tunnel works on your environment? I'll keep this issue open as something we'll want to look into, but getting the Windows instance integrated with Minikube is higher in our priority list.

leeseoungsuk1 commented 9 months ago

@vrapolinario

You configured a container using the image 'sirasira/mink-iis-logmonitor:latest' with the 'iis-log-moniter.yaml' file, and you're curious about how this image is structured. Could you provide information on the Dockerfile format and the base image used?

vrapolinario commented 8 months ago

Hi @leeseoungsuk1 this image is from @bobsira. Log Monitor is a tool to bring Windows logs and event, to SDTOUT. You can find more info on it here: https://github.com/microsoft/windows-container-tools/tree/main/LogMonitor

leeseoungsuk1 commented 8 months ago

@vrapolinario

Thank you. In Minikube, the master node is configured as Linux. Is there a way to download a Windows image to it? I can't find any information on this. I want to try implementing my own image in Minikube, not downloading from Docker Hub.

In Docker Desktop, when I convert Windows-based and Linux-based images to .tar files and load them, the Linux image gets uploaded to Minikube successfully, but there is no response for the Windows image.

vrapolinario commented 8 months ago

While in theory you can cross compile the Kubernetes binaries for Windows and Linux, the Kubernetes control-plane is only supported on Linux. Thus you can have a control plane running Linux and worker nodes running either Windows or Linux.

Remember that Minikube is not aware of the Windows node (at least not yet). All the work we're doing here is a workaround MiniKube to have the Windows node deployed. So, exporting the image to a tar file won't work.

leeseoungsuk1 commented 8 months ago

@vrapolinario Thank you. My curiosity has been resolved.

leeseoungsuk1 commented 8 months ago

@vrapolinario Hi "I tried to mount a local path using minikube mount in the .yaml file to run an executable in both the pod and the container. However, it seems that only minikube-control has the local path mounted, and the linux-worker doesn't work. Is there any solution? I also want to achieve this by mounting a local path on Windows Server 2019."

It seems that when setting up Minikube with a master and a Linux worker on a single node, the mount works for the master, but not for the worker.