Skip to content

Add new stack.epr.base_url profile setting#3235

Merged
mrodm merged 22 commits intoelastic:mainfrom
mrodm:command-custom-epr-kibana-urls-profile
Jan 30, 2026
Merged

Add new stack.epr.base_url profile setting#3235
mrodm merged 22 commits intoelastic:mainfrom
mrodm:command-custom-epr-kibana-urls-profile

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Jan 27, 2026

Follows #3232
Part of #2993
Fixes #2993

This PR is based on the changes in #3232 and includes a new profile setting stack.epr.base_url.

This new profile setting should be considered in those commands that require to run package-registry queries (e.g. elastic-package stack up or elastic-package status).

It is based on the elastic-package configuration (~/.elastic-package/config.yml):

Example:

stack:
    image_ref_overrides: {}
profile:
    current: default

## Optional
package_registry:
  base_url: "https://epr.elastic.co"
status:
  kibana_repository:
    base_url: "https://raw.githubusercontent.com/elastic/kibana"

This PR keeps the same default values:

In the case of the package registry, the value from the configuration file will be taken into consideration for the following commands such as:

  • elastic-package stack up (Serverless and Environment providers)
  • elastic-package stack update (Docker Compose provider)
  • elastic-package status
  • elastic-package test script (stackUp function)

This PR also takes into account:

  • the profile setting stack.epr.proxy_to. This configuration, if set, will take precedence to get the value to fill the value for the EPR_PROXY_TO environment variable in the packge-registry Dockerfile.
  • the profile setting stack.epr.base_url. This configuration, if set, will take precedence to get the URL used to query the Package Registry.

If those profile settings are not set, the one from the elastic-package configuration file will

Author's checklist

  • Test with custom package-registry and kibana URLs in elastic-package status.
  • Test with custom package-registry URLs in elastic-package stack (Serverless provider).
  • Test with custom package-registry URLs in elastic-package stack (Environment provider).
  • Ensure that elastic-package keeps using the default URLs if they are not specified in the config.
  • Test that configuration (~/.elastic-package/config.yml) is kept when changing the profiles (elastic-package profiles use`).
  • Update documentation

How to test this PR locally

  • Edit ~/.elastic-package/config.yml including:
package_registry:
  base_url: "https://epr-staging.elastic.co"
status:
  kibana_repository:
    base_url: "https://raw.githubusercontent.com/mrodm/kibana"
  • Test including the profile settings too:
stack.epr.proxy_to: "https://epr-staging.elastic.co"
stack.epr.base_url: "https://epr.elastic.co"
  • Run elastic-package status with different parameters:
# It should use the custom EPR URL
go run github.com/elastic/elastic-package -C test/packages/parallel/nginx status -vv

# It should use the custom EPR URL and the custom Kibana Repository URL
# Delete the cache folder to force query to the Github URL
rm -rf ~/.elastic-package/cache/kibana_config
go run github.com/elastic/elastic-package -C test/packages/parallel/nginx status -vv --info kibana.version,serverless.project_types
# Example output:
# TRACE Sending request to Package Registry API: https://epr-staging.elastic.co/search?all=false&experimental=true&package=nginx&prerelease=true
# TRACE Request Serverless Kibana configuration from https://raw.githubusercontent.com/mrodm/kibana/main/config/serverless.oblt.yml
# TRACE Request Serverless Kibana configuration from https://raw.githubusercontent.com/mrodm/kibana/main/config/serverless.security.yml
# TRACE Request Serverless Kibana configuration from https://raw.githubusercontent.com/mrodm/kibana/main/config/serverless.es.yml
# TRACE Sending request to Package Registry API: https://epr-staging.elastic.co/search?all=false&capabilities=apm&capabilities=observability&capabilities=uptime&experimental=true&package=nginx&prerelease=true
# TRACE Sending request to Package Registry API: https://epr-staging.elastic.co/search?all=false&capabilities=security&experimental=true&package=nginx&prerelease=true
# TRACE Sending request to Package Registry API: https://epr-staging.elastic.co/search?all=false&experimental=true&package=nginx&prerelease=true
  • Test for instance with environment provider:
# Once it is started Elasticsearch and Kibana following the previous doc

go run github.com/elastic/elastic-package profiles create environment
go run github.com/elastic/elastic-package profiles use environment

# this command show show that the new EPR URL is being used to get the fleet package
go run github.com/elastic/elastic-package stack up -vv -d --provider environment
# Example output:
# TRACE Sending request to Package Registry API: https://epr-staging.elastic.co/search?all=false&experimental=false&kibana.version=9.2.4&package=fleet_server&prerelease=false
# DEBUG Found fleet_server package - version 1.6.0


go run github.com/elastic/elastic-package stack down -v

@mrodm mrodm self-assigned this Jan 27, 2026
@mrodm mrodm marked this pull request as ready for review January 29, 2026 11:25
@mrodm mrodm requested a review from a team January 29, 2026 11:25
Comment on lines +126 to 127
// Currently, this command does not use profile, so we take the URL from the application configuration
registryClient := registry.NewClient(appConfig.PackageRegistryBaseURL())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

status command will just take into account the setting in the configuration file ~/.elastic-package/config.yml. Currently, it does not use any profile setting.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 29, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @mrodm

@mrodm mrodm merged commit 6d87be2 into elastic:main Jan 30, 2026
3 checks passed
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.

Support elastic-package usage for integration development on air-gapped environments

3 participants