Skip to content

feat: Elasticsearch access via API Key#13167

Open
leonardlin wants to merge 3 commits intoinfiniflow:mainfrom
peoplegeist:main
Open

feat: Elasticsearch access via API Key#13167
leonardlin wants to merge 3 commits intoinfiniflow:mainfrom
peoplegeist:main

Conversation

@leonardlin
Copy link

@leonardlin leonardlin commented Feb 18, 2026

What problem does this PR solve?

As requested: #10321

Elasticsearch configuration uses username/password.
In order to use external / cloud hosted elasticsearch, we need to enable API-Key based authentication.

Following changes:
Adds ELASTIC_API_KEY as configuration
Connection Pool checks if APIKey is present and tries to use it
HelmChart allows to disable the elasticsearch deployment

Type of change

  • New Feature (non-breaking change which adds functionality)

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. labels Feb 18, 2026
@leonardlin
Copy link
Author

@Magicbook1108 @KevinHuSh this is the updated PR

fixed local configuration

feat: Elasticsearch access via API Key: reverse testconfig

feat: Elasticsearch access via API Key: reverse testconfig
@kowkowhuang
Copy link

Exactly what's the point of Basic Auth when the Elastic Cloud provided default API is based on endpoint + API Key? Shockingly bad decision to build something with basic auth.

@click.option("--es-user", default=None, help="Elasticsearch username")
@click.option("--es-password", default=None, help="Elasticsearch password")

Can I plase also request you do NOT default the endpoint of ES cloud to 9200 pls? The ES cloud's default provided port is 443 not 9200

@click.option("--es-port", default=9200, type=int, help="Elasticsearch port")

@KevinHuSh KevinHuSh added the ci Continue Integration label Feb 24, 2026
docker/.env Outdated

# The hostname where the Elasticsearch service is exposed
ES_HOST=es01
ES_HOST=http://es01:9200
Copy link
Collaborator

@KevinHuSh KevinHuSh Feb 24, 2026

Choose a reason for hiding this comment

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

Appreciations!
This default setting should not be changed in consideration other users.

Copy link
Author

Choose a reason for hiding this comment

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

Hi @KevinHuSh

There was no actual change in default port or protocol. It was http/9200 before too.

The difference is:

Previously the default protocol (http) and default port (9200) was populated/enforced in the docker/service_conf.yaml.template.
There was no way to define httpS or another port via environment variables.

ES_HOST as environment variable is not used directly but only the after parsing in service_conf.yaml.template

This means for the cases:
No ES_HOST defined: In service_conf.yaml.template the old default is defined: http://es01:9200

ES_HOST defined as old default: http://es01:9200 -> passed through

ES_HOST set to another external service -> passed through

Does this help to clarify?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The circumstance might be more complicated. By my understanding, this requires .env and service_conf.yaml should be with the same version since they're coupled. For some users, they might apply the latest .env with the older version of service_conf.yaml. So, we should try our best to make minimum alteration to avoid unecessary confusion for all users.

Copy link
Author

Choose a reason for hiding this comment

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

@KevinHuSh I updated the approach to keep the old ES_HOST format.

@KevinHuSh KevinHuSh removed the ci Continue Integration label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💞 feature Feature request, pull request that fullfill a new feature. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants