Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 4 additions & 15 deletions internal/profile/_static/docker-compose-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,10 @@ services:
retries: 300
interval: 1s
environment:
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "network.host="
- "transport.host=127.0.0.1"
- "http.host=0.0.0.0"
- "indices.id_field_data.enabled=true"
- "xpack.license.self_generated.type=trial"
- "xpack.security.enabled=true"
- "xpack.security.authc.api_key.enabled=true"
- "ELASTIC_PASSWORD=changeme"
- "script.max_compilations_rate=use-context"
- "script.context.template.max_compilations_rate=unlimited"
- "script.context.ingest.cache_max_size=2000"
- "script.context.processor_conditional.cache_max_size=2000"
- "script.context.template.cache_max_size=2000"
- "ingest.geoip.downloader.enabled=false"
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "ELASTIC_PASSWORD=changeme"
volumes:
- "./elasticsearch.config.${STACK_VERSION_VARIANT}.yml:/usr/share/elasticsearch/config/elasticsearch.yml"
ports:
- "127.0.0.1:9200:9200"

Expand Down
11 changes: 11 additions & 0 deletions internal/profile/_static/elasticsearch_config_8x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
network.host: ""
transport.host: "127.0.0.1"
http.host: "0.0.0.0"

indices.id_field_data.enabled: true

xpack.license.self_generated.type: "trial"
xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true

ingest.geoip.downloader.enabled: false
17 changes: 17 additions & 0 deletions internal/profile/_static/elasticsearch_config_default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
network.host: ""
transport.host: "127.0.0.1"
http.host: "0.0.0.0"

indices.id_field_data.enabled: true

xpack.license.self_generated.type: "trial"
xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true

script.max_compilations_rate: "use-context"
script.context.template.max_compilations_rate: "unlimited"
script.context.ingest.cache_max_size: 2000
script.context.processor_conditional.cache_max_size: 2000
script.context.template.cache_max_size: 2000

ingest.geoip.downloader.enabled: false
14 changes: 8 additions & 6 deletions internal/profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ type configFile string
// managedProfileFiles is the list of all files managed in a profile
// If you create a new file that's managed by a profile, it needs to go in this list
var managedProfileFiles = map[configFile]NewConfig{
KibanaConfigDefaultFile: newKibanaConfigDefault,
KibanaConfig8xFile: newKibanaConfig8x,
PackageRegistryDockerfileFile: newPackageRegistryDockerfile,
PackageRegistryConfigFile: newPackageRegistryConfig,
SnapshotFile: newSnapshotFile,
PackageProfileMetaFile: createProfileMetadata,
ElasticsearchConfigDefaultFile: newElasticsearchConfigDefault,
ElasticsearchConfig8xFile: newElasticsearchConfig8x,
KibanaConfigDefaultFile: newKibanaConfigDefault,
KibanaConfig8xFile: newKibanaConfig8x,
PackageRegistryDockerfileFile: newPackageRegistryDockerfile,
PackageRegistryConfigFile: newPackageRegistryConfig,
SnapshotFile: newSnapshotFile,
PackageProfileMetaFile: createProfileMetadata,
}

// NewConfigProfile creates a new config profile manager
Expand Down
28 changes: 28 additions & 0 deletions internal/profile/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,34 @@ func newKibanaConfig8x(_ string, profilePath string) (*simpleFile, error) {
}, nil
}

// ElasticsearchConfigDefaultFile is the default Elasticsearch config file
const ElasticsearchConfigDefaultFile configFile = "elasticsearch.config.default.yml"

//go:embed _static/elasticsearch_config_default.yml
var elasticsearchConfigDefaultYml string

func newElasticsearchConfigDefault(_ string, profilePath string) (*simpleFile, error) {
return &simpleFile{
name: string(ElasticsearchConfigDefaultFile),
path: filepath.Join(profilePath, profileStackPath, string(ElasticsearchConfigDefaultFile)),
body: elasticsearchConfigDefaultYml,
}, nil
}

// ElasticsearchConfig8xFile is the Elasticsearch config file for 8.x stack family
const ElasticsearchConfig8xFile configFile = "elasticsearch.config.8x.yml"

//go:embed _static/elasticsearch_config_8x.yml
var elasticsearchConfig8xYml string

func newElasticsearchConfig8x(_ string, profilePath string) (*simpleFile, error) {
return &simpleFile{
name: string(ElasticsearchConfig8xFile),
path: filepath.Join(profilePath, profileStackPath, string(ElasticsearchConfig8xFile)),
body: elasticsearchConfig8xYml,
}, nil
}

// PackageRegistryConfigFile is the config file for the Elastic Package registry
const PackageRegistryConfigFile configFile = "package-registry.config.yml"

Expand Down