Skip to content

Commit 218c984

Browse files
authored
Allow setting ES api key via env variable in container mode (#5536)
Also remove defaults for username and password set this way.
1 parent d0c7bea commit 218c984

File tree

4 files changed

+70
-4
lines changed

4 files changed

+70
-4
lines changed

_meta/config/elastic-agent.docker.yml.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ outputs:
55
default:
66
type: elasticsearch
77
hosts: '${ELASTICSEARCH_HOSTS:http://elasticsearch:9200}'
8-
username: '${ELASTICSEARCH_USERNAME:elastic}'
9-
password: '${ELASTICSEARCH_PASSWORD:changeme}'
8+
username: '${ELASTICSEARCH_USERNAME:}'
9+
password: '${ELASTICSEARCH_PASSWORD:}'
10+
api_key: '${ELASTICSEARCH_API_KEY:}'
1011
preset: balanced
1112

1213
inputs:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: breaking-change
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Remove default credentials when running Elastic Agent in container mode
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
description: ELASTICSEARCH_USERNAME and ELASTICSEARCH_PASSWORD now need to be explicitly set when running the agent in container mode
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: elastic-agent
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: enhancement
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Support ELASTICSEARCH_API_KEY environment variable when running in container mode
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component: elastic-agent
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
#pr: https://github.com/owner/repo/1234
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

elastic-agent.docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ outputs:
55
default:
66
type: elasticsearch
77
hosts: '${ELASTICSEARCH_HOSTS:http://elasticsearch:9200}'
8-
username: '${ELASTICSEARCH_USERNAME:elastic}'
9-
password: '${ELASTICSEARCH_PASSWORD:changeme}'
8+
username: '${ELASTICSEARCH_USERNAME:}'
9+
password: '${ELASTICSEARCH_PASSWORD:}'
10+
api_key: '${ELASTICSEARCH_API_KEY:}'
1011
preset: balanced
1112

1213
inputs:

0 commit comments

Comments
 (0)