Skip to content

v0.1.0-beta.2

Latest

Choose a tag to compare

@github-actions github-actions released this 19 Nov 21:55
· 49 commits to main since this release
Immutable release. Only release title and notes can be modified.

Added

  • rancher app install and rancher app uninstall install and remove a chart from a ClusterRepo through Rancher. Rancher runs Helm in its own pod, as you or as the service account the ClusterRepo names, and records the release as an App, as the Rancher UI does. The preview is built from what the command reads from the server. Add --apply to install, and --apply --yes to uninstall. Values from your --values files are never printed, except a registry host. The namespace must already exist.
  • rancher app install also sends values that describe the cluster, under global.cattle, as the Rancher UI does. It adds each global.cattle value only where your values files set none, and the preview shows them. When the command cannot read them, it leaves them out with a warning.
  • rancher app install --system-default-registry <host> sets the image registry for a chart that declares one. Without the flag, the registry comes from your values files or the chart's defaults. If they set none, it comes from the cluster's registry, else from Rancher's system-default-registry setting, as in the Rancher UI. --no-system-default-registry sends no registry. Either flag on a chart that declares no registry is refused with VALIDATION (exit 2). app upgrade takes both flags too.
  • rancher app install --wait and rancher app uninstall --wait wait until Helm's run ends and report how it ended. An install returns the release's revision and the status deployed, and an uninstall returns once the App is gone. A failed run ends with GENERIC (exit 1, not retryable). The error names the command to run next, and Helm's exit code when Rancher reports one. --timeout alone also waits. The timeout defaults to 55m, the longest allowed. Ctrl-C ends the wait with INTERRUPTED (exit 130) while Helm's run goes on in Rancher.
  • rancher app upgrade changes a release that Rancher shows as an App. It calls Rancher's upgrade action to change the chart version, the values, or both. It starts from the release's current values and merges each --values file over them. --reset-values skips the release's values and sends only your files, plus the cluster and registry values the CLI adds. The preview is built from what the command reads from the server. Add --apply --yes to upgrade, and --wait to wait for Helm's result.
  • rancher create project --display-name <name> with no id creates a project with an id Rancher generates. Without an id, --display-name is required. The dry-run preview shows p-* instead of the id, because Rancher generates a different id when you run the command with --apply. The --apply result shows the generated id (data.metadata.name with -o json). With an id, --display-name defaults to the id.
  • rancher get, patch and delete projectroletemplatebinding take --cluster and --project, as grant and revoke do. They find the project's backing namespace themselves. You no longer type -n <cluster>-<project>. Pass both --cluster and --project. --project takes the project's id or display name. Giving only one of them is refused with VALIDATION (exit 2).
  • rancher get, patch and delete managedchart show, change and delete Rancher's ManagedCharts. A ManagedChart installs a Helm chart through Fleet on its target clusters. get shows the chart, version and ready clusters, and hides the Helm values. patch and delete need --apply --yes. A delete makes Fleet uninstall the chart from every target cluster, unless its target sets keepResources: true. A create resource preview of a ManagedChart warns that Rancher installs the chart on every target cluster.
  • rancher get authconfig lists and shows Rancher's auth configs, with their credentials hidden. It shows each one's type, whether it is enabled, its access mode, the number of allowed users and groups, and its cleanup setting. The command hides credential fields and references to the Secrets that hold credentials. No flag shows them. Rancher before v2.16 keeps an auth config for every auth provider it supports, most of them disabled. patch, delete and creating one from a manifest are refused, with the reason.
  • rancher create password-change-request --current-password-stdin sends your current password with the new one. With --password-stdin, the command reads two lines from stdin: the current password, then the new one. Rancher asks for the current password when you change your own password without permission to change every user's password. In PowerShell, use PowerShell 7.1 or later: Windows PowerShell 5.1 sends a byte order mark before piped text, and the CLI then receives a different password.
  • rancher get role, rolebinding, clusterrole and clusterrolebinding list and show Kubernetes RBAC objects. They show the columns the cluster's API server returns, and completion offers their names. They are read-only. patch, delete and creating one from a manifest are refused before any request. The error points to kubectl (through rancher kubeconfig) and to rancher grant or rancher revoke.
  • rancher inspect cluster --registration builds the node registration commands of a custom cluster, with the options the Rancher UI offers. Pass --etcd, --controlplane and --worker (all three when none is given), --node-name, --address, --internal-address, --label and --taint. --windows builds the Windows command for clusters where the Rancher UI shows one. These commands are under registration.withOptions. The registration commands Rancher returns still appear as before. A value with a character the Rancher UI would remove is refused before any request.
  • rancher cluster upgrade <cluster> --k8s-version <version> upgrades an RKE2 or K3s cluster that Rancher provisions or that is imported. It accepts the versions the Rancher UI offers: a release of the cluster's own distribution that the server lists, not lower than the current one. The preview comes from a server dry-run and names the newest successful etcd snapshot, because the upgrade cannot be reversed with this command. Add --apply --yes; the command waits until Rancher reports the upgrade done (--wait=false returns at once). Completion offers only the clusters and versions the command accepts.
  • rancher cluster save-etcd-snapshot <cluster> takes an etcd snapshot of an RKE2 or K3s cluster that Rancher provisions, as the Rancher UI does. The preview comes from a server dry-run; add --apply --yes. The command waits until Rancher reports the snapshot taken, then lists the cluster's snapshots (--wait=false returns once the server accepts the request). It refuses while another operation is in progress on the cluster and while the cluster is not ready. If you run the command again while its own snapshot is in progress, it changes nothing and waits for that snapshot.
  • rancher node drain <node> --cluster <cluster> drains a node through Rancher, as the Rancher UI does, and rancher node stop-drain stops a drain. Rancher cordons the node and evicts its pods. The preview lists the pods on the node and what the drain does to each; add --apply --yes to drain. The command waits until Rancher reports the drain done or failed; --wait=false returns once Rancher accepts the request. It works on worker nodes that are active or cordoned. Both commands need access to Rancher's local cluster; without it they end with RBAC (exit 6).
  • rancher get management-node --cluster <cluster> shows the management node Rancher keeps for each node, with its drain state. It shows the columns NODE, DRAINED, REQUEST and WORKER. The argument is the management node's id. If you pass a node's name instead of the id, the error names the management node's id. patch and create resource of a management node are refused, and it has no delete. Like node drain, it needs access to Rancher's local cluster.

Changed

  • Every rancher delete now waits until the object is gone. Before, a delete returned once the server accepted the request, while a pod, a namespace or a project could still be terminating. Now it waits for up to --timeout (default 5m); --wait=false returns at once and prints deletion started, and -o json has data.waited. A timeout or interrupt is an error that says the deletion was requested and names a get command to check it.
  • rancher delete project --delete-namespaces waits until everything is gone. Before, it returned as soon as Rancher accepted the requests and refused --timeout. Now it waits for the namespaces, then deletes the project and waits for it, all within --timeout. If a namespace delete fails or a namespace is not gone in time, the project is kept.
  • Kubernetes admission refusals report VALIDATION (exit 2), not RBAC. Before, a write refused by a ResourceQuota, a LimitRanger, PodSecurity, a ValidatingAdmissionPolicy or one of several other admission plugins was RBAC (exit 6). Now it is VALIDATION with the server's message. A temporary 403 from admission is a retryable GENERIC (exit 1) error. A 409 from an admission webhook is a CONFLICT that is not retryable.
  • When Rancher denies access to a cluster or project id, the CLI reports RBAC (exit 6), not NOT_FOUND. Before, --cluster <id> for a cluster you may not read said the cluster did not exist. Now the error says you cannot read it and lists the clusters you can read. A mistyped id reports RBAC too, unless you can read every cluster or project. rancher access projects --cluster still reports NOT_FOUND.
  • Table cells and -o name names with hidden characters print in double quotes. Table and wide cells, headers and -o name names with a control character, an invisible character or an invalid UTF-8 byte now print in double quotes, with that character escaped instead of removed. A name with a zero-width space prints as "web\u200b1", not as web1. A zero-width joiner or a direction mark in a name also makes it print quoted. json, yaml and template output do not change.
  • rancher create password-change-request gives each of Rancher's two password errors its own code. A wrong current password is now VALIDATION (exit 2), not GENERIC (exit 1). Changing another user's password without permission is now RBAC (exit 6), not AUTH (exit 3).
  • rancher create user and create password-change-request refuse a password piped to --password-stdin that has more than one line. With --current-password-stdin, create password-change-request needs exactly two lines instead.
  • rancher create project refuses an invalid id with VALIDATION (exit 2) before it sends a request. Rancher names the project's backing namespace after the id. An id may hold only lowercase letters, digits and -, must start and end with a letter or digit, and has at most 63 characters. To use another name, pass it as --display-name and leave the id out. Rancher then generates the id.
  • On Windows, a config directory the CLI creates is readable by your account only. Before, the directory kept the access list it inherited from %APPDATA%, which also grants SYSTEM and Administrators; its data files were already owner-only. Now a directory the CLI creates gets an access list for your account alone. New files and folders in it inherit that list, as mode 0700 does on Linux and macOS. A directory that already exists keeps its access list.
  • rancher telemetry status says whether recorded events are sent. A release build prints sending: none - this build sends no event; recorded events stay on this machine, and -o json has a sendsEvents field. rancher telemetry show labels its time column HOUR: each event stores only the hour, in UTC.
  • Every message that suggests --cacert <file> says what the file is. Before, most errors and warnings that named --cacert <file> did not say which file to pass, and one of them used different wording. The kubectl plugin's error for a missing terminal said "to log in without one", which read as "without a name" or "without a file". Now each message says <file> is a file that holds the server's CA certificate, and the plugin's error says "to log in without a terminal".

Security

  • Printed commands now quote values so that sh, bash, zsh, fish and PowerShell read them as written. Before, hints, errors, warnings and recovery steps quoted values for POSIX sh only, and a value with a quote character could run code when pasted into PowerShell or fish. PowerShell here means PowerShell 7 and Windows PowerShell 5.1. If a value cannot be quoted so that every one of these shells reads it as written, the CLI leaves the command out and prints one sentence saying so.
  • An error for a failed admission webhook call no longer quotes the webhook's response. The response could echo the object the write sent, such as a Secret's data. When the webhook gave a message, the error is admission webhook '<name>' failed: <message>. A call that never reached the webhook is retryable.
  • get, mutation results and preview diffs also hide the objectset.rio.cattle.io/applied annotation. Before, they hid only kubectl.kubernetes.io/last-applied-configuration. Controllers that apply objects with Rancher's wrangler library write objectset.rio.cattle.io/applied, a compressed copy of the object. On a kind with hidden fields, such as a Fleet bundle, that copy could contain the values the kind hides. Now both annotations are hidden for every sensitive kind and every kind with hidden fields, get secret included.
  • rancher schema --search now shows your search text in single quotes, in the commands match line and in conflict errors. Before, it showed the text in double quotes, and a POSIX shell runs $(...) and backquotes inside them when you paste the line.
  • A server URL with an @ in its path, query or fragment is now refused. Before, a URL such as https://admin:1234/x@h was accepted, and a login or token went to the host admin on port 1234. Such a URL usually comes from a password that contains /, ? or #, typed as https://user:password@host. A saved server entry with such a URL shows as <unusable URL>, and the kubectl plugin refuses a call that uses that entry.
  • The installers accept a build attestation only when the release workflow made it for the tag you install. Before, install.sh and install.ps1 accepted an attestation from a run of the release workflow on any branch or tag. Now an attestation made for another branch or tag stops the install. The check needs gh 2.68.0 or newer, logged in. If gh is missing, older or not logged in, the installer skips the check and prints a notice. With --verify-attestation (-VerifyAttestation on Windows) it stops instead.

Fixed

  • When Rancher rejects your saved login token, the AUTH error now tells you the command that logs you in again. Before, the error told you to run rancher auth status, which sends the same token and fails with a 401 too. Now it suggests rancher auth login <name> --token-stdin, where <name> is your server entry. If you signed in through an auth config, such as LDAP or Okta, and rancher-cli saved its name, it suggests --auth-provider <auth config> instead of --token-stdin. In a terminal, rancher auth login <name> with no flags asks whether to paste a token or sign in via an identity provider.
  • rancher get clusters and rancher get projects work for a cluster or project member. Before, they failed with RBAC (exit 6). Rancher lets a member get their own cluster or project by name, but not list them through the Kubernetes API. Now, when the Kubernetes API refuses the list, the CLI reads it through the Steve API, the API the Rancher UI uses. A member sees the same shape an administrator sees.
  • A Cluster Owner with no other role can now list the provisioning clusters they own with rancher get provisioning-clusters. Shell completion for rancher cluster scale and the other cluster commands now suggests those cluster names. When the Kubernetes API answers a list of provisioning clusters or etcd snapshots with 403, rancher get reads the list through the Steve API and prints it in the Kubernetes format.
  • When you create a project with rancher create project, you become its owner. Before, a user who is not an administrator could not see or manage a project they had just created, until a cluster owner or an administrator granted them a role. create project and create resource -f with a Project manifest now set you as the creator, and a manifest that names another user as creator is refused. For a project created before this change, a cluster owner or an administrator grants the Project Owner role.
  • rancher grant and rancher revoke work for a caller who may not read users, such as a project owner. Before, both read the user first and failed with an RBAC error. Now, when Rancher refuses that read and you pass a user id, they use the id as typed, warn in the preview, and let Rancher's dry-run check the binding. A user id is local://<id> or Rancher's own form, such as u-lpnxw. A user name or an external principal still fails, with a message to pass the user id.
  • A 409 is retryable only when the write sent a resourceVersion. Before, every 409 except "already exists" showed "the resource changed on the server since it was last read" and was marked retryable. A create that an admission webhook refused looked the same, and the server's own message was lost. Now only an update or delete that sent a resourceVersion, and that no admission webhook refused, gets that retryable CONFLICT. Any other 409 is a CONFLICT that is not retryable, with the server's message.
  • rancher config add-server and rancher auth login --url accept a --cacert that holds the same certificates as the saved CA. Before, a copy of the server entry's CA on another path, or with Windows line endings, was refused as a different CA. Now the commands compare the certificates themselves: the entry keeps its saved CA and a warning says so. A different CA is still refused, and the message lists the SHA-256 fingerprints of the certificates that differ.
  • rancher charts --repo refuses a disabled ClusterRepo with VALIDATION (exit 2). Before, the result depended on the Rancher version: a retryable GENERIC error (exit 1), or the charts the repository had before it was disabled. The error names rancher get clusterrepo <name> to show the repository, and the command reads no chart index for it.
  • rancher charts, app install and app upgrade refuse a --repo value that is not a ClusterRepo name. Before, charts and app install sent a value such as a/b to Rancher and failed with a generic error (exit 1). app upgrade read the cluster and the App first, and only then failed. Now each command refuses such a value with VALIDATION (exit 2) before any request. A ClusterRepo name is a DNS subdomain name: at most 253 characters of lowercase letters, digits, - and ..
  • rancher support-bundle now records in its manifest when it cannot read a Rancher setting. Before, the command ignored a failed setting read, such as a 403, as if the server had no such setting. Now the bundle's manifest.json shows error: for rancher/settings.json, with the names of the settings the command could not read and the first error. The errors count (data.errors with -o json) goes up by one. The exit code does not change.
  • For kinds Rancher keeps on its local cluster, --namespace help says which namespace to pass. Before, get, patch and, where the kind has one, delete of the Fleet, provisioning, CAPI and etcd snapshot kinds and of clusterregistrationtoken described --namespace as the namespace to operate in. Completion offered the namespaces of the --cluster cluster, and none of them is valid there. Now the help names the value (a Fleet workspace, the cluster's id, or the namespace of the provisioning cluster), and completion offers nothing for these kinds.
  • Error text shows a hidden character or an invalid UTF-8 byte in a value as an escape sequence. Before, the CLI dropped control and invisible formatting characters from error details and from the names an error suggests as matches, and an invalid UTF-8 byte showed as U+FFFD. Two different values could print the same, and you could pick the wrong suggested name. Now the CLI prints such a value as a quoted string with escapes, for example "CN=a\u200bb" or "u-a\xffb". -o json and -o yaml do not change.
  • rancher skill uninstall and rancher skill status show only the columns they fill. Before, skill install, skill uninstall and skill status printed the same six columns, and uninstall and status left some of them empty. Now skill uninstall leaves out VERDICT and VERSION, and skill status leaves out ACTION. skill install and the -o json output are unchanged.
  • rancher skill uninstall removes the skills directory it empties. Before, uninstalling left an empty skills directory behind in each coding agent's folder, such as ~/.claude/skills. A skills directory that still holds other files or directories stays. If the empty directory cannot be removed, the command prints a warning that names it and still exits 0.
  • The installers retry a failed download once and show the real HTTP status. Before, without a GitHub token, any HTTP error on the rancher binary's download said the file was missing from the release. Now install.sh and install.ps1 retry each release file once after 2 seconds. If it fails again, the error shows the URL and the HTTP status, or why no response came back. When a GitHub token was used, the error also says where the token came from: GH_TOKEN, GITHUB_TOKEN or gh auth token.
  • install.sh on Linux no longer leaves dbus-daemon and gnome-keyring-daemon running. Before, on a host with gh, dbus-x11 and gnome-keyring but no D-Bus session bus, the installer ran gh auth token, which started both daemons. They kept running after the install. Now the installer stops gh from starting a session bus there.
  • Built-in examples run as written. Before, the create kubeconfig and create secret examples lacked --yes and were refused when copied. Now every example carries the flags it needs, and a refusal for a missing --apply names --dry-run.
  • The file rancher create kubeconfig writes now lists its tokens and their expiry in its header. Before, it named no tokens or expiry. rancher auth logout --all does not revoke these tokens. rancher delete kubeconfig does.
  • The rancher create user examples send the password with printf '%s'. Before, they piped it through echo -n. A shell whose echo takes no options, such as the macOS /bin/sh, sent -n and a newline with the password.
  • rancher schema says 1 command matches when a search finds one command. Before, it said 1 commands match.

Compatibility

  • rancher delete now waits until the object is gone, for up to --timeout (default 5m). A script that relied on the old immediate return now waits longer. Add --wait=false to return at once.
  • Several error codes changed. Check scripts that test these codes.
    • When Rancher denies access to a cluster or project id, the code is RBAC (exit 6), no longer NOT_FOUND.
    • A write refused by Kubernetes admission is VALIDATION (exit 2), and a temporary 403 from admission is GENERIC (exit 1). Both were RBAC.
    • A wrong current password is VALIDATION (exit 2), no longer GENERIC. Changing another user's password without permission is RBAC (exit 6), no longer AUTH.
    • charts --repo of a disabled ClusterRepo, and an invalid --repo value, are VALIDATION (exit 2), no longer GENERIC.
  • rancher skill uninstall and skill status print fewer table columns. A script that reads the table by column position now reads other columns. Use -o json.
  • install.sh cannot read a keyring-only gh token on a Linux host with no D-Bus session bus. The installer now stops gh from starting a session bus there, which also stops gh from reaching the keyring. If gh finds no other token, the installer skips the attestation check and prints a notice. If you pass --verify-attestation, it exits with an error instead. To use a keyring token on such a host, set GH_TOKEN.

Known issues

  • When you use a config directory other than the default, a command printed as a remedy can come out with an unmatched quote if a value in the error contains a hidden character. Retype the command instead of pasting it.
  • On a Linux host that has dbus-launch but no D-Bus session bus, rancher auth login starts a dbus-daemon and a gnome-keyring-daemon that keep running after it saves the login in its file store. To avoid it, set DBUS_SESSION_BUS_ADDRESS=disabled: when you run rancher on such a host.