Unknown image flag when creating deployment using Minikube kubectl

Viewed 2225

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>
2 Answers

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

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
Related