Create a deployment for test in Kubernetes in imperative way

Example 1:

kubectl create deployment hello-k8s --image k8s.gcr.io/echoserver:1.10
Example 2:
kubectl create deployment nginx --image=nginx