"image" not set error happening in kuberctl trying to create deployment

3/27/2019

I'm working through a tutorial and trying create a deployment using this command:

kubectl run alpaca-prod \ --image=repo/practice:1 \
 --replicas=3 \ 
--port=8080 \ 
--labels="ver=1,app=alpaca,env=prod

I get this error:

Error: required flag(s) "image" not set
-- jenkelblankel
kubernetes

1 Answer

3/27/2019

The bash command line break is incorrect and also missing a trailing quotation mark. The command below should work:

kubectl run alpaca-prod \
  --image=repo/practice:1 \
  --replicas=3 \
  --port=8080 \
  --labels="ver=1,app=alpaca,env=prod"

Hope this helps!

-- Frank Yucheng Gu
Source: StackOverflow