Aram
Aram

Reputation: 5705

Running Windows Docker Images on Kubernetes Cluster, installed on Windows 10

I have installed Kubernetes Cluster (minikube) on my Windows 10 machine and seems to be running (ie: I can browse the minikube dashboard, etc).

kubernetes cluster status

I also have a Windows Image (has an Asp.Net Web API .Net framework 4.6 Application in it) on Azure Container Registry that I would like to pull and deploy to my local Kubernetes Cluster.

I have built the following yaml file to create the Kubernetes deployment:

apiVersion: v1
kind: Pod
metadata:
  name: hubapi
spec:
  containers:
  - name: hubapi
    image: lgmimages.azurecr.io/hubapi/hubapi
  imagePullSecrets:
  - name: azurepasswordsecret

When I run this command:

kubectl create -f hubapi.yaml

and I see:

pod "hubapi" created

Then when I go to the dashboard or get Pod Description I see the following error:

kubelet, minikube  Failed to pull image "lgmimages.azurecr.io/hubapi/hubapi": rpc error: code = Unknown desc = image operating system "windows" cannot be used on this platform

I was wondering what I am missing here and is what I am trying to do is even possible?

Note: It works when I use this command and pull nginx image from dockerhub:

kubectl run kubernetes-nginx --image=nginx:latest --port=80

Then I expose this service and I can browse the nginx web page on my local Cluster.

Upvotes: 4

Views: 2983

Answers (3)

Cosmin Sontu
Cosmin Sontu

Reputation: 1104

Instead of minikube you can use Docker for Windows with Windows containers mode on (Switch to Windows containers... context menu option from system tray).

Upvotes: 0

Frederik Carlier
Frederik Carlier

Reputation: 4776

If you want to set up a Kubernetes cluster with nodes running both Windows and Linux, you can give (kubernetes-windows-vagrant)[https://github.com/rjmorse/kubernetes-windows-vagrant] a try. It uses Vagrant to provision the environment.

Upvotes: 0

Jason Ye
Jason Ye

Reputation: 13954

rpc error: code = Unknown desc = image operating system "windows" cannot be used on this platform

Actually, we install kubernetes on windows 10 bash on Ubuntu, in this way, the bash on ubuntu works as a master, base on Linux, we can't run windows docker image on it.

As we know, kubernetes master should be a Linux, you have not other nodes, so we can't run windows docker image on it.

For test, you can use Azure container service and deploy kubernetes with windows nodes, in this way, we can run Windows docker image on the k8s windows nodes.

Hope this helps:)

Upvotes: 1

Related Questions