A kubeconfig is a Kubernetes client configuration file that records cluster connection details, credentials, and contexts. Client tools such as kubectl use it to select and access clusters. section 3.2 section 5.3
A kubeconfig can define:
- A cluster name, API server address, and certificate-authority data. section 5.3
- A user identity, such as a service account token. section 5.3
- A context that associates a cluster with a user and can become the current context. section 5.3
- Different access targets, such as a load-balanced admin-cluster address or an internal API server address. section 3.2
Registering an external cluster
An administrator can generate a kubeconfig for an EKS, AKS, or conformant Kubernetes cluster and provide it to a gcloud cluster-registration command. A manually assembled configuration supplies certificate data, server information, a service-account token, and a named context. section 5.3
Connecting without a jump host
After configuring service-account impersonation, an administrator can use gcloud to generate a kubeconfig for an Anthos-registered cluster. kubectl then reaches the cluster through the Connect Agent from a local machine, with access secured by Google Cloud Identity. section 5.5
apiVersion: v1 kind: Config users: - name: svcs-acct-dply user: token: <replace this with token info> clusters: - cluster: certificate-authority-data: <replace this with certificate-authority-data info> server: <replace this with server info> name: self-hosted-cluster contexts: - context: cluster: self-hosted-cluster user: svcs-acct-dply name: svcs-acct-context current-context: svcs-acct-context
Inspect a complete minimal configuration showing the Config object, cluster, user, context, token placeholder, certificate data, and server fields. section 5.3


