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. ES6的新特性(17)——Generator 函数的异步应用

    Generator 函数的异步应用 异步编程对 JavaScript 语言太重要.Javascript 语言的执行环境是“单线程”的,如果没有异步编程,根本没法用,非卡死不可.本章主要介绍 Gener ...

  2. js 零零散散的总结。

    Array.slice.call(arguments);可以将一个类数组转化为数组. Array.from() ,[...arr];也可以将一个类数组转化为数组(es6). (function() { ...

  3. 敏捷开发与xp实践 实验报告

    20162315 敏捷开发与xp实践 实验报告 实验任务 1.在IDEA中使用工具(Code->Reformate Code)把下面代码重新格式化,再研究一下Code菜单,找出一项让自己感觉最好 ...

  4. 未能加载文件或程序集 system.Web.Http.WebHost解决办法。

    在csdn中找到一个方法: Update-Package Microsoft.AspNet.WebApi -reinstall 然后就好了. 另外一个方法是缺少哪个dll,就复制一个dll放到bin文 ...

  5. Beta阶段冲刺第二天

    提供当天站立式会议照片一张 讨论项目每个成员的昨天进展 错题集功能编写没有彻底完成. 界面改善 测试数据库连接 讨论项目每个成员的存在问题 邹其元:错题集功能需要用到数据库,现在要解决的问题是怎样把数 ...

  6. Geek荣耀大会总结

    0.0 首先没有被抽中, 其次可乐真难喝,再次我没有去拍无人机合影,再再次还是很受打击的. 1.0 其实 对geek 和1024大会无感,主要原因 没有三倍加班费的节日在我眼里都不是节日. 上面只是简 ...

  7. sleep() 与 wait()的比较

    1.这两个方法来自不同的类分别是,sleep来自Thread类,和wait来自Object类. sleep是Thread的静态类方法,谁调用的谁去睡觉,即使在a线程里调用了b的sleep方法,实际上还 ...

  8. eclipse错误:Access restriction: The type 'BASE64Decoder' is not API

    Access restriction: The type ‘BASE64Decoder’ is not API (restriction on required library ‘D:\java\jd ...

  9. spring 整合 struts2 + Hibernate application配置文件(基于注解)

    下面是 application.xml 文件. <?xml version="1.0" encoding="UTF-8"?> <beans x ...

  10. ONS发布订阅消息

    ONS, 全名Open Notification Service, 是阿里基于开源消息中间件RocketMQ的一个云产品. 首先,要申请阿里账号等.本地也可以申请阿里云账号自己调试.此处为公司拥有阿里 ...