Skip to content

Adding instruction for running Kroxylicious via Docker Compose to qui… #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gunnarmorling
Copy link
Contributor

…ck start guide (#2435)

Fixes kroxylicious/kroxylicious#2435. It's a first quick draft to get a discussion going. Please let me know if there's anything which should be changed, be it in terms of contents or operational details like commit message structure, etc. Note I didn't copy that tabbed pane for the client commands from the local example, as there's no ready-made container image for kaf. While one could build an image locally, I felt it's not worth the effort probably. Thanks for any feedback!

@SamBarker
Copy link
Member

SamBarker commented Jul 14, 2025

Thanks @gunnarmorling

We like Kaf so we do build our own image quay.io/kroxylicious/kaf which is currently quay.io/kroxylicious/kaf:v0.2.13

I'll give the PR a proper pass later.

@tombentley
Copy link
Member

@gunnarmorling would you be able to sign off your commits? A git rebase --signoff origin/main + git push -f (depending how you name the upstream) should fix it.

services:
# from https://github.com/apache/kafka/blob/trunk/docker/examples/docker-compose-files/single-node/plaintext/docker-compose.yml
kafka:
image: apache/kafka:4.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably want to extend our renovate config to bump the image refs. Does not need to be part of this PR.

@gunnarmorling
Copy link
Contributor Author

Thanks all for reviewing! Will look into kaf support, thanks for that reference, @SamBarker! Will also sign off the commit, @tombentley.


## Step 1: Create the Compose file

Create a file named _docker-compose.yaml_ with the following contents:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: It's just called compose.yaml nowadays:

The default path for a Compose file is compose.yaml (preferred) or compose.yml that is placed in the working directory. Compose also supports docker-compose.yaml and docker-compose.yml for backwards compatibility of earlier versions. If both files exist, Compose prefers the canonical compose.yaml.

Suggested change
Create a file named _docker-compose.yaml_ with the following contents:
Create a file named `compose.yaml` with the following contents:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, TIL. Thanks for bringing this up!


```yaml
services:
# from https://github.com/apache/kafka/blob/trunk/docker/examples/docker-compose-files/single-node/plaintext/docker-compose.yml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Use the tagged commit for Kafka 4.0.0 to keep the contents of the docker-compose.yml file stable.

Suggested change
# from https://github.com/apache/kafka/blob/trunk/docker/examples/docker-compose-files/single-node/plaintext/docker-compose.yml
# from https://github.com/apache/kafka/blob/4.0.0/docker/examples/docker-compose-files/single-node/plaintext/docker-compose.yml

Comment on lines +171 to +172
ports:
- '9092:9092'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Do we need to expose any port here?

The (local) clients will use Kroxylicious to connect to the cluster, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, it's not needed. I still like it, as it allows local clients to connect directly, when needed.


## Step 3: Start the proxy

In the directory with both the _docker-compose.yaml_ file and the _proxy-config.yaml_ file, run the following command:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: see previous comment.

Suggested change
In the directory with both the _docker-compose.yaml_ file and the _proxy-config.yaml_ file, run the following command:
In the directory with both the `compose.yaml` file and the `proxy-config.yaml` file, run the following command:

@tombentley
Copy link
Member

@k-wall were you intending to do another pass on this one?

@gunnarmorling
Copy link
Contributor Author

Quick heads-up, that I'm still planning to send an update to this, hopefully next week.

Copy link
Member

@SamBarker SamBarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gunnarmorling

I think we've swapped from markdown to ascii doc for quickstarts between you starting this and my review.

The other wrinkle is your PR is against a past version of the docs 0.13.0 rather than to the current SNAPSHOT. So this should probably become a peer of docs/proxy-quick-start, maybe as container-quick-start.

Comment on lines +192 to +201
kroxylicious:
image: quay.io/kroxylicious/kroxylicious:{{ page.version }}
ports:
- 9192:9192
- 9193:9193
volumes:
- ./proxy-config.yaml:/opt/kroxylicious/config/proxy-config.yaml
command: --config=/opt/kroxylicious/config/proxy-config.yaml
networks:
- my-network
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up playing with compose for an issue and ended up with

  kroxylicious:
    image: 'quay.io/kroxylicious/proxy:0.15.0-SNAPSHOT'
    container_name: kroxylicious
    command: --config /opt/kroxylicious/config/proxy-config.yaml
    ports:
      - "9192-9196:9192-9196"
    configs:
      - source: proxy-config
        target: /opt/kroxylicious/config/proxy-config.yaml

configs:
  proxy-config:
    file: ./proxy-config.yaml

The specifying the config/volumes at the top level seemed to help make things work with podman machine on a mac.

I'm not sure what syntax for ports is easier to read either. The one entry per line from your snippet vs the range on each side notation from mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide instructions for running on Docker.
5 participants