-
Notifications
You must be signed in to change notification settings - Fork 154
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
[Kubernetes] Add kustomize template for hints auto discover #5643
Changes from 5 commits
07b80c1
c3e55e2
7574236
435f1d9
d1051cc
ca148dc
a502473
a2f800b
5b7eb20
491de5c
e67a3c5
127e1c2
cc5ec22
8051c09
f758edc
f3f0770
3be9606
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Kind can be one of: | ||
# - breaking-change: a change to previously-documented behavior | ||
# - deprecation: functionality that is being removed in a later release | ||
# - bug-fix: fixes a problem in a previous version | ||
# - enhancement: extends functionality but does not break or fix existing behavior | ||
# - feature: new functionality | ||
# - known-issue: problems that we are aware of in a given version | ||
# - security: impacts on the security of a product or a user’s deployment. | ||
# - upgrade: important information for someone upgrading from a prior version | ||
# - other: does not fit into any of the other categories | ||
kind: feature | ||
|
||
# Change summary; a 80ish characters long description of the change. | ||
summary: Provide a Kustomize template which enables hints based autodiscovery by default when deploying standalone elastic-agent into a Kubernetes cluster. | ||
|
||
# Long description; in case the summary is not enough to describe the change | ||
# this field accommodate a description without length limits. | ||
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. | ||
#description: | ||
|
||
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. | ||
component: elastic-agent | ||
|
||
# PR URL; optional; the PR number that added the changeset. | ||
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. | ||
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. | ||
# Please provide it if you are adding a fragment for a different PR. | ||
pr: https://github.com/elastic/elastic-agent/pull/5643 | ||
|
||
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). | ||
# If not present is automatically filled by the tooling with the issue linked to the PR number. | ||
#issue: https://github.com/owner/repo/1234 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: elastic-agent-standalone | ||
namespace: kube-system | ||
labels: | ||
app: elastic-agent-standalone | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: elastic-agent-standalone | ||
template: | ||
metadata: | ||
labels: | ||
app: elastic-agent-standalone | ||
spec: | ||
containers: | ||
- name: elastic-agent-standalone | ||
env: | ||
- $patch: delete | ||
name: API_KEY | ||
- $patch: delete | ||
name: ES_HOST |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../default/elastic-agent-standalone | ||
|
||
patches: | ||
- patch: |- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: elastic-agent-standalone | ||
namespace: kube-system | ||
labels: | ||
app: elastic-agent-standalone | ||
spec: | ||
template: | ||
spec: | ||
initContainers: | ||
- name: k8s-templates-downloader | ||
image: docker.elastic.co/beats/elastic-agent:9.0.0 | ||
command: ['bash'] | ||
args: | ||
- -c | ||
- >- | ||
mkdir -p /usr/share/elastic-agent/state/inputs.d && | ||
curl -sL https://github.com/elastic/elastic-agent/archive/9.0.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-9.0/deploy/kubernetes/elastic-agent-standalone/templates.d" | ||
pkoutsovasilis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
securityContext: | ||
runAsUser: 0 | ||
pkoutsovasilis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
volumeMounts: | ||
- name: elastic-agent-state | ||
mountPath: /usr/share/elastic-agent/state | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you extend the integration k8s tests by adding a new one with hints enabled? it would be nice to check that the agent and all components are starting and reporting healthy with this feature enabled There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which tests are you referring to Panos? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you !! I wanted to double check as we dont actually own them. But I created an issue here: #5660. We can discuss internally for prioritisation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAICT the k8s ownership is shared, and the agent repo now has k8s integration tests. So ideally anything that has to do with different k8s deployments should be covered by a test but sure discuss #5660 and try to couple this integration test with this PR |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
|
||
resources: | ||
- ../../default/elastic-agent-standalone | ||
|
||
patches: | ||
- patch: |- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: elastic-agent-standalone | ||
namespace: kube-system | ||
labels: | ||
app: elastic-agent-standalone | ||
spec: | ||
template: | ||
spec: | ||
initContainers: | ||
- name: k8s-templates-downloader | ||
image: docker.elastic.co/beats/elastic-agent:%VERSION% | ||
command: ['bash'] | ||
args: | ||
- -c | ||
- >- | ||
mkdir -p /usr/share/elastic-agent/state/inputs.d && | ||
curl -sL https://github.com/elastic/elastic-agent/archive/%BRANCH%.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-%BRANCH%/deploy/kubernetes/elastic-agent-standalone/templates.d" | ||
securityContext: | ||
runAsUser: 0 | ||
volumeMounts: | ||
- name: elastic-agent-state | ||
mountPath: /usr/share/elastic-agent/state | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Updates the mount path of autodiscovery init container to /etc/elastic-agent/inputs.d in order to eliminate root access needs
To add sth like that in the reasoning as well