Anthos-gke aws clusters

The commands in anthos-gke aws clusters operate on GKE on AWS user clusters. You authenticate to your user clusters with the get-credentials command. You can also gather additional information for debugging with the diagnose command.

Get-credentials

The get-credentials command updates a kubeconfig file with credentials and endpoint information for a GKE on AWS user cluster. By default, credentials are appended to ~/.kube/config. If you set the KUBECONFIG environment variable to another file path, anthos-gke appends credentials to that file.

anthos-gke aws clusters get-credentials NAME [--workspace DIRECTORY]

Positional arguments

NAME
Name of the cluster that anthos-gke generates credentials for. The name should match the metadata.name field of the AWSCluster resource.

Optional flags

--workspace [DIRECTORY]
An optional argument for the directory containing the anthos-gke.yaml file. Defaults to the current directory.

Examples

To get credentials for a cluster called cluster-0 defined in the current working directory, run the following command:

anthos-gke aws clusters get-credentials cluster-0

Diagnose

The diagnose snapshot command generates a support bundle to help Google Cloud support debug issues with your user clusters. The support bundle is a tar file which includes configuration, cluster events, and logs. Send this file to your technical support manager.

anthos-gke aws clusters diagnose snapshot CLUSTER_NAME
           --ssh-key-path PATH
           [--bastion-ip IP]
           [--bastion-ssh-key-path PATH]
           [--cluster-ssh-key-path PATH]
           [--dry-run]
           [--mgmt-service-ssh-key-path PATH]
           [--nodepool-ssh-key-path PATH]
           [--output PATH]
           [--quiet]
           [--snapshot-config PATH]
           [--workspace DIRECTORY]

Positional arguments

CLUSTER_NAME
Name of the cluster to generate a support bundle for. This value should match the metadata.name field of your AWSCluster.

Flags

--ssh-key-path PATH
A required argument which gives the path to an SSH key file. If you created a key with anthos-gke management init, this value is ~/.ssh/anthos-gke.

Optional flags

[--bastion-ip IP]
An override for the bastion host IP address in the current workspace.
[--bastion-ssh-key-path PATH]
A specific SSH key file for the bastion host. Defaults to --ssh-key-path.
[--cluster-ssh-key-path PATH]
A specific SSH key file for the workload cluster control plane machines. Defaults to --ssh-key-path.
[--dry-run]
An option to display the snapshot configuration file without generating a support bundle.
[--mgmt-service-ssh-key-path PATH]
A specific SSH key file for the management service. Defaults to --ssh-key-path.
[--nodepool-ssh-key-path PATH]
A specific SSH key file for node pool machines. Defaults to --ssh-key-path.
[--output PATH]
A file path for the support bundle tarball.
[--quiet]
An option to eliminate messages printed to the console.
[--snapshot-config PATH]
The path to a YAML snapshot configuration file (optional).
[--workspace DIR]
Workspace directory which should contain the anthos-gke.yaml configuration file. Defaults to the current directory.

Examples

To generate a support bundle for a workload cluster named cluster-0, run the following command:

anthos-gke aws clusters diagnose snapshot cluster-0 \
             --ssh-key-path ~/.ssh/anthos-gke \
             --workspace ~/example/workspace

To view the default snapshot configuration, run the following command:

anthos-gke aws clusters diagnose snapshot cluster-0 \
             --ssh-key-path ~/.ssh/anthos-gke \
             --dry-run

To specify a custom snapshot configuration file (including your own bash and kubectl commands), run the following command:

anthos-gke aws clusters diagnose snapshot cluster-0 \
             --ssh-key-path ~/.ssh/anthos-gke
             --snapshot-config ~/my-snapshot-config.yaml