File: //snap/google-cloud-cli/current/help/man/man1/gcloud_container_attached_clusters_get-credentials.1
.TH "GCLOUD_CONTAINER_ATTACHED_CLUSTERS_GET\-CREDENTIALS" 1
.SH "NAME"
.HP
gcloud container attached clusters get\-credentials \- get credentials of an Attached cluster
.SH "SYNOPSIS"
.HP
\f5gcloud container attached clusters get\-credentials\fR (\fICLUSTER\fR\ :\ \fB\-\-location\fR=\fILOCATION\fR) [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
Fetch credentials for a running Attached cluster.
This command updates a kubeconfig file with appropriate credentials and endpoint
information to point kubectl at a specific Attached cluster.
By default, credentials are written to \f5\fIHOME/.kube/config\fR\fR. You can
provide an alternate path by setting the \f5\fIKUBECONFIG\fR\fR environment
variable. If \f5\fIKUBECONFIG\fR\fR contains multiple paths, the first one is
used.
This command enables switching to a specific cluster, when working with multiple
clusters. It can also be used to access a previously created cluster from a new
workstation.
By default, the command will configure kubectl to automatically refresh its
credentials using the same identity as the gcloud command\-line tool. If you are
running kubectl as part of an application, it is recommended to use application
default credentials (https://cloud.google.com/docs/authentication/production).
To configure a kubeconfig file to use application default credentials, set the
\f5\fIcontainer/use_application_default_credentials\fR\fR Google Cloud CLI
property (https://cloud.google.com/sdk/docs/properties) to \f5\fItrue\fR\fR
before running the command.
See https://cloud.google.com/kubernetes\-engine/docs/kubectl for kubectl
documentation.
.SH "EXAMPLES"
To get credentials of a cluster named \f5\fImy\-cluster\fR\fR managed in
location \f5\fIus\-west1\fR\fR, run:
.RS 2m
$ gcloud container attached clusters get\-credentials my\-cluster \e
\-\-location=us\-west1
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Cluster resource \- cluster to get credentials. The arguments in this group can
be used to specify the attributes of this resource. (NOTE) Some attributes are
not given arguments in this group but can be set in other ways.
To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5cluster\fR on the command line with a fully specified
name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fICLUSTER\fR
ID of the cluster or fully qualified identifier for the cluster.
To set the \f5cluster\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5cluster\fR on the command line.
.RE
.sp
This positional argument must be specified if any of the other arguments in this
group are specified.
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
Google Cloud location for the cluster.
To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5cluster\fR on the command line with a fully specified
name;
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line;
.IP "\(bu" 2m
set the property \f5container_attached/location\fR.
.RE
.sp
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "NOTES"
This variant is also available:
.RS 2m
$ gcloud alpha container attached clusters get\-credentials
.RE