Skip to content

devops-ia/kafka-cruise-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cruise Control for Apache Kafka

Introduction

Compile an optimize image of Cruise Control for Apache Kafka on Docker. Based on linkedin/cruise-control.

Default versions:

  • Cruise Control: migrate_to_kafka_2_5
  • Cruise Control UI: 0.3.4

Image details (from dive)

│ Image Details ├─────────────

Total Image size: 273 MB
Potential wasted space: 4.5 MB
Image efficiency score: 98 % 

You can reproduce this summary with dive:

dive build -t <tag-name> .

Quick start!

REMEMBER: Kafka and Cruise Control must be have the same Java running version. If you want other Java version check "Change Java version" and rebuild the image. All allowed tags.

Pull image

docker build -t <tag-name> .

Replace config

You must change the next values with your properly nodes:

  • bootstrap.servers=
  • zookeeper.connect=

Run container

docker run --name <container-name>            \
  -p 9090:9090                                \
  -v config:/cruise-control/config            \
  -v config/config.csv:/cruise-control/config \
  <tag-name>

Configure Nginx

By default, Cruise Control can't change the location path if you want use another than /, for example: /my-kafka-cruise-control. So, you should configure your webserver to modify the request:

# sample cruise-control location
location /<locationPath> {

    # rewrites
    rewrite ^/<locationPath>/(.*) /$1 break;

    # proxy_pass configuration
    proxy_pass http://<ip-host>:<port-cruise-control>;
    proxy_pass_request_headers on;

    # sub_filters
    sub_filter /static/js          /<locationPath>/static/js;
    sub_filter /static/css         /<locationPath>/static/css;
    sub_filter /static/cc-logo.png /<locationPath>/static/cc-logo.png;
    sub_filter /kafkacruisecontrol /<locationPath>/kafkacruisecontrol;
    sub_filter_last_modified on;
    sub_filter_once off;
    sub_filter_types *;
}

Change Java version

You can compile with other Java version, you can check all posible tags from: openjdk, remember filter by: jre-slim-buster and rebuild the image:

docker build --build-arg OPENJDK_VERSION=<version> -t <image-name> . # example version: 11.0.15

Change Cruise Control and Cruise Control UI version

You can change the default Cruise Control version and Cruise Control UI version with CC_TAG and CC_UI_TAG arguments (please check environment-requirements and compatibilities)

docker build --build-arg CC_TAG=<version> --build-arg CC_UI_TAG=<version> -t <image-name> . # example CC_TAG=migrate_to_kafka_2_4 and CC_UI_TAG=0.4.0

Contributing

We're happy if you want open and issue or a new feature :)