Repository navigation
·
49 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
rancher app installandrancher app uninstallinstall 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--applyto install, and--apply --yesto uninstall. Values from your--valuesfiles are never printed, except a registry host. The namespace must already exist.rancher app installalso sends values that describe the cluster, underglobal.cattle, as the Rancher UI does. It adds eachglobal.cattlevalue 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'ssystem-default-registrysetting, as in the Rancher UI.--no-system-default-registrysends no registry. Either flag on a chart that declares no registry is refused withVALIDATION(exit 2).app upgradetakes both flags too.rancher app install --waitandrancher app uninstall --waitwait until Helm's run ends and report how it ended. An install returns the release's revision and the statusdeployed, and an uninstall returns once the App is gone. A failed run ends withGENERIC(exit 1, not retryable). The error names the command to run next, and Helm's exit code when Rancher reports one.--timeoutalone also waits. The timeout defaults to 55m, the longest allowed. Ctrl-C ends the wait withINTERRUPTED(exit 130) while Helm's run goes on in Rancher.rancher app upgradechanges 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--valuesfile over them.--reset-valuesskips 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 --yesto upgrade, and--waitto 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-nameis required. The dry-run preview showsp-*instead of the id, because Rancher generates a different id when you run the command with--apply. The--applyresult shows the generated id (data.metadata.namewith-o json). With an id,--display-namedefaults to the id.rancher get,patchanddelete projectroletemplatebindingtake--clusterand--project, asgrantandrevokedo. They find the project's backing namespace themselves. You no longer type-n <cluster>-<project>. Pass both--clusterand--project.--projecttakes the project's id or display name. Giving only one of them is refused withVALIDATION(exit 2).rancher get,patchanddelete managedchartshow, change and delete Rancher's ManagedCharts. A ManagedChart installs a Helm chart through Fleet on its target clusters.getshows the chart, version and ready clusters, and hides the Helm values.patchanddeleteneed--apply --yes. A delete makes Fleet uninstall the chart from every target cluster, unless its target setskeepResources: true. Acreate resourcepreview of a ManagedChart warns that Rancher installs the chart on every target cluster.rancher get authconfiglists 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,deleteand creating one from a manifest are refused, with the reason.rancher create password-change-request --current-password-stdinsends 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,clusterroleandclusterrolebindinglist 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,deleteand creating one from a manifest are refused before any request. The error points to kubectl (throughrancher kubeconfig) and torancher grantorrancher revoke.rancher inspect cluster --registrationbuilds the node registration commands of a custom cluster, with the options the Rancher UI offers. Pass--etcd,--controlplaneand--worker(all three when none is given),--node-name,--address,--internal-address,--labeland--taint.--windowsbuilds the Windows command for clusters where the Rancher UI shows one. These commands are underregistration.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=falsereturns 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=falsereturns 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, andrancher node stop-drainstops 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 --yesto drain. The command waits until Rancher reports the drain done or failed;--wait=falsereturns 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 withRBAC(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.patchandcreate resourceof a management node are refused, and it has nodelete. Likenode drain, it needs access to Rancher's local cluster.
Changed
- Every
rancher deletenow 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=falsereturns at once and printsdeletion started, and-o jsonhasdata.waited. A timeout or interrupt is an error that says the deletion was requested and names agetcommand to check it. rancher delete project --delete-namespaceswaits 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), notRBAC. Before, a write refused by a ResourceQuota, a LimitRanger, PodSecurity, a ValidatingAdmissionPolicy or one of several other admission plugins wasRBAC(exit 6). Now it isVALIDATIONwith the server's message. A temporary 403 from admission is a retryableGENERIC(exit 1) error. A 409 from an admission webhook is aCONFLICTthat is not retryable. - When Rancher denies access to a cluster or project id, the CLI reports
RBAC(exit 6), notNOT_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 reportsRBACtoo, unless you can read every cluster or project.rancher access projects --clusterstill reportsNOT_FOUND. - Table cells and
-o namenames with hidden characters print in double quotes. Table and wide cells, headers and-o namenames 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-requestgives each of Rancher's two password errors its own code. A wrong current password is nowVALIDATION(exit 2), notGENERIC(exit 1). Changing another user's password without permission is nowRBAC(exit 6), notAUTH(exit 3).rancher create userandcreate password-change-requestrefuse a password piped to--password-stdinthat has more than one line. With--current-password-stdin,create password-change-requestneeds exactly two lines instead.rancher create projectrefuses an invalid id withVALIDATION(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-nameand 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 mode0700does on Linux and macOS. A directory that already exists keeps its access list. rancher telemetry statussays whether recorded events are sent. A release build printssending: none - this build sends no event; recorded events stay on this machine, and-o jsonhas asendsEventsfield.rancher telemetry showlabels 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 theobjectset.rio.cattle.io/appliedannotation. Before, they hid onlykubectl.kubernetes.io/last-applied-configuration. Controllers that apply objects with Rancher's wrangler library writeobjectset.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 secretincluded.rancher schema --searchnow shows your search text in single quotes, in thecommands matchline 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 ashttps://admin:1234/x@hwas accepted, and a login or token went to the hostadminon port 1234. Such a URL usually comes from a password that contains/,?or#, typed ashttps://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.shandinstall.ps1accepted 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 needsgh2.68.0 or newer, logged in. Ifghis missing, older or not logged in, the installer skips the check and prints a notice. With--verify-attestation(-VerifyAttestationon Windows) it stops instead.
Fixed
- When Rancher rejects your saved login token, the
AUTHerror now tells you the command that logs you in again. Before, the error told you to runrancher auth status, which sends the same token and fails with a 401 too. Now it suggestsrancher 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 clustersandrancher get projectswork for a cluster or project member. Before, they failed withRBAC(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 forrancher cluster scaleand 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 getreads 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 projectandcreate resource -fwith 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 grantandrancher revokework 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 islocal://<id>or Rancher's own form, such asu-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 aresourceVersion, and that no admission webhook refused, gets that retryableCONFLICT. Any other 409 is aCONFLICTthat is not retryable, with the server's message. rancher config add-serverandrancher auth login --urlaccept a--cacertthat 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 --reporefuses a disabled ClusterRepo withVALIDATION(exit 2). Before, the result depended on the Rancher version: a retryableGENERICerror (exit 1), or the charts the repository had before it was disabled. The error namesrancher get clusterrepo <name>to show the repository, and the command reads no chart index for it.rancher charts,app installandapp upgraderefuse a--repovalue that is not a ClusterRepo name. Before,chartsandapp installsent a value such asa/bto Rancher and failed with a generic error (exit 1).app upgraderead the cluster and the App first, and only then failed. Now each command refuses such a value withVALIDATION(exit 2) before any request. A ClusterRepo name is a DNS subdomain name: at most 253 characters of lowercase letters, digits,-and..rancher support-bundlenow 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'smanifest.jsonshowserror:forrancher/settings.json, with the names of the settings the command could not read and the first error. Theerrorscount (data.errorswith-o json) goes up by one. The exit code does not change.- For kinds Rancher keeps on its local cluster,
--namespacehelp says which namespace to pass. Before,get,patchand, where the kind has one,deleteof the Fleet, provisioning, CAPI and etcd snapshot kinds and ofclusterregistrationtokendescribed--namespaceas the namespace to operate in. Completion offered the namespaces of the--clustercluster, 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 jsonand-o yamldo not change. rancher skill uninstallandrancher skill statusshow only the columns they fill. Before,skill install,skill uninstallandskill statusprinted the same six columns, and uninstall and status left some of them empty. Nowskill uninstallleaves out VERDICT and VERSION, andskill statusleaves out ACTION.skill installand the-o jsonoutput are unchanged.rancher skill uninstallremoves theskillsdirectory it empties. Before, uninstalling left an emptyskillsdirectory behind in each coding agent's folder, such as~/.claude/skills. Askillsdirectory 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
rancherbinary's download said the file was missing from the release. Nowinstall.shandinstall.ps1retry 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_TOKENorgh auth token. install.shon Linux no longer leavesdbus-daemonandgnome-keyring-daemonrunning. Before, on a host withgh,dbus-x11andgnome-keyringbut no D-Bus session bus, the installer rangh auth token, which started both daemons. They kept running after the install. Now the installer stopsghfrom starting a session bus there.- Built-in examples run as written. Before, the
create kubeconfigandcreate secretexamples lacked--yesand were refused when copied. Now every example carries the flags it needs, and a refusal for a missing--applynames--dry-run. - The file
rancher create kubeconfigwrites now lists its tokens and their expiry in its header. Before, it named no tokens or expiry.rancher auth logout --alldoes not revoke these tokens.rancher delete kubeconfigdoes. - The
rancher create userexamples send the password withprintf '%s'. Before, they piped it throughecho -n. A shell whoseechotakes no options, such as the macOS/bin/sh, sent-nand a newline with the password. rancher schemasays1 command matcheswhen a search finds one command. Before, it said1 commands match.
Compatibility
rancher deletenow 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=falseto 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 longerNOT_FOUND. - A write refused by Kubernetes admission is
VALIDATION(exit 2), and a temporary 403 from admission isGENERIC(exit 1). Both wereRBAC. - A wrong current password is
VALIDATION(exit 2), no longerGENERIC. Changing another user's password without permission isRBAC(exit 6), no longerAUTH. charts --repoof a disabled ClusterRepo, and an invalid--repovalue, areVALIDATION(exit 2), no longerGENERIC.
- When Rancher denies access to a cluster or project id, the code is
rancher skill uninstallandskill statusprint fewer table columns. A script that reads the table by column position now reads other columns. Use-o json.install.shcannot read a keyring-onlyghtoken on a Linux host with no D-Bus session bus. The installer now stopsghfrom starting a session bus there, which also stopsghfrom reaching the keyring. Ifghfinds 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, setGH_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-launchbut no D-Bus session bus,rancher auth loginstarts adbus-daemonand agnome-keyring-daemonthat keep running after it saves the login in its file store. To avoid it, setDBUS_SESSION_BUS_ADDRESS=disabled:when you run rancher on such a host.