clusterctl

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2026 License: GPL-3.0, LGPL-3.0

README

clusterctl

One binary. Every node. No surprises. clusterctl selects nodes with ClusterShell syntax, fans out commands, drives service processors, reinstalls nodes and administers Slurm, and asks before it changes anything.

Read the manual →
$ clusterctl node select '@slurm:main&@rack:R02'
exe[0004-0009]

$ clusterctl exec -n '@slurm:main' --dedup -- uname -r
exe[0001-0009] (9): ok
  5.14.0-570.el9.x86_64
exe0010 (1): ok
  4.18.0-553.el8.x86_64

$ clusterctl slurm node drain 'ticket 4711: failing DIMM' -n exe0007
About to drain 1 host: exe0007
  reason: ticket 4711: failing DIMM
Continue? [y/N] y
drained exe0007

$ clusterctl provision reinstall -n '@rack:R02' --dry-run
Would reinstall 10 hosts: exe[0001-0010]
  everything on these machines is lost

Install

With mise, which pins a version per project and verifies the download:

$ mise use -g github:GSI-HPC/clusterctl
$ clusterctl version

Or take the binary for your platform from the releases:

$ curl -fsSL -o clusterctl.tar.gz \
    https://github.com/GSI-HPC/clusterctl/releases/latest/download/clusterctl_linux_amd64.tar.gz
$ tar xzf clusterctl.tar.gz
$ install -m 0755 clusterctl ~/.local/bin/

Or build it:

$ go install github.com/GSI-HPC/clusterctl/cmd/clusterctl@latest

Go 1.26 or newer. The toolchain downloads itself if yours is older.

Get started

$ clusterctl config init --site lab --cluster alpha --domain hpc.example.org
$ $EDITOR ~/.config/clusterctl/*.yaml    # the files it listed; fill in what they ask
$ clusterctl config validate
$ clusterctl doctor
$ clusterctl node list

config init writes the least configuration that resolves, and only into an empty directory, and prints the path of every file it writes. On macOS that directory is ~/Library/Application Support/clusterctl, not ~/.config/clusterctl. examples/site/ is a complete configuration to take further settings from. The manual walks through both, and doc/migration.md maps every command and setting of the shell toolkit clusterctl replaces to its counterpart.

Shell completion

$ clusterctl completion bash > /etc/bash_completion.d/clusterctl
$ clusterctl completion zsh  > "${fpath[1]}/_clusterctl"

Node set completion offers the configured groups, and --context offers the configured contexts.

Exit codes

Code Meaning
0 Everything succeeded
1 At least one target failed
2 Usage or configuration error
3 A host could not be reached
130 Interrupted, or a confirmation declined

Using the node set engine

The node set implementation is offered as a library, because the Go ecosystem had none:

import "github.com/GSI-HPC/clusterctl/nodeset"

ns, err := nodeset.Parse("exe[0001-0010]!exe0003")
fmt.Println(ns)          // exe[0001-0002,0004-0010]
fmt.Println(ns.Len())    // 9

doc/nodeset.md describes the language and the rules chosen where it differs from ClusterShell.

Contributing

The repository carries a mise.toml, so the toolchain comes from mise if you use it:

$ mise install  # Go and golangci-lint, at the versions CI uses
$ make test     # unit and command tests
$ make lint     # vet and formatting
$ make cover    # coverage
$ make build    # bin/clusterctl

The documentation site needs Hugo extended; see site/README.md.

Commits are Conventional Commits. Design notes and the decision records are in doc/; a change that takes a decision gets a record.

Licence

Copyright (C) 2026 GSI Helmholtz Centre for Heavy Ion Research GmbH http://www.gsi.de

LGPL-3.0-or-later. See COPYING and COPYING.LESSER.

Directories

Path Synopsis
cmd
clusterctl command
Command clusterctl administers HPC clusters: it reaches the hosts of a site, selects and drives nodes, operates their service processors, provisions them and administers Slurm.
Command clusterctl administers HPC clusters: it reaches the hosts of a site, selects and drives nodes, operates their service processors, provisions them and administers Slurm.
internal
apis/v1alpha1
Package v1alpha1 defines the configuration objects clusterctl reads.
Package v1alpha1 defines the configuration objects clusterctl reads.
app
Package app wires the configuration, the transport and the node model into the context every command runs against.
Package app wires the configuration, the transport and the node model into the context every command runs against.
cli
Package cli defines the clusterctl command tree.
Package cli defines the clusterctl command tree.
clikit/fanout
Package fanout works on many items at once, a bounded number at a time, and reports each as a target of the progress package: Each is the one bounded loop, Map works on items and reports them as a step with a target each, and Batches works on a node set in batches, one after the other, with a pause between them.
Package fanout works on many items at once, a bounded number at a time, and reports each as a target of the progress package: Each is the one bounded loop, Map works on items and reports them as a step with a target each, and Batches works on a node set in batches, one after the other, with a pause between them.
config
Package config finds, validates, merges and resolves the clusterctl configuration.
Package config finds, validates, merges and resolves the clusterctl configuration.
config/configtest
Package configtest writes configuration directories for the tests of the packages that read one.
Package configtest writes configuration directories for the tests of the packages that read one.
credentials
Package credentials resolves the accounts used for service processors and power distribution units.
Package credentials resolves the accounts used for service processors and power distribution units.
dhcp
Package dhcp reads an ISC dhcpd configuration.
Package dhcp reads an ISC dhcpd configuration.
exitcode
Package exitcode defines the process exit codes clusterctl guarantees.
Package exitcode defines the process exit codes clusterctl guarantees.
fanout
Package fanout works on many targets at once, as clusterctl does: the executor that runs a request on every target, the status and the groups of their results, the bound on each host, and the exit code a fan-out that failed somewhere asks for.
Package fanout works on many targets at once, as clusterctl does: the executor that runs a request on every target, the status and the groups of their results, the bound on each host, and the exit code a fan-out that failed somewhere asks for.
fanout/fanouttest
Package fanouttest counts the calls a fake is in the middle of, so that a test can tell how many of them a fan-out ran at once: the requests a transport.Runner is asked to run, those an http.RoundTripper sends to a service processor and the connections a host key scan dials.
Package fanouttest counts the calls a fake is in the middle of, so that a test can tell how many of them a fan-out ran at once: the requests a transport.Runner is asked to run, those an http.RoundTripper sends to a service processor and the connections a host key scan dials.
fileutil
Package fileutil writes files the way a tool several administrators run at once has to: completely or not at all, and under a lock when the file is shared.
Package fileutil writes files the way a tool several administrators run at once has to: completely or not at all, and under a lock when the file is shared.
groups
Package groups resolves the @group references of a node set expression.
Package groups resolves the @group references of a node set expression.
hostkeys
Package hostkeys reads, writes and collects SSH host keys.
Package hostkeys reads, writes and collects SSH host keys.
hostname
Package hostname decides whether a name may be handed to ssh or put into a URL as a host, and whether an account may be handed to ssh as a user.
Package hostname decides whether a name may be handed to ssh or put into a URL as a host, and whether an account may be handed to ssh as a user.
inventory
Package inventory answers questions about the nodes of a site: their attributes, where they sit, what address they have and what they boot.
Package inventory answers questions about the nodes of a site: their attributes, where they sit, what address they have and what they boot.
ipmi
Package ipmi drives the FreeIPMI and ipmitool backends that talk to service processors over the management network.
Package ipmi drives the FreeIPMI and ipmitool backends that talk to service processors over the management network.
mcpserver
Package mcpserver offers clusterctl to an AI agent over the Model Context Protocol.
Package mcpserver offers clusterctl to an AI agent over the Model Context Protocol.
naming
Package naming turns short node names into host names and service processor names, replacing the prefix logic the shell tools carried.
Package naming turns short node names into host names and service processor names, replacing the prefix logic the shell tools carried.
output
Package output renders command results in the format the caller asked for.
Package output renders command results in the format the caller asked for.
progress
Package progress reports what a command is doing while it runs.
Package progress reports what a command is doing while it runs.
progress/display
Package display shows the progress of a command on its standard error, from the events of its progress.Bus: the live tree, a few rows at the bottom of a terminal that show the work under way and what of it failed; the counter, one line there that says how far the work has got; plain lines, one for each thing worth a line, for a log as much as a terminal; and the summary a display leaves behind once the command has ended.
Package display shows the progress of a command on its standard error, from the events of its progress.Bus: the live tree, a few rows at the bottom of a terminal that show the work under way and what of it failed; the counter, one line there that says how far the work has got; plain lines, one for each thing worth a line, for a log as much as a terminal; and the summary a display leaves behind once the command has ended.
progress/progresstest
Package progresstest captures the progress events of a test, draws them as a tree that does not depend on the order concurrent work happened in, and checks that they keep the promises the progress package makes to every sink.
Package progresstest captures the progress events of a test, draws them as a tree that does not depend on the order concurrent work happened in, and checks that they keep the promises the progress package makes to every sink.
redfish
Package redfish talks to the Redfish interface of a service processor.
Package redfish talks to the Redfish interface of a service processor.
safety
Package safety gates the commands that change or destroy something.
Package safety gates the commands that change or destroy something.
secrets
Package secrets decrypts the age encrypted files a site keeps beside its configuration, and has the sops command decrypt its Secret documents.
Package secrets decrypts the age encrypted files a site keeps beside its configuration, and has the sops command decrypt its Secret documents.
secrets/sopstest
Package sopstest writes sops encrypted files for tests with the sops command, the way "sops encrypt --encrypted-regex '^(data|binaryData)$'" writes them, to keys generated by the test, so that no private key is kept in the repository.
Package sopstest writes sops encrypted files for tests with the sops command, the way "sops encrypt --encrypted-regex '^(data|binaryData)$'" writes them, to keys generated by the test, so that no private key is kept in the repository.
shellquote
Package shellquote renders an argument vector as a POSIX shell word list.
Package shellquote renders an argument vector as a POSIX shell word list.
slurm
Package slurm reads and changes the state of a Slurm cluster through its command line clients, which run on a host that has them.
Package slurm reads and changes the state of a Slurm cluster through its command line clients, which run on a host that has them.
termtext
Package termtext makes untrusted text safe to write to a terminal, and measures how many columns text takes there.
Package termtext makes untrusted text safe to write to a terminal, and measures how many columns text takes there.
tmpl
Package tmpl expands the {placeholder} templates the configuration uses for host names and tunnel definitions.
Package tmpl expands the {placeholder} templates the configuration uses for host names and tunnel definitions.
tools/gendocs command
Command gendocs writes the generated part of the documentation site: the command reference and the JSON Schemas of the configuration kinds.
Command gendocs writes the generated part of the documentation site: the command reference and the JSON Schemas of the configuration kinds.
transport
Package transport runs commands on remote hosts through the OpenSSH client.
Package transport runs commands on remote hosts through the OpenSSH client.
tunnel
Package tunnel manages the sshuttle profiles a site offers.
Package tunnel manages the sshuttle profiles a site offers.
version
Package version reports the build provenance of the clusterctl binary.
Package version reports the build provenance of the clusterctl binary.
Package nodeset parses, folds and expands ClusterShell style node sets.
Package nodeset parses, folds and expands ClusterShell style node sets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL