Skip to content

mw gitlab cluster agent get-token

Releasev0.35.0 · cfeceb67

mw gitlab cluster agent get-token [flags]

Create and return a k8s_proxy-scoped personal access token to authenticate with a GitLab Agents for Kubernetes.

This command creates a personal access token that is valid until the end of the current day. You might receive an email from your GitLab instance that a new personal access token has been created.

-a, --agent <int>
The numerical Agent ID to connect to.
-c, --cache-mode <string>
Mode to use for caching the token. Allowed values: keyring-filesystem-fallback, force-keyring, force-filesystem, no Default: force-keyring.
--check-revoked
Check if a cached token is revoked. This requires an API call to GitLab which adds latency every time a cached token is accessed.
--token-expiry-duration <duration>
Duration for how long the generated tokens should be valid for. Minimum is 1 day and the effective expiry is always at the end of the day, the time is ignored. Default: 24h0m0s.
-h, --help
Show help for this command.
--no-interaction
Do not ask any interactive questions
--profile <string>
Saved account profile (login defaults to the verified username)
-R, --repo <OWNER/REPO>
Select another repository. Can use either OWNER/REPO or `GROUP/NAMESPACE/REPO` format. Also accepts full URL or Git URL.
-v, --verbose <count>
Increase output verbosity. Example: --verbose=2 or -vv
Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.