kubectl error: unknown flag: –generator

C:\Windows\system32>kubectl run kubia --image=gcr.io/google-samples/hello-app:1.0 --port=8083 --generator=run/v1
error: unknown flag: --generator
See 'kubectl run --help' for usage.

Before k8s v1.18, we use this to create a pod. Now k8s version v1.18+, we don’t need to use this anymore to create a pod.
Simply run the below command to create a pod:

kubectl run kubia --image=gcr.io/google-samples/hello-app:1.0 --port=8083

pod/kubia created

C:\Windows\system32>kubectl get pods
NAME                   READY   STATUS    RESTARTS   AGE
kubia                  1/1     Running   0          4m28s
web-6bf786c76b-tlxcp   1/1     Running   0          142m