kubectl json code example
Example 1: kubectl restart deployment
kubectl rollout restart deployment yourDeploymentName
Example 2: kubernetes get services
# Get pods in default namespace
kubectl get services
#Get Pods in my-namespace
kubectl get services -n my-namespace
#Get Pods in all namespaces
kubectl get services --all-namespaces
Example 3: kubectl describe to yaml
kubectl describe <type> <name> -o yaml