Skip to content

cub cluster open

cub cluster open

Open a cluster's Argo CD UI or Sveltos dashboard in the browser

Synopsis

Open the Argo CD admin UI of a cub-managed cluster, log-in credentials in hand: the admin password is copied to your clipboard so you can paste it into Argo's login form instead of digging it out of the cluster.

For a cluster from "cub cluster up --controller sveltos", this opens the Sveltos dashboard instead, and copies a login token to your clipboard. The token is created from the cluster's platform-admin ServiceAccount, valid for 24 hours, and kept in /clusters/.sveltos-tokens: later runs reuse it until it has less than 10 minutes left. --print-password prints it instead.

--cluster-identity logs in as someone else. For Sveltos it names the ServiceAccount to create the token from, as / or a bare name in the default namespace, and each ServiceAccount's token is kept apart. For Argo CD it names the user; only admin's password can be read from the cluster, so for any other user the UI is opened and the password left to you.

A cluster from "cub cluster up --controller flux" has no UI to open, so this prints the commands that show Flux's state instead.

The cluster name is given as an argument, and can be omitted when this host has exactly one cub-managed cluster. cub cluster list shows the names and Argo endpoints of all of them.

The endpoint and password come from the cluster's env file (/clusters/.env, written by cub cluster up); if that file is gone, the endpoint is read from the cluster's ConfigHub Space annotations, in the context the cluster's record says it is wired to, and the password from the argocd-initial-admin-secret in the live cluster. An attached cluster has no host port for Argo CD; this prints the port-forward to use instead. What cannot be found is reported, and the rest is still done: with no password or token — an admin who changes the password deletes that Secret — the UI is still opened, and with no endpoint, or no browser, the credentials are still handed over.

Examples:

  # Open the Argo CD UI of the only cluster on this host
  cub cluster open

  # Open a specific cluster's Argo CD UI
  cub cluster open my-cluster

  # Print the admin password instead of copying it to the clipboard
  cub cluster open my-cluster --print-password

  # Print the Argo CD URL instead of opening a browser
  cub cluster open my-cluster --print-url

  # Log in to a Sveltos dashboard with a token from the ServiceAccount ops/viewer
  cub cluster open my-cluster --cluster-identity ops/viewer
cub cluster open [<cluster-name>] [flags]

Options

      --cluster-identity string   who to log in as: for Sveltos, the ServiceAccount to create the dashboard token from (<namespace>/<name>, or <name> in default; default default/platform-admin); for Argo CD, the user (default admin)
  -h, --help                      help for open
      --print-password            print the admin password (for Sveltos, the dashboard token) to the terminal instead of copying it to the clipboard
      --print-url                 Print the URL instead of opening a browser

Options inherited from parent commands

      --context string   The context to use for this command
      --debug            Debug output

SEE ALSO

  • cub cluster - Manage clusters wired into ConfigHub via Argo CD, Sveltos or Flux