Skip to content
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

Add support for new configs including advertised_port and use_secured_proxy #20

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

YuWang24
Copy link

@YuWang24 YuWang24 commented Apr 19, 2022

About this change - What it does

I am currently using a reverse proxy server (Nginx) in front of Karapace Rest Proxy. I am using the docker environment, and Nginx and Karapace are listening on different ports. When creating a consumer using Karapace:

curl -XPOST https://<domain>:<nginx-port>/consumers/consumer1 -u <username>:<password> \
--data '{"name": "my_consumer_instance", "format": "json", "auto.offset.reset": "earliest"}' \
--header "Content-Type: application/vnd.kafka.json.v2+json

The base_uri in response just gives me the karapace's port rather than the nginx port.
The response:
{"base_uri":"http://<ip>:<karapace-port>/consumers/consumer1/instances/my_consumer_instance","instance_id":"my_consumer_instance"}

Also, the protocol in the base_uri response is using http as default and cannot be changed because there are no configs to change that.

This PR adds support for new configs including advertised_port and use_secured_proxy to solve these problems.

New configs are added in karapace/config.py. And they are used in karapace/kafka_rest_apis/consumer_manager.py if these configs are set.

References: INS-18187

Why this way

Copy link

@WeiXinFam-Insta WeiXinFam-Insta left a comment

Choose a reason for hiding this comment

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

LGTM

@vutdv-ic
Copy link

LGTM

Copy link

@sujayinstaclustr sujayinstaclustr left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants