Skip to main content
Version: 23.1

Introduction to rpk

The rpk command line interface tool is designed to manage your entire Redpanda cluster, without the need to run a separate script for each function, as with Apache Kafka. The rpk commands handle everything from configuring nodes and low-level tuning, to high-level general Redpanda tasks. For example, you can use rpk to perform rolling upgrades and tuning, monitor your cluster’s health, and implement access control lists (ACLs) and other security features. You can also use rpk to perform basic streaming tasks, such as creating topics, producing to topics, and consuming from topics.

In general, rpk commands can be divided into these categories:

  • Managing Redpanda
  • Managing topics, producing to topics, and consuming from topics
  • Debugging and tuning the host
  • Interacting with Redpanda Cloud

Installation methods

The rpk binary is bundled with Redpanda, so it is automatically installed on each Redpanda broker. In addition, you can install rpk on your local machine as a standalone binary. This method can be used for self-hosted and cloud deployments, as well as Kubernetes deployments.

After you install rpk, you can use it to interact with a Redpanda cluster. The cluster can run on your local machine, or it can run externally on a remote server or on Redpanda Cloud, for example.

The following diagram shows how rpk communicates with a Redpanda broker installed on your local machine. The rpk binary is installed as part of the Redpanda bundle.

rpk communicating with a broker on your local machine

The next diagram shows how rpk communicates with a remote cluster when you install rpk as a standalone binary on your local machine.

rpk communicating with a remote cluster

Specifying command properties

You can specify rpk command properties in three ways:

  • By specifying the appropriate flag on the command line.

  • By defining the corresponding environment variables.

    Environment variable settings only last for the duration of a shell session.

  • By editing the configuration file settings in the rpk section of the redpanda.yaml file.

    Configuration file property settings stay the same for each shell session.

Command line flag settings take precedence over the corresponding environment variables, and environment variables take precedence over configuration file settings. If a required flag is not specified on the command line, Redpanda searches the environment variable. If the environment variable is not set, the value in the configuration file is used.

tip

If you specify rpk command properties in the configuration file or as environment variables, you don’t need to specify them again on the command line.

The following table lists command properties and their corresponding command line flags, environment variables, and configuration file settings.

PropertyFlagEnvironment VariableConfiguration File Field
Redpanda Brokers--brokersREDPANDA_BROKERSrpk.kafka_api.brokers
Admin API--api-urlsREDPANDA_API_ADMIN_ADDRSrpk.admin_api.addresses
Redpanda TLS Key--tls-keyREDPANDA_TLS_KEYrpk.kafka_api.tls.key_file
Redpanda TLS Cert--tls-certREDPANDA_TLS_CERTrpk.kafka_api.tls.cert_file
Redpanda TLS Truststore--tls-truststoreREDPANDA_TLS_TRUSTSTORErpk.kafka_api.tls.truststore_file
Redpanda SASL Mechanism--sasl-mechanismREDPANDA_SASL_MECHANISMrpk.kafka_api.sasl.type
Redpanda SASL Username--userREDPANDA_SASL_USERNAMErpk.kafka_api.sasl.user
Redpanda SASL Password--passwordREDPANDA_SASL_PASSWORDrpk.kafka_api.sasl.password
Redpanda Admin API TLS Key--admin-api-tls-keyREDPANDA_ADMIN_TLS_KEYrpk.admin_api.tls.key_file
Redpanda Admin API TLS Cert--admin-api-tls-certREDPANDA_ADMIN_TLS_CERTrpk.admin_api.tls.cert_file
Redpanda Admin API TLS Truststore--admin-api-tls-truststoreREDPANDA_ADMIN_TLS_TRUSTSTORErpk.admin_api.tls.truststore_file

Next steps

What do you like about this doc?




Optional: Share your email address if we can contact you about your feedback.

Let us know what we do well: