Skip to content
This repository was archived by the owner on Mar 22, 2024. It is now read-only.

Commit 170ebe7

Browse files
authored
ECK resources Helm chart - Beats (elastic#5899)
* Add initial version of ECK-Managed Beats Helm Chart
1 parent 47ffaf7 commit 170ebe7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1584
-40
lines changed

deploy/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,37 @@ To see all resources installed by the helm chart
4646
kubectl get elastic -l "app.kubernetes.io/instance"=es-kb-quickstart -n elastic-stack
4747
```
4848

49+
## ECK Helm Chart Development
50+
51+
### ECK Helm Chart test suite
52+
53+
[Helm UnitTest Plugin](https://github.com/quintush/helm-unittest) is used to ensure Helm Charts render properly.
54+
55+
#### Installation
56+
57+
```
58+
helm plugin install https://github.com/quintush/helm-unittest --version 0.2.8
59+
```
60+
61+
#### Running Test Suite
62+
63+
The test suite can be run from the Makefile in the root of the project with the following command:
64+
65+
```
66+
make helm-test
67+
```
68+
69+
*Note* that the Makefile target runs the script in `{root}/hack/helm/test.sh`
70+
71+
#### Manually invoking the Helm Unit Tests for a particular Chart
72+
73+
The Helm unit tests can be manually invoked for any of the charts with the following command:
74+
75+
```
76+
cd deploy/eck-stack
77+
helm unittest -3 -f 'templates/tests/*.yaml' .
78+
``````
79+
4980
## Licensing
5081
5182
The ECK Helm Charts are licensed under the [Elastic License 2.0](https://www.elastic.co/licensing/elastic-license) like the operator, but require different subscription levels.

deploy/eck-agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: eck-agent
33
description: A Helm chart to deploy Elastic Agent managed by the ECK Operator.
44
kubeVersion: ">= 1.21.0-0"
55
type: application
6-
version: 0.1.0
6+
version: 0.2.0
77
sources:
88
- https://github.com/elastic/cloud-on-k8s
99
- https://github.com/elastic/elastic-agent

deploy/eck-agent/examples/fleet-agents.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# The following example should only be used in conjunction with the 'eck-fleet-server' Helm Chart,
22
# and shows how the Agents can be deployed as a daemonset, and controlled by Fleet Server.
33
#
4-
version: 8.2.3
4+
version: 8.5.0
55

66
spec:
77
# This must match the name of the fleet server installed from eck-fleet-server chart.
88
fleetServerRef:
9-
name: fleet-server
9+
name: eck-fleet-server
1010
kibanaRef:
1111
name: eck-kibana
1212
mode: fleet

deploy/eck-agent/examples/system-integration.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# The following example should only be used in Agent "standalone" mode,
22
# and should not be used when Agent is used with Fleet Server.
33
#
4-
version: 8.2.3
4+
version: 8.5.0
55
spec:
66
elasticsearchRefs:
7-
- name: elasticsearch
7+
- name: eck-elasticsearch
88
daemonSet:
99
podTemplate:
1010
spec:
@@ -33,7 +33,7 @@ spec:
3333
meta:
3434
package:
3535
name: system
36-
version: 8.2.3
36+
version: 8.5.0
3737
data_stream:
3838
namespace: default
3939
streams:

deploy/eck-agent/templates/tests/elastic-agent_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tests:
1313
value: quickstart-eck-agent
1414
- equal:
1515
path: spec.version
16-
value: 8.2.3
16+
value: 8.5.0
1717
- equal:
1818
path: spec.config
1919
value: null

deploy/eck-agent/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# Version of Elastic Agent.
2020
#
21-
version: 8.2.3
21+
version: 8.5.0
2222

2323
# Labels that will be applied to Elastic Agent.
2424
#
@@ -45,7 +45,7 @@ spec:
4545
# Reference to ECK-managed Elasticsearch instance.
4646
#
4747
elasticsearchRefs:
48-
- name: elasticsearch
48+
- name: eck-elasticsearch
4949
# Optional namespace reference to Elasticsearch instance.
5050
# If not specified, then the namespace of the Agent instance
5151
# will be assumed.
@@ -55,7 +55,7 @@ spec:
5555
# Reference to ECK-managed Fleet Server instance.
5656
#
5757
# fleetServerRef:
58-
# name: fleet-server
58+
# name: eck-fleet-server
5959
# Optional namespace reference to Fleet Server instance.
6060
# If not specified, then the namespace of the Agent instance
6161
# will be assumed.

deploy/eck-beats/.helmignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
templates/tests

deploy/eck-beats/Chart.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v2
2+
name: eck-beats
3+
description: A Helm chart to deploy Elastic Beats managed by the ECK Operator.
4+
# Requirement comes from minimum version supported for eck-operator (https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s_supported_versions.html)
5+
kubeVersion: ">= 1.20.0-0"
6+
type: application
7+
version: 0.1.0
8+
sources:
9+
- https://github.com/elastic/cloud-on-k8s
10+
- https://github.com/elastic/beats
11+
icon: https://helm.elastic.co/icons/beats.png

deploy/eck-beats/LICENSE

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Elastic License 2.0
2+
3+
URL: https://www.elastic.co/licensing/elastic-license
4+
5+
## Acceptance
6+
7+
By using the software, you agree to all of the terms and conditions below.
8+
9+
## Copyright License
10+
11+
The licensor grants you a non-exclusive, royalty-free, worldwide,
12+
non-sublicensable, non-transferable license to use, copy, distribute, make
13+
available, and prepare derivative works of the software, in each case subject to
14+
the limitations and conditions below.
15+
16+
## Limitations
17+
18+
You may not provide the software to third parties as a hosted or managed
19+
service, where the service provides users with access to any substantial set of
20+
the features or functionality of the software.
21+
22+
You may not move, change, disable, or circumvent the license key functionality
23+
in the software, and you may not remove or obscure any functionality in the
24+
software that is protected by the license key.
25+
26+
You may not alter, remove, or obscure any licensing, copyright, or other notices
27+
of the licensor in the software. Any use of the licensor’s trademarks is subject
28+
to applicable law.
29+
30+
## Patents
31+
32+
The licensor grants you a license, under any patent claims the licensor can
33+
license, or becomes able to license, to make, have made, use, sell, offer for
34+
sale, import and have imported the software, in each case subject to the
35+
limitations and conditions in this license. This license does not cover any
36+
patent claims that you cause to be infringed by modifications or additions to
37+
the software. If you or your company make any written claim that the software
38+
infringes or contributes to infringement of any patent, your patent license for
39+
the software granted under these terms ends immediately. If your company makes
40+
such a claim, your patent license ends immediately for work on behalf of your
41+
company.
42+
43+
## Notices
44+
45+
You must ensure that anyone who gets a copy of any part of the software from you
46+
also gets a copy of these terms.
47+
48+
If you modify the software, you must include in any modified copies of the
49+
software prominent notices stating that you have modified the software.
50+
51+
## No Other Rights
52+
53+
These terms do not imply any licenses other than those expressly granted in
54+
these terms.
55+
56+
## Termination
57+
58+
If you use the software in violation of these terms, such use is not licensed,
59+
and your licenses will automatically terminate. If the licensor provides you
60+
with a notice of your violation, and you cease all violation of this license no
61+
later than 30 days after you receive that notice, your licenses will be
62+
reinstated retroactively. However, if you violate these terms after such
63+
reinstatement, any additional violation of these terms will cause your licenses
64+
to terminate automatically and permanently.
65+
66+
## No Liability
67+
68+
*As far as the law allows, the software comes as is, without any warranty or
69+
condition, and the licensor will not be liable to you for any damages arising
70+
out of these terms or the use or nature of the software, under any kind of
71+
legal claim.*
72+
73+
## Definitions
74+
75+
The **licensor** is the entity offering these terms, and the **software** is the
76+
software the licensor makes available under these terms, including any portion
77+
of it.
78+
79+
**you** refers to the individual or entity agreeing to these terms.
80+
81+
**your company** is any legal entity, sole proprietorship, or other kind of
82+
organization that you work for, plus all organizations that have control over,
83+
are under the control of, or are under common control with that
84+
organization. **control** means ownership of substantially all the assets of an
85+
entity, or the power to direct its management and policies by vote, contract, or
86+
otherwise. Control can be direct or indirect.
87+
88+
**your licenses** are all the licenses granted to you for the software under
89+
these terms.
90+
91+
**use** means anything you do with the software requiring one of your licenses.
92+
93+
**trademark** means trademarks, service marks, and similar rights.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: auditbeat
2+
version: 8.5.0
3+
spec:
4+
type: auditbeat
5+
elasticsearchRef:
6+
name: eck-elasticsearch
7+
kibanaRef:
8+
name: eck-kibana
9+
config:
10+
auditbeat.modules:
11+
- module: file_integrity
12+
paths:
13+
- /hostfs/bin
14+
- /hostfs/usr/bin
15+
- /hostfs/sbin
16+
- /hostfs/usr/sbin
17+
- /hostfs/etc
18+
exclude_files:
19+
- '(?i)\.sw[nop]$'
20+
- '~$'
21+
- '/\.git($|/)'
22+
scan_at_start: true
23+
scan_rate_per_sec: 50 MiB
24+
max_file_size: 100 MiB
25+
hash_types: [sha1]
26+
recursive: true
27+
- module: auditd
28+
audit_rules: |
29+
# Executions
30+
-a always,exit -F arch=b64 -S execve,execveat -k exec
31+
32+
# Unauthorized access attempts (amd64 only)
33+
-a always,exit -F arch=b64 -S open,creat,truncate,ftruncate,openat,open_by_handle_at -F exit=-EACCES -k access
34+
-a always,exit -F arch=b64 -S open,creat,truncate,ftruncate,openat,open_by_handle_at -F exit=-EPERM -k access
35+
36+
processors:
37+
- add_cloud_metadata: {}
38+
- add_host_metadata: {}
39+
- add_process_metadata:
40+
match_pids: ['process.pid']
41+
daemonSet:
42+
podTemplate:
43+
spec:
44+
hostPID: true # Required by auditd module
45+
dnsPolicy: ClusterFirstWithHostNet
46+
hostNetwork: true # Allows to provide richer host metadata
47+
automountServiceAccountToken: true # some older Beat versions are depending on this settings presence in k8s context
48+
securityContext:
49+
runAsUser: 0
50+
volumes:
51+
- name: bin
52+
hostPath:
53+
path: /bin
54+
- name: usrbin
55+
hostPath:
56+
path: /usr/bin
57+
- name: sbin
58+
hostPath:
59+
path: /sbin
60+
- name: usrsbin
61+
hostPath:
62+
path: /usr/sbin
63+
- name: etc
64+
hostPath:
65+
path: /etc
66+
- name: run-containerd
67+
hostPath:
68+
path: /run/containerd
69+
type: DirectoryOrCreate
70+
# Uncomment the below when running on GKE. See https://github.com/elastic/beats/issues/8523 for more context.
71+
#- name: run
72+
# hostPath:
73+
# path: /run
74+
#initContainers:
75+
#- name: cos-init
76+
# image: docker.elastic.co/beats/auditbeat:8.3.3
77+
# volumeMounts:
78+
# - name: run
79+
# mountPath: /run
80+
# command: ['sh', '-c', 'export SYSTEMD_IGNORE_CHROOT=1 && systemctl stop systemd-journald-audit.socket && systemctl mask systemd-journald-audit.socket && systemctl restart systemd-journald']
81+
containers:
82+
- name: auditbeat
83+
securityContext:
84+
capabilities:
85+
add:
86+
# Capabilities needed for auditd module
87+
- 'AUDIT_READ'
88+
- 'AUDIT_WRITE'
89+
- 'AUDIT_CONTROL'
90+
volumeMounts:
91+
- name: bin
92+
mountPath: /hostfs/bin
93+
readOnly: true
94+
- name: sbin
95+
mountPath: /hostfs/sbin
96+
readOnly: true
97+
- name: usrbin
98+
mountPath: /hostfs/usr/bin
99+
readOnly: true
100+
- name: usrsbin
101+
mountPath: /hostfs/usr/sbin
102+
readOnly: true
103+
- name: etc
104+
mountPath: /hostfs/etc
105+
readOnly: true
106+
# Directory with root filesystems of containers executed with containerd, this can be
107+
# different with other runtimes. This volume is needed to monitor the file integrity
108+
# of files in containers.
109+
- name: run-containerd
110+
mountPath: /run/containerd
111+
readOnly: true

0 commit comments

Comments
 (0)