In Cloud Computing industry we can say AWS is one of the most popular among others for the benefits it provides.
Kubernetes is a software for deploying, scaling and managing docker based containerized applications and it is open source. Now a days Kubernetes is getting more popular in web application development DevOps culture of it’s Portability, Scalability, High Availability and Open Source advantages.
If you have your application Infrastructure is based on AWS powered Kubernetes cluster it’s always good to install KubeCTL CLI on your local machine to skip repeated ssh to your build server to manage your Kubernetes services. Here is how you can install AWS Kubernetes KubeCTL CLI on Windows with a simple few steps.
Step 1: Get AWS CLI Client installed
First you will need to get AWS CLI Client installed on your machine, you can get it from here https://aws.amazon.com/cli/
Just to make sure if it has been installed and accessible correctly you can test it via executing below code on your
You will get some information like this:
aws-cli/1.16.286 Python/2.7.16 Windows/10 botocore/1.13.22
Step 2: Get Kubernetes CLI Client installed
Secondly you will need to get Kubernetes CLI Client install on your machine which you can get from https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows
To see if it has been installed and accessible correctly you can test it via executing below code on your
Step 3: Configure AWS CLI
To configire you aws cli you will need two information like
aws_secret_access_key and you can configure it by executing below command:
AWS Access Key ID [None]: AKIAJXXXXXXEWDNXXXXX AWS Secret Access Key [None]: 2EqCQXXXXXuK3LXXXXXtZXMGNXXXXXVCHd0XXXXX Default region name [None]: eu-central-1 Default output format [None]: JSON
Step 4: Configure Amazon EKS (Elastic Kubernetes Service)
To configure Kubectl you can execute below command with
cluster name flag, make sure that cluster has been created on your aws platform.
aws eks --region eu-central-1 update-kubeconfig --name phpfarmer-kube1
if things is fine you will get some response like below response and you are done!
Added new context arn:aws:eks:eu-central-1:012345678910:cluster/phpfarmer-kube1 to ..../.kube/config
Now you can travel with kubectl locally like:
kubectl get services #to list the services
kubectl get pods --all-namespaces #to list the pods
kubectl get pods -n testing
kubectl get pods -n production
kubectl get jobs -n testing #to list all the jobs on testing namespace
kubectl delete job phpfarmer-testing-migrate #to delete a job
kubectl describe pods phpfarmer-testing-569c58cff8-k6p2n -n testing #to describe a single pod
kubectl exec -it phpfarmer-testing-569c58cff8-k6p2n -n testing bash #to get inside a pod
kubectl logs phpfarmer-testing-569c58cff8-k6p2n #to get the log of specific pod
kubectl get ingress -n testing #get all ingress for testing namespace
kubectl describe ingress internal-ingress -n testing #describe a specific ingress
There are more here https://kubernetes.io/docs/reference/kubectl/cheatsheet/