Migrate to Confluent CLI v2
Important
We’ve become aware of a bug that prevents the CLI client confluent from functioning nominally on Windows machines in confluent v2.0.0, confluent v2.1.0, and confluent v2.1.1. A fix has been released as confluent v2.2.0.
If you are currently using confluent v2.0.0, confluent v2.1.0. or confluent v2.1.1 on a Windows machine, you will have to remove the existing client and perform a fresh install of confluent v2.2.0+. (The in-client update command will not update to confluent v2.2.0+ on Windows machines.) The terminal command curl -sL https://cnfl.io/cli | sh -s -- -b $(dirname $(which confluent)) will perform a clean install by overwriting the existing client, in place, with the latest release. See the Installation Guide for additional installation options.
If you are currently using the deprecated ccloud v1.x client, the command ccloud update --major will result in an update to the most recent version of confluent. Prior to performing this major update, please read the guide below, however.
Until today, we’ve had separate CLI clients for managing Confluent Cloud (ccloud) and Confluent Platform (confluent).
The second major version of the Confluent CLI, confluent v2, allows you to manage both Confluent Cloud and Confluent Platform from the same CLI client.
ccloud will be sunset on September 6, 2022, and new functionality will appear in the unified confluent client.
As with prior CLI versions, you must authenticate against a specific deployment before you can execute management commands.
To manage a Confluent Cloud deployment, run the following command which is comparable to what you did with the old
ccloudclient:confluent loginTo manage a Confluent Platform deployment, run the following command just as you did with the preceding
confluent v1.xclient:confluent login --url <Metadata service URL>
The functionality of confluent v2 is determined by whether you are logged in to a Confluent Cloud or Confluent Platform deployment.
Below is a description of the breaking changes included in this release, as well as directions for how you can update to confluent v2 from an existing Confluent CLI. Accommodating the breaking changes may require updating your existing scripts.
Email us at cli@confluent.io with questions or comments.
Breaking Changes
confluent v2 includes several changes that break with the syntax or output structure of the previous major release. Scripts used to interact with confluent v1.x or ccloud v1.x may have to be updated to accommodate these changes.
Breaking changes for Confluent Cloud CLI and Confluent CLI
iam rolehas moved under theiam rbacgroup. So,iam roleis nowiam rbac role.rolebindinghas been renamed torole-bindingand has been moved under theiam rbacgroup. So,iam rolebindingis nowiam rbacrole-binding.The
config contextgroup is now justcontext. Additionally, commands within this group have been updated to conform to the client’s broader syntax pattern:context updateupdates an existing context.context describedescribes an existing context. By default, this describes the current context and therefore replacesconfig contextcurrent.
Breaking changes for Confluent Cloud
The
ccloudclient name is changed toconfluent.SSO refresh tokens now expire after 4 hours.
The
connectorcommand group is changed toconnect. For example,connector createis nowconnect create.The
connector-cataloggroup is nowconnect plugin. For example,connector-catalog listis nowconnect plugin list.The
ksql app createcommand now requires--api-keyand--api-secretflags. Until now, these flags were optional.The value of resource ID properties, for example, for identifying users, service accounts, clusters, have been changed from integers to alphanumeric strings.
Partition information has been removed from the output of
kafka topicdescribe.In the
kafka cluster describecommand output, the propertyApiEndpointhas been renamedKAPI, and is only visible if the--allflag is passed.In the
kafka aclcommand group, the following parameter names in the outputs have been updated to match those of the Confluent REST Proxy.ServiceAccountId→PrincipalResource→ResourceTypeName→ResourceNameType→PatternType
signupis nowcloud-signup. Accessing this command does not require a preceding Confluent Cloudlogin.inithas been replaced bycontext create.In
api-key list, the--service-acountflag no longer erroneously accepts a user ID.The
service-accountcommands have been moved under theiamgroup. So,service-accountis nowiam service-account.The
usercommands have been moved from theadmingroup to theiamgroup. So, theadmin usergroup is nowiam user.In
iam user listandiam service-account list, the propertyresource_idhas been renamed toidfor consistency across the client.In the
iam usergroup,inviteis nowinvitation create. So, admin user invite is nowiam user invitation create. This change made space for the new commandiam user invitation list, which lists all of the pending invitations that have been created.
Breaking changes for Confluent CLI
The
secretcommand now requires authentication.In the
iam aclcommand group, the following parameter names in the outputs have been updated to match those of the Confluent REST Proxy:Resource→ResourceTypeName→ResourceNameType→PatternType
Environment variable name changes
Supported environment variable names have been updated as below:
CCLOUD_EMAIL→CONFLUENT_CLOUD_EMAILCCLOUD_PASSWORD→CONFLUENT_CLOUD_PASSWORDCONFLUENT_USERNAME→CONFLUENT_PLATFORM_USERNAMECONFLUENT_PASSWORD→CONFLUENT_PLATFORM_PASSWORDCONFLUENT_MDS_URL→CONFLUENT_PLATFORM_MDS_URLCONFLUENT_CA_CERT_PATH→CONFLUENT_PLATFORM_CA_CERT_PATH
Migrate to Confluent CLI v2.x from Confluent Cloud CLI
ccloud v1.43, the last minor version of the client, will be released on November 9, 2021. Patch releases will continue to be released, if necessary, but no new functionality will be added.
From within any earlier ccloud version, ccloud update will update the client to this final release.
From ccloud v1.43, you can upgrade directly to the latest confluent v2.x release with the command:
ccloud update --major
ccloud will be sunset on September 6, 2022. At that point, ccloud will no longer be capable of authenticating into Confluent Cloud, and you will have to migrate to a confluent v2.x client in order to manage your Confluent Cloud deployment from the terminal.
Migrate to Confluent CLI v2.x from Confluent CLI v1.x
confluent v1.x is only capable of Confluent Platform management. Note that Confluent Platform comes bundled with a compatible version of confluent.
Confluent Platform v7.1 will be the first version that is interoperable with the confluent v2.x client. Therefore, if you are using a Confluent Platform version prior to v7.1, you should not migrate to confluent v2.x. See the interoperability guide for complete details on Confluent Platform-to-confluent compatibility.
Although it is unlikely to be necessary due to interoperability concerns, you can also upgrade to confluent v2.x directly from confluent v1.43 with the command:
confluent update --major
Directly install Confluent CLI v2.x
See the Installation Guide on how to download and install confluent v2.x directly.
Run multiple CLIs in parallel
Confluent Platform 7.0 and lower versions are not fully interoperable with the recently released confluent v2 CLI client. confluent v2, however, is the most recent CLI client for managing Confluent Cloud.
Starting in v7.1, Confluent Platform will ship with a CLI version that is capable of managing both Confluent Platform and Confluent Cloud. If you want to manage both Confluent Platform and Confluent Cloud from the same machine before Confluent Platform v7.1 is available, set up and run confluentv1 and confluent v2 in parallel as described in this section.
For example, you can manage a Confluent Platform deployment with a confluent v1.x client and manage a Confluent Cloud deployment with a confluent v2.x client.
Setup
- Set up a local environment for
confluent v1 If you have an existing
confluentclient, for example, one that was packaged with Confluent Platform, remove it to avoid confusion:rm $(which confluent)
Create a directory for
confluent v1and its corresponding config file. Ensure that this directory is NOT part of your$PATH:mkdir ~/confluent-v1/Download a new instance of the
confluent v1binary to theconfluent-v1directory.In this example, we’re downloading
confluent v1.43.1, which is compatible with Confluent Platform v7.0.See the full Confluent CLI to Confluent Platform interoperability table.
We recommend using the latest Confluent CLI version that is compatible with your Confluent Platform version.
For reference, full CLI installation instructions can be found Install Confluent CLI.
curl -sL https://cnfl.io/cli | sh -s -- -b ~/confluent-v1 v1.43.1
Create an alias for
confluent v1.Consider adding this alias definition to your shell’s startup file (
.bashrc,.zshrc, etc…), so it is sourced before each session. The alias will make the client easier to use from the terminal. It also ensures yourconfluent v1configuration file is stored in the~/confluent-v1directory, and will not conflict with the configuration file for theconfluent v2client you’ll install shortly.alias confluent-v1="HOME=~/confluent-v1 ~/confluent-v1/confluent"
Verify that a configuration file has been created in the
~/confluent-v1directory:confluent-v1 versionls ~/confluent-v1/.confluent/config.jsonDisable update messages for this version:
echo '{"disable_updates": true}' > ~/confluent-v1/.confluent/config.json
- Set up
confluent v2globally. Download the latest version of
confluent v2:curl -sL https://cnfl.io/cli | sh -s -- -b /usr/local/bin
Add
confluent v2to your$PATH:export PATH="/usr/local/bin:$PATH"
Optionally, if you had previously been using a now-deprecated
ccloudclient for Confluent Cloud management, you can remove it.rm $(which ccloud)
Run CLIs in parallel
- To manage Confluent Platform with
confluent v1: confluent-v1 login --url <mds-url>
confluent-v1 [command]
For details, see Log into an RBAC-enabled Confluent Platform cluster.
- To manage Confluent Cloud with
confluent v2: confluent loginconfluent [command]
For details, see Connect to a Confluent Cloud cluster.