Unknown flag: --generator?

Hai All.
I’m very new in kubernetes, I still don’t know to solved this. I have question how to create ReplicationController with command kubectl ctl run in kubernetes?
I type this and with this error:

kubectl run --generator=run-pod/v1 kubia --image=afiadi/mycontainer:kubia --port=8080 
Error: unknown flag: --generator
See 'kubectl run --help' for usage

I fioud tutorial on the internet, is working but in my system isn’t working, without replicationcontrollers I can’t scala up horizontal my pod in kubernetes. Or there is other method to scala up horizontaslly pod in kubernetes without create first replicationcontrolllers?

Thank You in Advance
Best regards,
Afiadi

Hi Afiadi:

Try this Run a Stateless Application Using a Deployment | Kubernetes task from the official Kubernetes documentation.

With kubectl run nginx --image=nginx -n mynamespace you’ll create a single pod which is not what you need if you want to scale your application.

The Deployment object will create ReplicaSets (and pods). With the Deployment you can scale up or down the number of pods and perform rolling updates (Deployments | Kubernetes) without service interruption.

Best regards,

Xavi