gkectl

You can use thegkectl command line interface for a for a variety tasks,including the following:

  • Generate a template for a cluster configuration file.
  • Validate a cluster configuration file.
  • Prepare a vSphere environment.
  • Create a cluster.
  • Upgrade a cluster.
  • Update a cluster.
  • Resize a cluster.
  • Diagnose cluster issues.

Basic commands

To list all commands:

gkectl help

To get help for a specific command:

gkectlCOMMAND --help

Environment variable for the admin cluster kubeconfig file

Severalgkectl commands require the path of the admin cluster kubeconfig file.You can specify the path by exporting aGKECTL_KUBECONFIG environmentvariable. For example:

export GKECTL_KUBECONFIG=/path/to/my-admin-cluster-kubeconfig

If you do not export theGKECTL_KUBECONFIG environment variable, then you mustuse the--kubeconfig flag when you run the command.

Downloadgkectl

For information on downloadinggkectl, seeDownloads.

Default logging behavior forgkectl

Forgkectl it's sufficient to use the default logging settings. Forgkectl,the default log file is/home/ubuntu/.config/gke-on-prem/logs/gkectl-$(date).log, and the file issymlinked with thelogs/gkectl-$(date).log file in the local directory whereyou rungkectl.

The default-v5 verbosity level covers all the log entries needed by thesupport team. The log file includes the command executed and the failure message.

We recommend that you send the log file to the support team when you need help.

Specifying a non-default locations for log files

To specify a non-default location for thegkectl log file, use the--log_file flag. The log file that you specify will not be symlinked with thelocal directory.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.