Skip to main content

Kuberenetes on AWS(EKS) Commands


Create Cluster from AWS Command Line
aws eks --region us-east-1 create-cluster --name development --kubernetes-version 1.14 --role-arn arn:aws:iam::356286290706:role/testuserrole --resources-vpc-config subnetIds=subnet-eef720c1,subnet-7d402619,securityGroupIds=sg-70aa0c05
Update Cluster from AWS Command Line
aws eks update-kubeconfig --name development --region us-east-1
Returns descriptive information about an Amazon EKS cluster.
$aws eks describe-cluster --name devel
Update the Kube Config in the file system
$export KUBECONFIG=~/.kube/awsdevconfig
Describe the AWS Kube Cluster
$aws eks describe-cluster --name cluster-name
This is to update the Kube configuaration, this needs to be run for switching the Kube config
Troubleshooting Kubectl errors :
To see the configuration of your AWS CLI user or role, run the following command:
aws sts get-caller-identity
Update AWS EKS Kubeconfig
aws eks update-kubeconfig --name eks-cluster-name --region aws-region
$aws eks --region region-name update-kubeconfig --name cluster-name
Update the config file path on the Path
$export KUBECONFIG=~/.kube/awsdevconfig
Get Kube Cluster information
$kubectl cluster-info
Get the Kube Pod information
$kubectl -n kcs-usdev get pods
Get the Kube Pod information details
$kubectl -n kube-system get pods
Open the file it would have gotten all the information from the remote cluster
$vi /Users/k.kanaparthi/.kube/awsdevconfig
Get all the deployments information on the cluster
$kubectl get deployments --all-namespaces
Get all services information deployed on the cluster
kubectl get svc --all-namespaces
Delete any services that have an associated EXTERNAL-IP value.
These services are fronted by an Elastic Load Balancing load balancer, and you must delete them in Kubernetes to allow the load balancer and associated resources to be properly released.
kubectl delete svc service-name
To view the raw metrics output, use kubectl with the --raw flag.
This command allows you to pass any HTTP path and returns the raw response.
kubectl get --raw /metrics
Delete all pods under a namespace.
kubectl delete --all pods --namespace=prometheus
Get all pods in the name space.
kubectl get pods
Describe a pod
kubectl describe pod/podname -n default
Tail the logs of a pod
kubectl logs --follow podname containername

Comments

Popular posts from this blog

Running Multiple Operating Systems(Windows and Ubuntu Linux) on the same machine

VMWare Player is a freely downloadable VMWare. Download VMWare player software and install it on your windows OS download an image of the Ubuntu Linux Desktop version called Ubuntu from http://www.ubuntu.com/getubuntu/download that in iso image format. Then download VMWare configuration bundle that contains a list of files, extract those file to some folder like C:\OS\. Then edit the file" os.vmx file and give the path of the .iso image in that file in the line like below. ide1:0.fileName = C:\OS\ubuntu-8.10-desktop-i386.iso" Now open the file os.vmx file using the vmware player, that will open the Ubuntu OS. You will get a list of options in that select the option install Ubuntu without changing your current configuration of the system Now that will start the Ubuntu OS in a window inside your windows OS. Now you have a browser and all the applications inside the Ubuntu OS, you can start working on that. Double click on this window/expand it to show in full screen. To switch ...