Search code examples
azuredockerkubectlazure-aks

How do I run a dockerized 'Hello World' web job deployed into Virtual Kubelet within Azure Kubernetes Service (AKS)


I did create a simple 'Hello World' Web Job and placed that Web Job inside a Docker Windows Container/Nanoserver

I did push that Docker Windows Container into an Azure Container Registry

I did follow this article and successfully created Virtual AKS pods/nodes

When I run 'get pods' I do see the pods created and running

I do see IP's generated reflected in the 'get pods' command

My question is how do I run the container inside these pods/nodes?

I did try to reference the IP's but those IP's don't load anything

How can I run those containers that I successfully placed into Virtual Kubelet pods/nodes

If the containers in the get fired up by themselves, do they fire up/get invoked only once or every n number of minutes?

Is there a way to check on how the last run went, like log files?

Thank you very much for your help


Solution

  • First of all, I see you create your web job inside a Windows-based Docker. If so, you cannot run the container in the AKS while it does not support Windows nodes, at least current. For window container, I suggest you could use the Azure Container Instance or Web App for Container.

    For Linux containers, the pod in AKS is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers. If you already have the Docker image, you can create the container inside the pod follow the steps in Running the application in AKS.

    In addition, you can set the restart policy for your container. See Restart Policy for the container in Kubernetes. For the logs, I suggest you could use the persist volumes. If not, the files will be lost if the container crash.\

    Update

    If you really want to run windows container in AKS cluster, there is also a way for you. You can use the virtual Kubelet and Azure Container Instance in AKS. Follow the steps Run Windows container in AKS.