Install Kubernetes Client on MacOS

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives the steps to install setup Kubernetes Command-Line client (kutbctl) on Mac OS X using Homebrew or Docker Desktop.


Environment

  • Mac OS X Yosimite 10.14.5
  • Homebrew 2.1.6


Prerequisites


Install (Option 1)

If we are going to use Docker Desktop package and select to have it spin up a local Kubernetes environment. It will install the kubernetes client for you. Install Kubernetes Cluster on MacOS


Install (Option 2)

brew install kubectl


Configure

Configuration Location = $HOME/.kube/config

View Config on CLI

kubectl config view

Example

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://127.0.0.1:6443
  name: docker-desktop
contexts:
- context:
    cluster: docker-desktop
    user: docker-desktop
  name: docker-desktop
current-context: docker-desktop
kind: Config
preferences: {}
users:
- name: docker-desktop
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED

Version

kubectl version

Example

Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:25:46Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}


Related