Home > OS >  Difference between two deployment commands in Kubernetes
Difference between two deployment commands in Kubernetes

Time:02-03

What is the difference between $kubectl create deploy and $kubectl create deployment? Google Cloud Fundamental's Lab is using kubectl create deploy command, but in the Kubernetes documentation/Interactive Tutorial (https://kubernetes.io/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive/), it is using the command kubectl create deployment. So just wanted to ask this group, which one is the correct/latest?

CodePudding user response:

They meant the same. You can find the SHORTNAMES for K8s resource with kubectl api-resources.

CodePudding user response:

These deploy is a short-name for deployment, same as po for pod, you can see the full list of commands and their shortened versions with:

kubectl api-resources

CodePudding user response:

The kubectl create deploy and kubectl create deployment commands both create a deployment in Kubernetes. The only difference is that the kubectl create deploy command is a shorthand version of the kubectl create deployment command. The kubectl create deployment command is the more verbose version and provides more options for creating a deployment. The two commands are effectively interchangeable and both will create a Kubernetes deployment.Ultimately, it is up to the user to decide which syntax to use, as long as the deployment is created successfully.

As @gohmc and @fcmam5 said, The kubectl api-resources command prints a list of all of the available API resources in the Kubernetes cluster. The list includes the resource name, the kind of resource it is, and the API version it belongs to. Here is an example of the output of the command:

NAME                              KIND             APIVERSION
bindings                          Binding          v1
configmaps                        ConfigMap        v1
endpoints                         Endpoints        v1
events                            Event            v1beta1
limitranges                       LimitRange       v1
namespaces                        Namespace        v1
pods                              Pod              v1
replicationcontrollers            ReplicationController v1
resourcequotas                    ResourceQuota    v1
secrets                           Secret           v1
services                          Service          v1

As per this SO, you can also kubectl api-resources -o wide shows all the resources, verbs and associated API-group. For more information refer to this kubernetes cheatsheet

  • Related