Compile an optimize image of Cruise Control for Apache Kafka on Docker. Based on linkedin/cruise-control.
Default versions:
- Cruise Control:
2.5.141
- Cruise Control UI:
0.4.0
- AWS IAM Auth:
2.2.0
│ 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> .
Review: sample.cruise-control.properties
docker run --name <container-name> \
-p 9090:9090 \
-v config:/cruise-control/config \
-v config/config.csv:/cruise-control/config \
jdk17-cc2.5.138-iam2.2.0
- More samples: linkedin/cruise-control - configs
- More info: linkedin/cruise-control - wiki
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.
docker build -t <tag-name> .
You must change the next values with your properly nodes:
bootstrap.servers=<list-kafka-brokers>
zookeeper.connect=<list-zookeeper>
docker run --name <container-name> \
-p 9090:9090 \
-v config:/cruise-control/config \
-v config/config.csv:/cruise-control/config \
<tag-name>
- More samples: linkedin/cruise-control - configs
- More info: linkedin/cruise-control - wiki
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 *;
}
You can compile with other Java version, you can check all posible tags from: amazoncorretto
docker build --build-arg OPENJDK_VERSION=<version> -t <image-name> . # example version: 11
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=2.5.138 and CC_UI_TAG=0.4.0