---
title: Charmhub | Deploy Apache Kafka - K8s using Charmhub - The Open Operator Collection
description: Deploy the latest version of Apache Kafka - K8s as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/kafka-k8s/actions
---

# Apache Kafka - K8s

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")
* [Databases](https://charmhub.io/?filter=databases)

Platform:

4/stable 111

```
juju deploy kafka-k8s --channel 4/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

* [force-refresh-start](https://charmhub.io/kafka-k8s/actions#force-refresh-start)
* [get-listeners](https://charmhub.io/kafka-k8s/actions#get-listeners)
* [pre-refresh-check](https://charmhub.io/kafka-k8s/actions#pre-refresh-check)
* [rebalance](https://charmhub.io/kafka-k8s/actions#rebalance)
* [resume-refresh](https://charmhub.io/kafka-k8s/actions#resume-refresh)

[Learn about actions >](https://juju.is/docs/juju/action)

* force-refresh-start

  Potential of data loss and downtime

  Force refresh of first unit

  Must run with at least one of the parameters `=false`

  Params

  + check-compatibility
    boolean

    Potential of data loss and downtime

    If `false`, force refresh if new version of Kafka and/or charm is not compatible with previous version
  + check-workload-container
    boolean

    Potential of data loss and downtime during and after refresh

    If `false`, allow refresh to Kafka container version that has not been validated to work with the charm revision
  + run-pre-refresh-checks
    boolean

    Potential of data loss and downtime

    If `false`, force refresh if app is unhealthy or not ready to refresh (and unit status shows "Pre-refresh check failed")
* get-listeners

  Get all active listeners and their port allocations
* pre-refresh-check

  Check if charm is ready to refresh
* rebalance

  Trigger a rebalance of cluster partitions based on configured goals

  Params

  + brokerid
    integer

    Broker ID newly added to the cluster or to be removed. The broker ID is the unit number, e.g. kafka/0 is broker 0.
  + dryrun
    boolean

    Only generate the partition rebalance proposals and estimated result, without executing
  + mode
    string

    The operation to issue to the balancer. This action must be called on the leader unit. 'full' - runs a full rebalance of all partitions across the whole cluster 'add' - evenly distributes replicas to new and available brokers 'remove' - moves under-replicated partition replicas assigned to decommissioned brokers, to available ones

  Required

  mode
* resume-refresh

  Refresh next unit(s) (after you have manually verified that refreshed units are healthy)

  If the `pause-after-unit-refresh` config is set to `all`, this action will refresh the next unit.

  If `pause-after-unit-refresh` is set to `first`, this action will refresh all remaining units.
  Exception: if automatic health checks fail after a unit has refreshed, the refresh will pause.

  If `pause-after-unit-refresh` is set to `none`, this action will have no effect unless it is called with `check-health-of-refreshed-units` as `false`.

  Params

  + check-health-of-refreshed-units
    boolean

    Potential of data loss and downtime

    If `false`, force refresh (of next unit) if 1 or more refreshed units are unhealthy

    Warning: if first unit to refresh is unhealthy, consider running `force-refresh-start` action on that unit instead of using this parameter.
    If first unit to refresh is unhealthy because compatibility checks, pre-refresh checks, or workload container checks are failing, this parameter is more destructive than the `force-refresh-start` action.
