Kubernetes scanner commands issue

Hello Everyone,

I have issue with this command as when i execute in terminal i got Flag --generator has been deprecated

Can anyone help me out with this issue.

kubectl run --generator=run-pod/v1 net-test --image=net/bot:latest --env="FX_HOST=cloudnetwork.net.com --env=“FX_IAM=Mwc/0zF7dfX+PUq6JxxxxxdbFUExxeL5” --env=“FX_KEY=chFPCKn+EB00tUxxxwX0WuYlLCtM1Gr/kQxx+UxR1nxxK6nSrvxxxOFT8Mo” --replicas=2

Flag --generator has been deprecated, has no effect and will be removed in the future.Flag --replicas has been deprecated, has no effect and will be removed in the future.Error from server (BadRequest): the server rejected our request for an unknown reason

Hey, @MdRashid
What is your cluster version?
In version v1.18+, We don’t require to add --generator flag to create a pod. Try once without that flag.

If you’re thinking to create a deployment then below command will helpful to you:

kubectl create deployment --help

In above command, you can add –replicas flag also, introduced in version v1.19.
For future reference:
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#run

In kubectl run --generator=run-pod/v1 test --image=test:latest --env=“host=cloudnetwork.com” --env=“Host=MwcxxxxxxxxxxxxxxUE13eL5” --env=“Key=chFPxxxxxxxxxxxxxLCtM1Gr/kQA3G+UxR1xxxxxxxxxxTcOFT8Mo” --replicas=2

With above kubectl run command we used to pass environment variable as --env=“Key=Value”

How should i pass environment variable using kubectl create deployment command