Skip to main content

miren cluster add

Add a new cluster configuration

With --format json, the command prints one result document and nothing else on stdout; progress and warnings go to stderr. A failure is reported both as a document and as a non-zero exit status.

{"ok": true, "cluster": {"name": "prod", "xid": "cluster-...", "organization": "Acme",
"address": "10.0.0.1:8443", "via_cloud": false,
"identity": "cloud", "active": true,
"config_file": "~/.config/miren/clientconfig.d/prod.yaml"}}

{"ok": false, "error": {"code": "cluster_not_found", "message": "no cluster named ..."}}

name is the local name, which is what every other command takes. cloud_name appears alongside it only when --as stored the cluster under a different name than it has in Miren Cloud, and address is absent for a cluster reached through cloud.

Messages are written for people and will be reworded. The code is the stable part:

CodeMeaning
invalid_flagsThe flags given can't mean anything together.
interactive_requiredAnswering needs a person. Name a cluster with --cluster, or use --force to overwrite.
no_identitiesNobody is logged in. Run miren login.
identity_errorThe identity named wasn't found, or one has to be named with --identity.
cloud_request_failedMiren Cloud didn't answer. Worth retrying.
cluster_not_foundNo cluster by that name, or none on the account.
ambiguous_clusterThe name exists in more than one organization. Add --organization.
unknown_organizationNo organization by that name.
cluster_unreachableThe cluster exists and couldn't be reached. Worth retrying.
cluster_existsThat local name is taken. Use --force, or --as to pick another.
config_errorThe local config couldn't be read or written.
unknownA failure with no code. Treat it as uninterpretable.

Usage

miren cluster add [flags]

Flags

  • --address, -a — Address/hostname of the cluster (optional - will use from selected cluster)
  • --as — Local name to store the cluster under, when it should differ from its name in Miren Cloud
  • --cluster, -c — Name of the cluster to add, looked up in Miren Cloud unless --address is given (optional - will list available)
  • --force, -f — Overwrite existing cluster configuration
  • --format — Output format (text, json) (default: text)
  • --identity, -i — Name of the identity to use (optional - will use the only one if single)
  • --json — Shorthand for --format json
  • --organization — Organization the named cluster belongs to, for when the same name exists in more than one
  • --via-cloud — Reach the cluster through Miren Cloud instead of dialing it, for a cluster this machine has no route to

Global Options

  • --options — Path to file containing options
  • --server-address — Server address to connect to (default: 127.0.0.1:8443)
  • --verbose, -v — Enable verbose output

Examples

Add a cluster interactively:

miren cluster add

Add a cluster by name, without the picker:

miren cluster add --cluster my-cluster

Add a cluster by name under a different local name:

miren cluster add --cluster my-cluster --as staging

Add a cluster, reporting the result (and any failure) as JSON:

miren cluster add --cluster my-cluster --format json

Add a cluster with a specific address:

miren cluster add --cluster my-cluster --address 10.0.0.1:8443

See also