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

Elasticsearch: always set discovery.seed_hosts to empty array #5950

Merged
merged 4 commits into from
Aug 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Elasticsearch: alwasy set discovery.seed_hosts to empty array
  • Loading branch information
pebrc committed Aug 12, 2022
commit 6812a8ebf0692854633c089e8e219278a483f25e
1 change: 1 addition & 0 deletions pkg/apis/elasticsearch/v1/fields.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ const (

DiscoveryZenHostsProvider = "discovery.zen.hosts_provider" // ES < 7.X
DiscoverySeedProviders = "discovery.seed_providers" // ES >= 7.X
DiscoverySeedHosts = "discovery.seed_hosts"
pebrc marked this conversation as resolved.
Show resolved Hide resolved

NetworkHost = "network.host"
NetworkPublishHost = "network.publish_host"
16 changes: 8 additions & 8 deletions pkg/controller/elasticsearch/nodespec/podspec_test.go
Original file line number Diff line number Diff line change
@@ -277,7 +277,7 @@ func TestBuildPodTemplateSpec(t *testing.T) {
"pod-template-label-name": "pod-template-label-value",
},
Annotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "957591218",
"elasticsearch.k8s.elastic.co/config-hash": "3893049321",
"pod-template-annotation-name": "pod-template-annotation-value",
"co.elastic.logs/module": "elasticsearch",
},
@@ -339,7 +339,7 @@ func Test_buildAnnotations(t *testing.T) {
{
name: "Sample Elasticsearch resource",
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "1382203021",
"elasticsearch.k8s.elastic.co/config-hash": "533641620",
},
},
{
@@ -352,7 +352,7 @@ func Test_buildAnnotations(t *testing.T) {
},
},
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "2958662249",
"elasticsearch.k8s.elastic.co/config-hash": "3131886472",
},
},
{
@@ -361,7 +361,7 @@ func Test_buildAnnotations(t *testing.T) {
esAnnotations: map[string]string{"eck.k8s.elastic.co/downward-node-labels": "topology.kubernetes.io/zone"},
},
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "481468635",
"elasticsearch.k8s.elastic.co/config-hash": "757126536",
},
},
{
@@ -370,7 +370,7 @@ func Test_buildAnnotations(t *testing.T) {
esAnnotations: map[string]string{"eck.k8s.elastic.co/downward-node-labels": "topology.kubernetes.io/zone,topology.kubernetes.io/region"},
},
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "3276316785",
"elasticsearch.k8s.elastic.co/config-hash": "3605766330",
},
},
{
@@ -382,7 +382,7 @@ func Test_buildAnnotations(t *testing.T) {
scriptsVersion: "84",
},
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "3641963559",
"elasticsearch.k8s.elastic.co/config-hash": "1607725946",
},
},
{
@@ -394,7 +394,7 @@ func Test_buildAnnotations(t *testing.T) {
scriptsVersion: "84",
},
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "3625185940",
"elasticsearch.k8s.elastic.co/config-hash": "1624503565",
},
},
{
@@ -406,7 +406,7 @@ func Test_buildAnnotations(t *testing.T) {
scriptsVersion: "85",
},
expectedAnnotations: map[string]string{
"elasticsearch.k8s.elastic.co/config-hash": "3917140820",
"elasticsearch.k8s.elastic.co/config-hash": "3194693445",
},
},
}
4 changes: 4 additions & 0 deletions pkg/controller/elasticsearch/settings/merged_config.go
Original file line number Diff line number Diff line change
@@ -67,6 +67,10 @@ func baseConfig(clusterName string, ver version.Version, ipFamily corev1.IPFamil

esv1.PathData: volume.ElasticsearchDataMountPath,
esv1.PathLogs: volume.ElasticsearchLogsMountPath,

// to avoid misleading error messages about the inability to connect to localhost for discovery despite us using
// file based discovery
esv1.DiscoverySeedHosts: []string{},
}

// seed hosts setting name changed starting ES 7.X