This article covers how to use Digitalocean kubectl. In fact, Kubectl is a command-line tool designed to manage Kubernetes objects and clusters. It provides a command-line interface for performing common operations like creating and scaling Deployments, switching contexts, and accessing a shell in a running container.
To test that kubectl can authenticate with and access your Kubernetes cluster, use cluster-info:
$ kubectl cluster-info
To view your kubectl configuration, use the view subcommand:
$ kubectl config view
To fetch a list of clusters defined in your kubeconfig, use get-clusters:
$ kubectl config get-clusters
The general syntax for most kubectl management commands is:
$ kubectl command type name flags
- command is an operation you'd like to perform, like create.
- type is the Kubernetes resource type, like deployment.
- name is the resource's name, like app_frontend.
- flags are any optional flags you'd like to include.