Skip to content

Commit 186bc47

Browse files
committed
Update manifests to leverage hints
Signed-off-by: ChrsMark <[email protected]>
1 parent ae2c942 commit 186bc47

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,23 @@ spec:
651653
serviceAccountName: elastic-agent-standalone
652654
hostNetwork: true
653655
dnsPolicy: ClusterFirstWithHostNet
656+
#initContainers:
657+
# - name: k8s-templates-downloader
658+
# image: busybox:1.28
659+
# command: ['sh']
660+
# args:
661+
# - -c
662+
# - >-
663+
# mkdir -p /etc/elastic-agent/inputs.d &&
664+
# 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" &&
665+
# volumeMounts:
666+
# - name: external-inputs
667+
# mountPath: /etc/elastic-agent/inputs.d
654668
containers:
655669
- name: elastic-agent-standalone
656670
image: docker.elastic.co/beats/elastic-agent:8.3.0
657671
args: [
658-
"-c", "/etc/agent.yml",
672+
"-c", "/etc/elastic-agent/agent.yml",
659673
"-e",
660674
]
661675
env:
@@ -677,6 +691,8 @@ spec:
677691
valueFrom:
678692
fieldRef:
679693
fieldPath: metadata.name
694+
- name: STATE_PATH
695+
value: "/etc/elastic-agent"
680696
securityContext:
681697
runAsUser: 0
682698
resources:
@@ -687,9 +703,12 @@ spec:
687703
memory: 400Mi
688704
volumeMounts:
689705
- name: datastreams
690-
mountPath: /etc/agent.yml
706+
mountPath: /etc/elastic-agent/agent.yml
691707
readOnly: true
692708
subPath: agent.yml
709+
# Uncomment if using hints feature
710+
#- name: external-inputs
711+
# mountPath: /etc/elastic-agent/inputs.d
693712
- name: proc
694713
mountPath: /hostfs/proc
695714
readOnly: true
@@ -722,6 +741,10 @@ spec:
722741
configMap:
723742
defaultMode: 0640
724743
name: agent-node-datastreams
744+
# Uncomment if using hints feature
745+
#- name: external-inputs
746+
# hostPath:
747+
# path: /etc/elastic-agent/inputs.d
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,23 @@ spec:
2525
serviceAccountName: elastic-agent-standalone
2626
hostNetwork: true
2727
dnsPolicy: ClusterFirstWithHostNet
28+
#initContainers:
29+
# - name: k8s-templates-downloader
30+
# image: busybox:1.28
31+
# command: ['sh']
32+
# args:
33+
# - -c
34+
# - >-
35+
# mkdir -p /etc/elastic-agent/inputs.d &&
36+
# 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" &&
37+
# volumeMounts:
38+
# - name: external-inputs
39+
# mountPath: /etc/elastic-agent/inputs.d
2840
containers:
2941
- name: elastic-agent-standalone
3042
image: docker.elastic.co/beats/elastic-agent:%VERSION%
3143
args: [
32-
"-c", "/etc/agent.yml",
44+
"-c", "/etc/elastic-agent/agent.yml",
3345
"-e",
3446
]
3547
env:
@@ -51,6 +63,8 @@ spec:
5163
valueFrom:
5264
fieldRef:
5365
fieldPath: metadata.name
66+
- name: STATE_PATH
67+
value: "/etc/elastic-agent"
5468
securityContext:
5569
runAsUser: 0
5670
resources:
@@ -61,9 +75,12 @@ spec:
6175
memory: 400Mi
6276
volumeMounts:
6377
- name: datastreams
64-
mountPath: /etc/agent.yml
78+
mountPath: /etc/elastic-agent/agent.yml
6579
readOnly: true
6680
subPath: agent.yml
81+
# Uncomment if using hints feature
82+
#- name: external-inputs
83+
# mountPath: /etc/elastic-agent/inputs.d
6784
- name: proc
6885
mountPath: /hostfs/proc
6986
readOnly: true
@@ -96,6 +113,10 @@ spec:
96113
configMap:
97114
defaultMode: 0640
98115
name: agent-node-datastreams
116+
# Uncomment if using hints feature
117+
#- name: external-inputs
118+
# hostPath:
119+
# path: /etc/elastic-agent/inputs.d
99120
- name: proc
100121
hostPath:
101122
path: /proc

0 commit comments

Comments
 (0)