Manu Chadha
Manu Chadha

Reputation: 16723

Unknown image flag when creating deployment using Minikube kubectl

I am getting unknown image flag when creating a deployment using minikube on windows 10 cmd. Why?

C:\WINDOWS\system32>minikube kubectl create deployment nginxdepl --image=nginx
Error: unknown flag: --image
See 'minikube kubectl --help' for usage.

C:\WINDOWS\system32>

Upvotes: 6

Views: 6347

Answers (2)

Jonas
Jonas

Reputation: 128827

When using kubectl bundled with minikube the command is little different.

From the documentation, your command should be:

minikube kubectl -- create deployment nginxdepl --image=nginx

The difference is the -- right after kubectl

Upvotes: 18

meaningqo
meaningqo

Reputation: 1918

there problem is your command. you are mixing kubectl and minikube.

minikube is for managing your one-node local dev cluster. kubectl is used for interacting with your cluster.

you should be using the following command:

kubectl create deployment nginxdepl --image nginx

Upvotes: 2

Related Questions