Kubernauts Kops Faststart
  • Introduction
  • Overview
    • Introduction
    • Pre-Requisites
  • Labs
    • Install Kops
    • Install Kubectl
    • Configure AWS
    • Create First Cluster
    • Deploy Dashboard
    • Create Additional Clusters
    • Advanced HA deployment
    • Deploy (existing) Apps with HelmPack
    • Wrap Up
  • Reference
    • Links
Powered by GitBook
On this page
  • Install
  • Enable Command Completion
  1. Labs

Install Kubectl

PreviousInstall KopsNextConfigure AWS

Last updated 7 years ago

To enable management of the Kubernetes cluster the kubectl command is used.

Install

Download the kubectl command.

On Mac

$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl

On Linux

$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl

Setup kubectl permissions and move it to the bin/ directory.

$ chmod +x kubectl
$ sudo mv kubectl /usr/local/bin/

Confirm the version of kubectl.

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.1",.. ", GoVersion:"go1.8.3"

Note As the Kubernetes API server is not yet deployed the kubectl version command will take a while to timeout before showing you the version.

To further configure kubectl please refer to the great documentation on the site.

Enable Command Completion

Enable Bash completetion for kubectl.

On Mac

If running Bash 3.2 (included with macOS).

$ brew install bash-completion
$ kubectl completion -h
$ source $(brew --prefix)/etc/bash_completion

On Linux

$ source <(kubectl completion bash)
$ echo "source <(kubectl completion bash)" >> ~/.bashrc

NEXT PREVIOUS

kubernetes.io
Configure AWS
Install Kops