Last modified September 29, 2021
Global command line options
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.
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.
-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 the
gsctl select endpointcommand.
--auth-token: Can be used to pass an authentication token for the use in single command, as an alternative to a permanent login in via
--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 the
-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 want
gsctlto communicate with endpoints only supporting unencrypted HTTP traffic. This can be neccessary when
gsctloutput 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
-e flag. If you have an endpoint with alias
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>