Installing kubectl

Kubernetes uses a command-line utility called kubectl for communicating with the cluster API server. The kubectl binary is available in many operating system package managers, and this option is often much easier than a manual download and install process. You can follow the instructions for your specific operating system or package manager in the Kubernetes documentation to install.

This topic helps you to download and install the Amazon EKS-vended kubectl binaries for MacOS, Linux, and Windows operating systems.

MacOS

This section helps you to install kubectl for MacOS clients.

To install kubectl on MacOS

  1. Download the Amazon EKS-vended kubectl binary from Amazon S3:

     
    curl -o kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/darwin/amd64/kubectl
  2. (Optional) Verify the downloaded binary with the SHA-256 sum for your binary.

    1. Download the SHA-256 sum for MacOS:

       
      curl -o kubectl.sha256 https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/darwin/amd64/kubectl.sha256
    2. Check the SHA-256 sum for your downloaded binary.

       
      openssl sha -sha256 kubectl
    3. Compare the generated SHA-256 sum in the command output against your downloaded SHA-256 file. The two should match.

  3. Apply execute permissions to the binary.

     
    chmod +x ./kubectl
  4. Copy the binary to a folder in your PATH. If you have already installed a version of kubectl, then we recommend creating a $HOME/bin/kubectl and ensuring that$HOME/bin comes first in your $PATH.

     
    mkdir $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH
  5. (Optional) Add the $HOME/bin path to your shell initialization file so that it is configured when you open a shell.

     
    echo 'export PATH=$HOME/bin:$PATH' >> ~/.bash_profile
  6. After you install kubectl, you can verify its version with the following command:

     
    kubectl version --short --client

Linux

This section helps you to install kubectl for Linux clients.

To install kubectl on Linux

  1. Download the Amazon EKS-vended kubectl binary from Amazon S3:

     
    curl -o kubectl https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/kubectl
  2. (Optional) Verify the downloaded binary with the SHA-256 sum for your binary.

    1. Download the SHA-256 sum for Linux:

       
      curl -o kubectl.sha256 https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/kubectl.sha256
    2. Check the SHA-256 sum for your downloaded binary.

       
      openssl sha -sha256 kubectl
    3. Compare the generated SHA-256 sum in the command output against your downloaded SHA-256 file. The two should match.

  3. Apply execute permissions to the binary.

     
    chmod +x ./kubectl
  4. Copy the binary to a folder in your PATH. If you have already installed a version of kubectl, then we recommend creating a $HOME/bin/kubectl and ensuring that$HOME/bin comes first in your $PATH.

     
    mkdir $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$HOME/bin:$PATH
  5. (Optional) Add the $HOME/bin path to your shell initialization file so that it is configured when you open a shell.

    Note

    This step assumes you are using the Bash shell; if you are using another shell, change the command to use your specific shell initialization file.

     
    echo 'export PATH=$HOME/bin:$PATH' >> ~/.bashrc
  6. After you install kubectl, you can verify its version with the following command:

     
    kubectl version --short --client

Windows

This section helps you to install kubectl for Windows clients with PowerShell.

To install kubectl on Windows

  1. Open a PowerShell terminal.

  2. Download the Amazon EKS-vended kubectl binary from Amazon S3:

     
    curl -o kubectl.exe https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/windows/amd64/kubectl.exe
  3. (Optional) Verify the downloaded binary with the SHA-256 sum for your binary.

    1. Download the SHA-256 sum for Windows:

       
      curl -o kubectl.exe.sha256 https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/windows/amd64/kubectl.exe.sha256
    2. Check the SHA-256 sum for your downloaded binary.

       
      Get-FileHash kubectl.exe
    3. Compare the generated SHA-256 sum in the command output against your downloaded SHA-256 file. The two should match, although the PowerShell output will be uppercase.

  4. Copy the binary to a folder in your PATH. If you have an existing directory in your PATH that you use for command-line utilities, copy the binary to that directory. Otherwise, complete the following steps.

    1. Create a new directory for your command-line binaries, such as C:\bin.

    2. Copy the kubectl.exe binary to your new directory.

    3. Edit your user or system PATH environment variable to add the new directory to your PATH.

    4. Close your PowerShell terminal and open a new one to pick up the new PATH variable.

  5. After you install kubectl, you can verify its version with the following command:

     
    kubectl version --short --client

refer: https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html

Installing kubectl的更多相关文章

  1. kubernetes installing and using 单机版

    centos安装docker uname -r yum remove docker \ docker-client \ docker-client-latest \ docker-common \ d ...

  2. installing mysql,this may take a few minutes,hold on plz wdcp卡住解决办法

    centos6安装wdcp时make in progress卡住的解决办法 今天在一台centos6的vps上安装wdcp出现的这个问题,到安装程序滚动至下面这里时出现"卡死". ...

  3. MSI Error 1603 installing AppFabric 1.1 / Win7 x64

    MSI Error 1603 installing AppFabric 1.1 / Win7 x64  Archived Forums A-B > AppFabric Caching   先说解 ...

  4. [转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only

    Okay for centos 6.4 also On apu.0xdata.loc, after this install was done $ which python /usr/local/bi ...

  5. [转]Installing SharePoint 2013 on Windows Server 2012 R2

    转自:http://www.avivroth.com/2013/07/09/installing-sharepoint-2013-on-windows-server-2012-r2-preview/ ...

  6. 安装mysql odbc遇到error 1918.errror installing ODBC driver mysql ODBC 5.3 ANSI Drive

    环境:Windows server2008r2 安装mysql-connector-odbc-5.3.6-win32 报错 相信错误信息:Error 1918.errror installing OD ...

  7. Using Confluent’s JDBC Connector without installing the entire platform

    转自:https://prefrontaldump.wordpress.com/2016/05/02/using-confluents-jdbc-connector-without-installin ...

  8. Cocoapods的安装报错 - Error installing pods:activesupport requires Ruby version >=2.2.2

    1.打开终端 2 移除现有 Ruby 默认源 输入以下指令 $gem sources --remove https://rubygems.org/ 3.使用新的源 输入以下指令 $gem source ...

  9. Installing Hadoop on Mac OSX Yosemite Tutorial Part 1.

    Installing Hadoop on Mac OSX Yosemite Tutorial Part 1. September 23, 2014 Marek 68 Comments Install ...

随机推荐

  1. loadrunner socket协议问题归纳(2)

    编写步骤 1.建立与服务端的连接 rc=lrs_create_socket(“socket0”,”TCP”,”LocalHost=0”,”RemoteHost=127.0.0.1:8808”,LrsL ...

  2. "感应锁屏"Alpha版使用说明

    “感应锁屏”Alpha版使用说明 一.产品介绍 感应锁屏是锁屏软件的一大创新.相比传统的锁屏软件,“感应锁屏”从可操作性.方便性.功能全面性都有了很大的提升,可以让用户方便快捷的进行锁屏操作. “感应 ...

  3. Linux 安装php扩展 swoole

    swoole是一个PHP的异步.并行.高性能网络通信引擎,使用纯C语言编写,提供了PHP语言的异步多线程服务器,异步TCP/UDP网络客户端,异步MySQL,异步Redis,数据库连接池,AsyncT ...

  4. 【最小生成树+LCA】Imperial roads

    http://codeforces.com/gym/101889 I 先跑一遍最小生成树,把经过的边和答案记录下来 对于每个询问的边,显然如果处于MST中,答案不变 如果不在MST中,假设这条边连上了 ...

  5. ext4.1入门

    ExtJS简介 Ext是一个Ajax框架,用于在客户端创建丰富多彩的web应用程序界面,是在Yahoo!UI的基础上发展而来的.官方网址:www.sencha.com ExtJS是一个用来开发前端应用 ...

  6. Codeforces Beta Round #6 (Div. 2 Only) 单调队列

    题目链接: http://codeforces.com/contest/6/problem/E E. Exposition time limit per test 1.5 secondsmemory ...

  7. 敏捷冲刺DAY5

    一. 每日会议 1. 照片 2. 昨日完成工作 发布和提供需求功能的实现 用户修改自己的信息 用户界面设计 管理员界面设计 3. 今日完成工作 4. 工作中遇到的困难 1.设置的背景无法显示. 2.一 ...

  8. phpcms 思维导图

    原文地址 : https://www.cnblogs.com/fuyunbiyi/archive/2012/03/12/2391253.html

  9. HDU4822-Tri-War

    题目 给出一颗树,\(m\)次询问树上不相同的三个点\(A,B,C\).我们称一个点\(x\)被\(A\)占领当且仅当\(dist(A,x)>dist(B,x),dist(A,x)>dis ...

  10. BZOJ 1189 紧急疏散(二分+最大流)

    求出所有人撤离的最短时间.由于每扇门只能通过一次,所以不能简单用bfs来搞. 显然答案是有单调性的,考虑二分,问题变成了判断时间x所有人能不能撤离. 考虑最大流.对于每扇门,每个时间通过的人数最多为1 ...