Install kubectl

The Kubernetes command-line tool, kubectl,[54] is used to run commands against Kubernetes clusters. You’ll use kubectl to inspect and manage your service’s cluster resources and view logs. Try to use kubectl for one-off operations. For operations you run again and again, like deploying or upgrading a service, you’ll use the Helm package manager or an operator, which we’ll take a look at later in this chapter.

To install kubectl, run the following:

 $ curl -LO ​\
 https://storage.googleapis.com/kubernetes-release/release/​\
 v1.18.0/bin/​$(​uname​)​/amd64/kubectl
 $ chmod +x ./kubectl
 $ mv ./kubectl /usr/local/bin/kubectl

We need a Kubernetes cluster and its API for kubectl to call and do anything. In the next section, we’ll ...

Get Distributed Services with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.