The commands in anthos-gke aws management deploy and delete
GKE on AWS
management services. You use the
init and apply commands to provision a management
service.
You use the get-credentials command to authenticate to your management service, and you use the delete
command to uninstall your GKE on AWS environment. You can use the diagnose command to gather additional information for debugging.
Init
The anthos-aws init command does the following:
- Prepares a working directory that contains an
anthos-gke.yamlfile. - Validates the configuration. During validation,
initchecks that theanthos-gke.yamlfile contains all required fields, the user has sufficient permissions, and referenced resources such as AWS KMS keys exist. - Creates or appends status information to
anthos-gke-status.yaml.This file includes a generated cluster ID, an SSH public key, encrypted Google Cloud service account keys, and an encrypted Kubernetes CA certificate.
You run anthos-gke init before anthos-gke apply.
anthos-gke aws management init DIRECTORY
Positional arguments
DIRECTORY- An optional argument for the directory containing the
anthos-gke.yamlfile. Defaults to the current directory.
Examples
To initialize the current working directory, run the following command:
anthos-gke aws management init
To initialize a specific directory, run the following command:
anthos-gke aws management init DIRECTORY
Replace DIRECTORY with the directory containing your
anthos-gke.yaml file.
Apply
The apply command provisions a
management service on AWS. The command
also creates a
Cloud Storage bucket that
GKE on AWS uses for Terraform
state.
anthos-gke aws management apply DIRECTORY
Positional arguments
DIRECTORY- An optional argument for the directory containing the
anthos-gke.yamlfile. Defaults to the current directory.
Examples
To create a management service from configuration in the current working directory, run the following command:
$ anthos-gke aws management apply
To create a management service from configuration in a specific directory
(~/example/workspace, for example), run the following command:
$ anthos-gke aws management apply DIRECTORY
Replace DIRECTORY with the directory containing your
anthos-gke.yaml.
Get-credentials
The get-credentials command updates your kubeconfig file with credentials
and endpoint information for a your management service. By default, credentials
are appended to ~/.kube/config. You can set a different path to your
kubeconfig by setting the KUBECONFIG environment variable.
anthos-gke aws management get-credentials [--workspace DIRECTORY]
Flags
--workspace DIRECTORY- An optional argument for the directory containing the
anthos-gke.yamlfile. Defaults to the current directory.
Examples
To get credentials for a management service defined in the current working directory, run the following command:
anthos-gke aws management get-credentials
To get credentials for a management service defined in a specific directory, run the following command:
anthos-gke aws management get-credentials --workspace DIRECTORY
Replace DIRECTORY with the directory containing your
anthos-gke.yaml.
Diagnose
The diagnose snapshot command generates a support bundle to help Google
support debug issues with your management service. The support bundle is a tar
file which includes configuration, cluster events, and logs. For more
information, see Troubleshooting
anthos-gke aws management diagnose snapshot
--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] \
[--snapshot-config PATH] \
[--workspace DIRECTORY] \
[--quiet]
Flags
--ssh-key-path PATH- A required argument which gives the path to an SSH key file. For most users,
this value should be
~/.ssh/anthos-gke.
Optional flags
[--bastion-ip IP]- Specifies a bastion host IP address.
[--bastion-ssh-key-path PATH]- The path to an SSH key file for the bastion host. Defaults to
--ssh-key-path. [--cluster-ssh-key-path PATH]- The path to an 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]- The path to an SSH key file for the management service. Defaults to
--ssh-key-path. [--nodepool-ssh-key-path PATH]- The path to an SSH key file for node pool machines. Defaults to
--ssh-key-path. [--snapshot-config PATH]- The path to a YAML snapshot configuration file (optional).
[--output PATH]- The path where
anthos-gkecreates the support bundle file. --workspace DIRECTORY- An optional argument for the directory containing the
anthos-gke.yamlfile. Defaults to the current directory. [--quiet]- Eliminate messages printed to the console.
Examples
To generate a support bundle for a management service defined in the
~/example/workspace directory, run the following command:
anthos-gke aws management diagnose snapshot \
--ssh-key-path ~/.ssh/anthos-gke \
--workspace ~/example/workspace
To view the default snapshot configuration, run the following command:
anthos-gke aws management diagnose snapshot \
--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 management diagnose snapshot \
--ssh-key-path ~/.ssh/anthos-gke
--snapshot-config ~/my-snapshot-config.yaml
Delete
The anthos-gke aws management delete command deletes a management cluster.
anthos-gke aws management delete DIRECTORY
Optional flags
[--force]- Forces deletion of management service even if the user cannot connect to the management service.
Positional arguments
DIRECTORY- An optional argument for the directory containing the
anthos-gke.yamlfile. Defaults to the current directory.
Examples
To delete the management service defined in the current working directory, run the following command:
anthos-gke aws management delete
To delete the management service defined in a specific directory, run the following command:
anthos-gke aws management delete ~/example/workspace