Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/elastic/ela…
Browse files Browse the repository at this point in the history
…stic-agent-system-metrics-0.11.5
  • Loading branch information
jlind23 authored Dec 30, 2024
2 parents 101e5be + 7980b91 commit 156b075
Show file tree
Hide file tree
Showing 26 changed files with 553 additions and 185 deletions.
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Add a checklist of things that are required to be reviewed in order to have the
List here all the items you have verified BEFORE sending this PR. Please DO NOT remove any item, striking through those that do not apply. (Just in case, strikethrough uses two tildes. ~~Scratch this.~~)
-->

- [ ] I have read and understood the [pull request guidelines](https://github.com/elastic/elastic-agent/blob/main/CONTRIBUTING.md#pull-request-guidelines) of this project.
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
Expand Down Expand Up @@ -78,4 +79,4 @@ Trigger comments:
PR labels:
skip-ci Skips unit and integration tests
skip-it Skips integration tests
-->
-->
2 changes: 1 addition & 1 deletion .github/workflows/bump-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@11d8c3e7c4dbb188d9534e599db759e418911828 # 2.73.0
uses: updatecli/updatecli-action@4aca518a70708e38063453d8de9c551af7f48ac3 # 2.75.0

- name: Run Updatecli in Apply mode
run: updatecli apply --config .ci/updatecli/updatecli-bump-golang.yml --values .ci/updatecli/values.d/scm.yml
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ Keep these in mind as both authors and reviewers of PRs:

* I must not focus on personal preferences or nitpicks. If I understand the code in the PR but simply would've implemented the same solution a different way that's great but it is not feedback that belongs in the PR. Such feedback only serves to slow down progress for little to no gain.

* If I'm making a suggestion, I must provide a rationale for it. It should be clear to the author of the PR why my suggestion is better than what is already in the PR.


252 changes: 232 additions & 20 deletions NOTICE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/helm/elastic-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The chart built-in [kubernetes integration](https://docs.elastic.co/integrations

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| kubernetes.enabled | bool | `false` | enable Kubernetes integration. |
| kubernetes.enabled | bool | `true` | enable Kubernetes integration. |
| kubernetes.output | string | `"default"` | name of the output used in kubernetes integration. Note that this output needs to be defined in [outputs](#1-outputs) |
| kubernetes.namespace | string | `"default"` | kubernetes namespace |
| kubernetes.hints.enabled | bool | `false` | enable [elastic-agent autodiscovery](https://www.elastic.co/guide/en/fleet/current/elastic-agent-kubernetes-autodiscovery.html) feature |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,7 @@ spec:
name: var-lib
readOnly: true
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
Expand Down
35 changes: 1 addition & 34 deletions deploy/helm/elastic-agent/examples/fleet-managed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,5 @@ agent:
enabled: true
url: $FLEET_URL # replace with Fleet URL
token: $FLEET_TOKEN # replace with Fleet Enrollment token
preset: nginx
presets:
nginx:
mode: deployment
securityContext:
runAsUser: 0
rules:
# minimum cluster role ruleset required by agent
- apiGroups: [ "" ]
resources:
- nodes
- namespaces
- pods
verbs:
- get
- watch
- list
- apiGroups: [ "apps" ]
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups: [ "batch" ]
resources:
- jobs
verbs:
- get
- list
- watch
providers:
kubernetes_leaderelection:
enabled: false
preset: perNode
```
43 changes: 5 additions & 38 deletions deploy/helm/elastic-agent/examples/fleet-managed/fleet-values.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
kubernetes:
enabled: true
system:
enabled: true
agent:
fleet:
enabled: true
url: http://localhost:8220
token: fleetToken
preset: nginx
presets:
nginx:
mode: deployment
securityContext:
runAsUser: 0
serviceAccount:
create: true
clusterRole:
create: true
rules:
# minimum cluster role ruleset required by agent
- apiGroups: [ "" ]
resources:
- nodes
- namespaces
- pods
verbs:
- get
- watch
- list
- apiGroups: [ "apps" ]
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups: [ "batch" ]
resources:
- jobs
verbs:
- get
- list
- watch
providers:
kubernetes_leaderelection:
enabled: false
preset: perNode
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: agent-nginx-example
name: agent-pernode-example
namespace: "default"
labels:
helm.sh/chart: elastic-agent-9.0.0-beta
Expand All @@ -15,7 +15,7 @@ metadata:
apiVersion: v1
kind: Secret
metadata:
name: agent-nginx-example
name: agent-pernode-example
namespace: "default"
labels:
helm.sh/chart: elastic-agent-9.0.0-beta
Expand All @@ -28,15 +28,18 @@ stringData:
fleet:
enabled: true
providers:
kubernetes:
node: ${NODE_NAME}
scope: node
kubernetes_leaderelection:
enabled: false
leader_lease: example-nginx
enabled: true
leader_lease: example-pernode
---
# Source: elastic-agent/templates/agent/cluster-role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: agent-nginx-example-default
name: agent-perNode-example-default
labels:
helm.sh/chart: elastic-agent-9.0.0-beta
app.kubernetes.io/name: elastic-agent
Expand Down Expand Up @@ -111,57 +114,31 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes
- namespaces
- pods
verbs:
- get
- watch
- list
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- get
- list
- watch
---
# Source: elastic-agent/templates/agent/cluster-role-binding.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: agent-nginx-example-default
name: agent-perNode-example-default
labels:
helm.sh/chart: elastic-agent-9.0.0-beta
app.kubernetes.io/name: elastic-agent
app.kubernetes.io/instance: example
app.kubernetes.io/version: 9.0.0
subjects:
- kind: ServiceAccount
name: agent-nginx-example
name: agent-pernode-example
namespace: "default"
roleRef:
kind: ClusterRole
name: agent-nginx-example-default
name: agent-perNode-example-default
apiGroup: rbac.authorization.k8s.io
---
# Source: elastic-agent/templates/agent/k8s/deployment.yaml
# Source: elastic-agent/templates/agent/k8s/daemonset.yaml
apiVersion: apps/v1
kind: Deployment
kind: DaemonSet
metadata:
name: agent-nginx-example
name: agent-pernode-example
namespace: "default"
labels:
helm.sh/chart: elastic-agent-9.0.0-beta
Expand All @@ -171,13 +148,13 @@ metadata:
spec:
selector:
matchLabels:
name: agent-nginx-example
name: agent-pernode-example
template:
metadata:
labels:
name: agent-nginx-example
name: agent-pernode-example
annotations:
checksum/config: 975ed05540e0d099fe1b28b15d6403aacee676d0776a69fb75eb8624e19ad2de
checksum/config: cd7c5c4f03cc8377d18ee22cf236428090959fc194ee647bd97a39b79f38c807
spec:
automountServiceAccountToken: true
containers:
Expand All @@ -196,6 +173,8 @@ spec:
fieldPath: metadata.name
- name: STATE_PATH
value: /usr/share/elastic-agent/state
- name: ELASTIC_NETINFO
value: "false"
- name: FLEET_URL
value: http://localhost:8220
- name: FLEET_ENROLLMENT_TOKEN
Expand All @@ -207,23 +186,68 @@ spec:
image: docker.elastic.co/beats/elastic-agent:9.0.0-SNAPSHOT
imagePullPolicy: IfNotPresent
name: agent
resources:
limits:
memory: 1000Mi
requests:
cpu: 100m
memory: 400Mi
securityContext:
runAsUser: 0
volumeMounts:
- mountPath: /hostfs/proc
name: proc
readOnly: true
- mountPath: /hostfs/sys/fs/cgroup
name: cgroup
readOnly: true
- mountPath: /var/lib/docker/containers
name: varlibdockercontainers
readOnly: true
- mountPath: /var/log
name: varlog
readOnly: true
- mountPath: /hostfs/etc
name: etc-full
readOnly: true
- mountPath: /hostfs/var/lib
name: var-lib
readOnly: true
- mountPath: /usr/share/elastic-agent/state
name: agent-data
- mountPath: /etc/elastic-agent/agent.yml
name: config
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
serviceAccountName: agent-nginx-example
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
volumes:
- hostPath:
path: /etc/elastic-agent/default/agent-nginx-example-managed/state
path: /proc
name: proc
- hostPath:
path: /sys/fs/cgroup
name: cgroup
- hostPath:
path: /var/lib/docker/containers
name: varlibdockercontainers
- hostPath:
path: /var/log
name: varlog
- hostPath:
path: /etc
name: etc-full
- hostPath:
path: /var/lib
name: var-lib
- hostPath:
path: /etc/elastic-agent/default/agent-pernode-example-managed/state
type: DirectoryOrCreate
name: agent-data
- name: config
secret:
defaultMode: 292
secretName: agent-nginx-example
secretName: agent-pernode-example
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,7 @@ spec:
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,7 @@ spec:
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ spec:
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,7 @@ spec:
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ system:
vars:
paths:
- /var/log/custom_syslog.log

kubernetes:
enabled: false
agent:
unprivileged: true
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ spec:
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: agent-pernode-example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ spec:
readOnly: true
subPath: agent.yml
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: true
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: user-sa-perNode
Expand Down
Loading

0 comments on commit 156b075

Please sign in to comment.