Skip to content

Commit ec2816d

Browse files
authored
Update k8s manifests to leverage hints (#1202)
1 parent a0620af commit ec2816d

File tree

3 files changed

+50
-4
lines changed

3 files changed

+50
-4
lines changed

deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml

+25-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ data:
2525
providers.kubernetes:
2626
node: ${NODE_NAME}
2727
scope: node
28+
#Uncomment to enable hints' support
29+
#hints.enabled: true
2830
inputs:
2931
- name: kubernetes-cluster-metrics
3032
condition: ${kubernetes_leaderelection.leader} == true
@@ -651,11 +653,24 @@ spec:
651653
serviceAccountName: elastic-agent-standalone
652654
hostNetwork: true
653655
dnsPolicy: ClusterFirstWithHostNet
656+
# Uncomment if using hints feature
657+
#initContainers:
658+
# - name: k8s-templates-downloader
659+
# image: busybox:1.28
660+
# command: ['sh']
661+
# args:
662+
# - -c
663+
# - >-
664+
# mkdir -p /etc/elastic-agent/inputs.d &&
665+
# wget -O - https://github.com/elastic/elastic-agent/archive/8.3.0.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
666+
# volumeMounts:
667+
# - name: external-inputs
668+
# mountPath: /etc/elastic-agent/inputs.d
654669
containers:
655670
- name: elastic-agent-standalone
656671
image: docker.elastic.co/beats/elastic-agent:8.3.0
657672
args: [
658-
"-c", "/etc/agent.yml",
673+
"-c", "/etc/elastic-agent/agent.yml",
659674
"-e",
660675
]
661676
env:
@@ -677,6 +692,8 @@ spec:
677692
valueFrom:
678693
fieldRef:
679694
fieldPath: metadata.name
695+
- name: STATE_PATH
696+
value: "/etc/elastic-agent"
680697
securityContext:
681698
runAsUser: 0
682699
resources:
@@ -687,9 +704,12 @@ spec:
687704
memory: 400Mi
688705
volumeMounts:
689706
- name: datastreams
690-
mountPath: /etc/agent.yml
707+
mountPath: /etc/elastic-agent/agent.yml
691708
readOnly: true
692709
subPath: agent.yml
710+
# Uncomment if using hints feature
711+
#- name: external-inputs
712+
# mountPath: /etc/elastic-agent/inputs.d
693713
- name: proc
694714
mountPath: /hostfs/proc
695715
readOnly: true
@@ -722,6 +742,9 @@ spec:
722742
configMap:
723743
defaultMode: 0640
724744
name: agent-node-datastreams
745+
# Uncomment if using hints feature
746+
#- name: external-inputs
747+
# emptyDir: {}
725748
- name: proc
726749
hostPath:
727750
path: /proc

deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset-configmap.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ data:
2525
providers.kubernetes:
2626
node: ${NODE_NAME}
2727
scope: node
28+
#Uncomment to enable hints' support
29+
#hints.enabled: true
2830
inputs:
2931
- name: kubernetes-cluster-metrics
3032
condition: ${kubernetes_leaderelection.leader} == true

deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml

+23-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,24 @@ spec:
2525
serviceAccountName: elastic-agent-standalone
2626
hostNetwork: true
2727
dnsPolicy: ClusterFirstWithHostNet
28+
# Uncomment if using hints feature
29+
#initContainers:
30+
# - name: k8s-templates-downloader
31+
# image: busybox:1.28
32+
# command: ['sh']
33+
# args:
34+
# - -c
35+
# - >-
36+
# mkdir -p /etc/elastic-agent/inputs.d &&
37+
# wget -O - https://github.com/elastic/elastic-agent/archive/%VERSION%.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
38+
# volumeMounts:
39+
# - name: external-inputs
40+
# mountPath: /etc/elastic-agent/inputs.d
2841
containers:
2942
- name: elastic-agent-standalone
3043
image: docker.elastic.co/beats/elastic-agent:%VERSION%
3144
args: [
32-
"-c", "/etc/agent.yml",
45+
"-c", "/etc/elastic-agent/agent.yml",
3346
"-e",
3447
]
3548
env:
@@ -51,6 +64,8 @@ spec:
5164
valueFrom:
5265
fieldRef:
5366
fieldPath: metadata.name
67+
- name: STATE_PATH
68+
value: "/etc/elastic-agent"
5469
securityContext:
5570
runAsUser: 0
5671
resources:
@@ -61,9 +76,12 @@ spec:
6176
memory: 400Mi
6277
volumeMounts:
6378
- name: datastreams
64-
mountPath: /etc/agent.yml
79+
mountPath: /etc/elastic-agent/agent.yml
6580
readOnly: true
6681
subPath: agent.yml
82+
# Uncomment if using hints feature
83+
#- name: external-inputs
84+
# mountPath: /etc/elastic-agent/inputs.d
6785
- name: proc
6886
mountPath: /hostfs/proc
6987
readOnly: true
@@ -96,6 +114,9 @@ spec:
96114
configMap:
97115
defaultMode: 0640
98116
name: agent-node-datastreams
117+
# Uncomment if using hints feature
118+
#- name: external-inputs
119+
# emptyDir: {}
99120
- name: proc
100121
hostPath:
101122
path: /proc

0 commit comments

Comments
 (0)