Skip to content

Set up kubectl

Kubernetes

Install kubectl

This guide assumes you have an EKS Cluster ready

Note the pricing of setting up EKS: Amazon EKS pricing

You can read about setting up EKS here: Set up EKS Cluster

You can follow this guide to setup EKS cluster with eksctl setup eks

First you need to configure your kubectl to work with eks.

In order to do that, follow the AWS documentation according to your OS.

At the time of writing this, current kubernetes version is 1.14 so use it for the kubectl installation as well.

You can verify the server & your client versions by running:

kubectl version

The output should be:

Client Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.7-eks-1861c5", GitCommit:"1861c597586f84f1498a9f2151c78d8a6bf47814", GitTreeState:"clean", BuildDate:"2019-09-24T22:12:08Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.9-eks-c0eccc", GitCommit:"c0eccca51d7500bb03b2f163dd8d534ffeb2f7a2", GitTreeState:"clean", BuildDate:"2019-12-22T23:14:11Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Note the Major:"1", Minor:"14+" on both, they should match.

Install kubectl

Install aws-iam-authenticator

This will allow you to Authenticate the EKS service.

Install aws-iam-authenticator

Make sure you upgrade aws-cli to latest version before proceeding.

Install aws-cli

Create kubeconfig for Amazon EKS

In this Demo, our cluster name is lab-eks and the aws region is us-east-1

So adjust them according to your details in order to create the kubeconfig and run:

aws eks --region us-east-1 update-kubeconfig --name lab-eks

If everything worked correctly you should now be able to run the below command without errors:

kubectl get svc

Continue to the next page

We will deploy an app to our Production EKS cluster.

Comments