Difference between revisions of "Aws eks update-kubeconfig"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
|||
(27 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{lowercase}} | {{lowercase}} | ||
− | <code>[[aws eks]] update-kubeconfig</code> configures <code>[[kubectl]]</code> so that you can connect to an Amazon EKS cluster. | + | <code>[[aws eks]] update-kubeconfig</code> configures <code>[[kubectl]]</code> so that you can [[connect]] to an Amazon EKS cluster. |
* https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-kubeconfig.html | * https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/update-kubeconfig.html | ||
− | aws eks update-kubeconfig --region [[us-east-2]] --name education-eks-LZIQaQdP | + | [[aws eks list-clusters]] --output text | awk '{print $2}' | xargs -n1 [[aws eks]] update-kubeconfig --name |
+ | [[Added new context]] arn:aws:eks:eu-central-1:0987654321:cluster/production-eks-3yxD5aRA to /Users/my_user[[/.kube/config]] | ||
+ | |||
+ | aws eks update-kubeconfig [[--region]] [[us-east-2]] --name education-eks-LZIQaQdP | ||
Added new context arn:aws:eks:us-east-2:0987654321:cluster/education-eks-LZIQaQdP to /Users/my_user/[[.kube/config]] | Added new context arn:aws:eks:us-east-2:0987654321:cluster/education-eks-LZIQaQdP to /Users/my_user/[[.kube/config]] | ||
+ | [[aws eks]] update-kubeconfig --name my-eks-cluster-name | ||
+ | Updated context arn:aws:eks:us-east-2:0987654321:cluster/my-eks-cluster-name< in /Users/MY_USER/[[.kube/config]] | ||
+ | |||
+ | [[aws eks update-kubeconfig --name eks-cluster-name --region aws-region --role-arn]] | ||
− | + | ||
− | + | * <code>[[aws eks]] --region $([[terraform output]] -raw region) update-kubeconfig --name $([[terraform output -raw cluster_name]])</code> | |
− | + | aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) | |
+ | Added new context arn:aws:eks:us-east-2:012345678912:cluster/education-eks-Ry318DCv to [[/Users/]]your_user/[[.kube/config]] | ||
+ | == Errors == | ||
+ | [[error: You must be logged in to the server (Unauthorized)]] | ||
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) | aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) | ||
'[[NoneType]]' object is not iterable | '[[NoneType]]' object is not iterable | ||
Solution: rm [[~/.kube/config]] and execute it again | Solution: rm [[~/.kube/config]] and execute it again | ||
+ | |||
+ | |||
+ | [[the server has asked for the client to provide credentials]] | ||
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) | aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) | ||
− | + | ||
+ | [[Unable to parse config file]]: [[~/.aws/config]] | ||
== Synopsys == | == Synopsys == | ||
Line 32: | Line 46: | ||
[--verbose] | [--verbose] | ||
[--alias <value>] | [--alias <value>] | ||
+ | |||
+ | == Activities == | ||
+ | * Understand implication of using <code>[[--role-arn]]</code> in your <code>[[aws eks]] update-kubeconfig</code> | ||
+ | * [[How do I resolve an unauthorized server error when I connect to the Amazon EKS API server?]] | ||
+ | * [[Creating or updating a kubeconfig file for an Amazon EKS cluster]] | ||
== Related == | == Related == | ||
− | * <code>[[.kube/config]]</code> | + | * <code>[[~/.kube/config]]</code> |
* <code>[[eksctl get cluster --all-regions]]</code> | * <code>[[eksctl get cluster --all-regions]]</code> | ||
* <code>[[aws eks list-clusters]]</code> | * <code>[[aws eks list-clusters]]</code> | ||
Line 40: | Line 59: | ||
* <code>[[kubectl cluster-info]]</code> | * <code>[[kubectl cluster-info]]</code> | ||
* <code>[[aws eks list-clusters]] --output text | awk '{print $2}' | xargs -n1 [[aws eks update-kubeconfig]] --name</code> | * <code>[[aws eks list-clusters]] --output text | awk '{print $2}' | xargs -n1 [[aws eks update-kubeconfig]] --name</code> | ||
+ | * <code>[[gcloud container clusters get-credentials]]</code> | ||
+ | * [[Connect to K8s cluster]] | ||
+ | * <code>[[kubectl config rename-context]]</code> | ||
+ | * <code>[[aws eks get-token]]</code> | ||
+ | * [[Amazon EKS authorization]] | ||
== See also == | == See also == | ||
− | * {{ | + | * {{aws eks update-kubeconfig}} |
+ | * {{aws-auth}} | ||
* {{aws eks}} | * {{aws eks}} | ||
+ | * {{K8s installation}} | ||
[[Category:AWS]] | [[Category:AWS]] |
Latest revision as of 09:10, 21 June 2024
aws eks update-kubeconfig
configures kubectl
so that you can connect to an Amazon EKS cluster.
aws eks list-clusters --output text | awk '{print $2}' | xargs -n1 aws eks update-kubeconfig --name Added new context arn:aws:eks:eu-central-1:0987654321:cluster/production-eks-3yxD5aRA to /Users/my_user/.kube/config
aws eks update-kubeconfig --region us-east-2 --name education-eks-LZIQaQdP Added new context arn:aws:eks:us-east-2:0987654321:cluster/education-eks-LZIQaQdP to /Users/my_user/.kube/config
aws eks update-kubeconfig --name my-eks-cluster-name Updated context arn:aws:eks:us-east-2:0987654321:cluster/my-eks-cluster-name< in /Users/MY_USER/.kube/config
aws eks update-kubeconfig --name eks-cluster-name --region aws-region --role-arn
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) Added new context arn:aws:eks:us-east-2:012345678912:cluster/education-eks-Ry318DCv to /Users/your_user/.kube/config
Contents
Errors[edit]
error: You must be logged in to the server (Unauthorized)
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name) 'NoneType' object is not iterable Solution: rm ~/.kube/config and execute it again
the server has asked for the client to provide credentials
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
Unable to parse config file: ~/.aws/config
Synopsys[edit]
update-kubeconfig --name <value> [--kubeconfig <value>] [--role-arn <value>] [--dry-run] [--verbose] [--alias <value>]
Activities[edit]
- Understand implication of using
--role-arn
in youraws eks update-kubeconfig
- How do I resolve an unauthorized server error when I connect to the Amazon EKS API server?
- Creating or updating a kubeconfig file for an Amazon EKS cluster
Related[edit]
~/.kube/config
eksctl get cluster --all-regions
aws eks list-clusters
kubectl get nodes
kubectl cluster-info
aws eks list-clusters --output text | awk '{print $2}' | xargs -n1 aws eks update-kubeconfig --name
gcloud container clusters get-credentials
- Connect to K8s cluster
kubectl config rename-context
aws eks get-token
- Amazon EKS authorization
See also[edit]
aws eks update-kubeconfig
- AWS IAM Authenticator for Kubernetes:
aws-auth, kubectl edit -n kube-system configmap/aws-auth, eksctl create iamidentitymapping
,mapUsers:, mapRoles:, mapAccounts:
- AWS EKS:
AWS::EKS
,aws eks [ create-cluster | list-clusters
|describe-cluster
|update-kubeconfig | list-updates | list-addons | update-cluster-version | update-nodegroup-version | get-token | create-addon ]
- Kubernetes installation, Deploy EKS cluster using Terraform, Create your first EKS Cluster using AWS Management Console,
kubeadm init, eksctl create cluster
Advertising: