Last modified March 2, 2022
Global command line options in gsctl
gsctl and the REST API are being phased out. We don't have an end-of-life date yet. However, we recommend to familiarize yourself with our Management API and the kubectl gs plugin as a future-proof replacement. We provide a migration page to help you with the transition.
gsctl
supports the following global command line options. These are options that can be used in combination with all commands.
Note: Some global options might not have an effect with every command.
Overview
--endpoint
/-e
: Using this option you can override the endpoint temporarily for a given command. For interactive use however it’s more convenient to switch endpoints using thegsctl select endpoint
command.--auth-token
: Can be used to pass an authentication token for the use in single command, as an alternative to a permanent login in viagsctl login
.--config-dir
: This option allows to override the directory path to use for storing your configuration file and key pairs. By default, they get stored in$HOME/.config/gsctl
. This flag overrides theGSCTL_CONFIG_DIR
environment variable.--verbose
,-v
: Print more detailed output--silence-http-endpoint-warning
: Insecure! Allows to silence warnings when using endpoints with non-HTTPS URLs. This should only used in scenarios where users specifically wantgsctl
to communicate with endpoints only supporting unencrypted HTTP traffic. This can be neccessary whengsctl
output is being parsed.
Easily switching between environments
When working with more than one Giant Swarm installation, you will want to
switch the API endpoint you are using with gsctl
every now end then. Here are
a few tips to make that as convenient as possible.
gsctl
(starting with version 0.8) maintains a list of all endpoints you have
successfully logged in with. The command
gsctl list endpoints
lets you show that list. You can
be in fact logged in with all your endpoints at the same time. All you have to
do to switch between them is run the select endpoint
command.
gsctl select endpoint <endpoint-url-or-alias>
This requires the API URL or an endpoint alias to be given as argument.
Aliases greatly simplify the selection of an endpoint.
As shown in the list above, an endpoint can also be set per command, using
the --endpoint
or -e
flag. If you have an endpoint with alias cloud
and
another one with onprem
, this allows you to list clusters on both without
permanently selecting an endpoint:
gsctl list clusters -e cloud
...
gsctl list clusters -e onprem
...
If you no longer need an endpoint, you can delete it using the delete endpoint
command.
gsctl delete endpoint <endpoint-url-or-alias>
Need help, got feedback?
We listen to your Slack support channel. You can also reach us at support@giantswarm.io. And of course, we welcome your pull requests!