~/.kube/config
(Redirected from /.kube/config)
Jump to navigation
Jump to search
~/.kube/config kubectl --kubeconfig ~/.kube/yourclusterconfig
apiVersion: v1 clusters: null contexts: null current-context: "" kind: Config preferences: {} users: null
Configure[edit]
- EKS:
aws eks update-kubeconfig --name my-eks-cluster-name - GKE:
gcloud container clusters get-credentials MyClusterName - Minikube:
minikube update-context
Examples[edit]
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
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_aws_profile
Example[edit]
- name: your-cluster-name user: auth-provider: config: access-token: ya29.a0AVA9y1sXXXXC-z107gauQ0174 cmd-args: config config-helper --format=json cmd-path: /Users/my-user/brew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/gcloud expiry: "2022-08-25T15:03:28Z" expiry-key: '{.credential.token_expiry}' token-key: '{.credential.access_token}' name: your-name
Errors[edit]
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 .../...
error: You must be logged in to the server (Unauthorized)
Activites[edit]
Related[edit]
- https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html
kubectl configkubectl konfig mergekubectl get nodes,kubectl get svc- Terraform: Kubernetes provider, Terraform helm provider
aws eks get-token- Connect to K8s cluster
- AWS:
aws eks update-kubeconfig --name my-eks-cluster-name - GCP:
gcloud container clusters get-credentials MyClusterName
- AWS:
kubectl config rename-contextkubectl authkubectl config view --flattenrancher cluster kubeconfig- Install kubectl
kubectl --contextaz aks get-credentials- ~/.minikube/config/config.json
See also[edit]
kubectl config[view | get-contexts | current-context | get-clusters | set-context | set-credentials ], ~/.kube/config, kubectl config --help,kubectx, Kubernetes contexts,KUBECONFIG, kubectl --kubeconfig,kind: Config- Terraform EKS, Terraform EKS module, Deploy EKS cluster using Terraform, Terraform EKS apply output,
terraform show, ~/.kube/config,aws_eks_cluster, aws_eks_addon, module.eks_managed_node_group, eks-cluster.tf, node_groups, worker_groups
Advertising: