Difference between revisions of "~/.kube/config"

From wikieduonline
Jump to navigation Jump to search
Line 60: Line 60:
 
* [[Terraform: Kubernetes provider]]
 
* [[Terraform: Kubernetes provider]]
 
* AWS: <code>[[aws eks update-kubeconfig]] --name my-eks-cluster-name</code>
 
* AWS: <code>[[aws eks update-kubeconfig]] --name my-eks-cluster-name</code>
* GCP: <code>[[gcloud container clusters get-credentials]]</code>
+
* GCP: <code>[[gcloud container clusters get-credentials]] [[MyClusterName]]</code>
 
* [[Config]]
 
* [[Config]]
  

Revision as of 11:47, 22 August 2022

~/.kube/config
apiVersion: v1
clusters: null
contexts: null
current-context: ""
kind: Config
preferences: {}
users: null

Example

apiVersion: v1 
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiDATAREMOVEDCg==
    server: https://00AXXXXXXXXXX1B.gr7.us-east-2.eks.amazonaws.com
  name: arn:aws:eks:us-east-2:123455:cluster/education-eks-Ry318DCv 
contexts:
- context:
    cluster: arn:aws:eks:us-east-2:123456:cluster/education-eks-Ry318DCv
    user: arn:aws:eks:us-east-2:123455:cluster/education-eks-Ry318DCv
  name: arn:aws:eks:us-east-2:123456:cluster/education-eks-Ry318DCv 
current-context: arn:aws:eks:us-east-2:123456:cluster/education-eks-Ry318DCv 
kind: Config
preferences: {}
 users:
 - name: arn:aws:eks:us-east-2:123456:cluster/education-eks-Ry318DCv
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - us-east-2
      - eks
      - get-token
      - --cluster-name
      - education-eks-Ry318DCv
      command: aws
      env:
      - name: AWS_PROFILE
        value: your_profile

Errors

Error: unable to describe cluster control plane: AccessDeniedException: User: arn:aws:iam::0987654321:user/YOUR_USER is not authorized to perform: eks:DescribeCluster on resource: arn:aws:eks:xx-east-2:0987654321:cluster/my-eks-cluster-name with an explicit deny


kubectl get pods
error: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
aws --version
aws-cli/1.18.147 .../...

Related

See also

Advertising: