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 usage of a specific endpoint port #11

Merged
merged 3 commits into from
Aug 24, 2023

Conversation

FatmaBouzghaia
Copy link

@FatmaBouzghaia FatmaBouzghaia commented Aug 22, 2023

When pulling cluster from Consul, the port exposed is not
necessarily the one that must be used in order to authenticate
on the cluster. This feature allows to set a different endpoint
pot to authenticate on the ElasticSearch cluster.

By default, the endpoint port is the one exposed in Consul.

@geobeau
Copy link

geobeau commented Aug 23, 2023

Can you add a message on the commit to explain the intent of the change. It's not clear why we need to override the port and why we need a specific port for authentication.

When pulling cluster from Consul, the port exposed is not
necessarily the one that must be used in order to authenticate
on the cluster. This feature allows to set a different endpoint
pot to authenticate on the ElasticSearch cluster.

By default, the endpoint port is the one exposed in Consul.

Signed-off-by: f.bouzghaia <f.bouzghaia@criteo.com>
cmd/serve.go Outdated
@@ -19,6 +19,7 @@ type ServeCmd struct {
CleaningPeriod time.Duration `default:"600s" help:"prometheus metrics cleaning interval (for vanished nodes)"`
ElasticsearchConsulTag string `default:"maintenance-elasticsearch" help:"elasticsearch consul tag"`
ElasticsearchEndpointSuffix string `default:".service.{dc}.foo.bar" help:"Suffix to add after the consul service name to create a valid domain name"`
ElasticsearchEndpointPort int `default:"-1" help:"Elasticsearch port used for cluster authentication"`
Copy link

Choose a reason for hiding this comment

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

Default should be 0 to be consistent with how Golang handle defaults (int defaults to 0).

Copy link
Author

Choose a reason for hiding this comment

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

Done

cmd/serve.go Outdated
@@ -19,6 +19,7 @@ type ServeCmd struct {
CleaningPeriod time.Duration `default:"600s" help:"prometheus metrics cleaning interval (for vanished nodes)"`
ElasticsearchConsulTag string `default:"maintenance-elasticsearch" help:"elasticsearch consul tag"`
ElasticsearchEndpointSuffix string `default:".service.{dc}.foo.bar" help:"Suffix to add after the consul service name to create a valid domain name"`
ElasticsearchEndpointPort int `default:"-1" help:"Elasticsearch port used for cluster authentication"`
Copy link

Choose a reason for hiding this comment

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

You specify cluster authentication but the port will be used for all cluster levels calls (snapshot, durability, ...)

Copy link
Author

Choose a reason for hiding this comment

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

Done

f.bouzghaia added 2 commits August 23, 2023 16:05
Default value for int is 0 for GoLang

Signed-off-by: f.bouzghaia <f.bouzghaia@criteo.com>
Signed-off-by: f.bouzghaia <f.bouzghaia@criteo.com>
@FatmaBouzghaia FatmaBouzghaia merged commit 704d910 into criteo-forks:master Aug 24, 2023
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.

2 participants