1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-16 20:36:39 +00:00
gcloud-help/gcloud/container/fleet/memberships/get-credentials

84 lines
3.2 KiB
Text
Raw Normal View History

2022-03-09 08:39:30 +00:00
NAME
gcloud container fleet memberships get-credentials - fetch credentials for
2022-06-08 09:13:38 +00:00
a fleet-registered cluster to be used in Connect Gateway
2022-03-09 08:39:30 +00:00
SYNOPSIS
2023-01-19 00:56:33 +00:00
gcloud container fleet memberships get-credentials
(MEMBERSHIP_NAME : --location=LOCATION) [GCLOUD_WIDE_FLAG ...]
2022-03-09 08:39:30 +00:00
DESCRIPTION
gcloud container fleet memberships get-credentials updates the kubeconfig
file with the appropriate credentials and endpoint information to send
2023-01-19 00:56:33 +00:00
kubectl commands to a fleet-registered and -connected cluster through the
Connect Gateway service.
2022-03-09 08:39:30 +00:00
It takes a project, passed through by set defaults or flags. By default,
credentials are written to $HOME/.kube/config. You can provide an alternate
path by setting the KUBECONFIG environment variable. If KUBECONFIG contains
multiple paths, the first one is used.
2023-01-19 00:56:33 +00:00
Upon success, this command will switch the current context to the target
cluster if other contexts are already present in the kubeconfig file.
2022-03-09 08:39:30 +00:00
EXAMPLES
2023-01-19 00:56:33 +00:00
Get the Gateway kubeconfig for a globally registered cluster:
2022-03-09 08:39:30 +00:00
$ gcloud container fleet memberships get-credentials my-cluster
2023-01-19 00:56:33 +00:00
$ gcloud container fleet memberships get-credentials my-cluster \
--location=global
Get the Gateway kubeconfig for a cluster registered in us-central1:
$ gcloud container fleet memberships get-credentials my-cluster \
--location=us-central1
2022-03-09 08:39:30 +00:00
POSITIONAL ARGUMENTS
2023-01-19 00:56:33 +00:00
Membership resource - The group of arguments defining a membership. 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
2023-05-04 10:43:54 +00:00
can be set in other ways.
To set the project attribute:
2023-01-19 00:56:33 +00:00
◆ provide the argument MEMBERSHIP_NAME on the command line with a fully
specified name;
◆ provide the argument --project on the command line;
◆ set the property core/project.
This must be specified.
MEMBERSHIP_NAME
ID of the membership or fully qualified identifier for the
2023-05-04 10:43:54 +00:00
membership.
To set the membership attribute:
2023-01-19 00:56:33 +00:00
▸ provide the argument MEMBERSHIP_NAME on the command line.
This positional argument must be specified if any of the other
arguments in this group are specified.
--location=LOCATION
The location of the membership resource, e.g. us-central1. If not
specified, defaults to global.
To set the location attribute:
▸ provide the argument MEMBERSHIP_NAME on the command line with a
fully specified name;
▸ provide the argument --location on the command line;
▸ set the property gkehub/location.
2022-03-09 08:39:30 +00:00
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 $ gcloud help for details.
NOTES
These variants are also available:
$ gcloud alpha container fleet memberships get-credentials
$ gcloud beta container fleet memberships get-credentials