Skip to content

Commit cb918df

Browse files
remove STATE_PATH; use default path instead; replace initcontainer image (#4625)
Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
1 parent a3900f0 commit cb918df

File tree

2 files changed

+16
-28
lines changed

2 files changed

+16
-28
lines changed

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

+8-14
Original file line numberDiff line numberDiff line change
@@ -692,16 +692,18 @@ spec:
692692
# Uncomment if using hints feature
693693
#initContainers:
694694
# - name: k8s-templates-downloader
695-
# image: busybox:1.28
696-
# command: ['sh']
695+
# image: docker.elastic.co/beats/elastic-agent:8.15.0
696+
# command: ['bash']
697697
# args:
698698
# - -c
699699
# - >-
700-
# mkdir -p /etc/elastic-agent/inputs.d &&
701-
# wget -O - https://github.com/elastic/elastic-agent/archive/8.15.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-8.15/deploy/kubernetes/elastic-agent-standalone/templates.d"
700+
# mkdir -p /usr/share/elastic-agent/state/inputs.d &&
701+
# curl -sL https://github.com/elastic/elastic-agent/archive/8.15.tar.gz | tar xz -C /usr/share/elastic-agent/state/inputs.d --strip=5 "elastic-agent-8.15/deploy/kubernetes/elastic-agent-standalone/templates.d"
702+
# securityContext:
703+
# runAsUser: 0
702704
# volumeMounts:
703-
# - name: external-inputs
704-
# mountPath: /etc/elastic-agent/inputs.d
705+
# - name: elastic-agent-state
706+
# mountPath: /usr/share/elastic-agent/state
705707
containers:
706708
- name: elastic-agent-standalone
707709
image: docker.elastic.co/beats/elastic-agent:8.15.0
@@ -725,8 +727,6 @@ spec:
725727
valueFrom:
726728
fieldRef:
727729
fieldPath: metadata.name
728-
- name: STATE_PATH
729-
value: "/etc/elastic-agent"
730730
# The following ELASTIC_NETINFO:false variable will disable the netinfo.enabled option of add-host-metadata processor. This will remove fields host.ip and host.mac.
731731
# For more info: https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html
732732
- name: ELASTIC_NETINFO
@@ -760,9 +760,6 @@ spec:
760760
mountPath: /etc/elastic-agent/agent.yml
761761
readOnly: true
762762
subPath: agent.yml
763-
# Uncomment if using hints feature
764-
#- name: external-inputs
765-
# mountPath: /etc/elastic-agent/inputs.d
766763
- name: proc
767764
mountPath: /hostfs/proc
768765
readOnly: true
@@ -793,9 +790,6 @@ spec:
793790
configMap:
794791
defaultMode: 0640
795792
name: agent-node-datastreams
796-
# Uncomment if using hints feature
797-
#- name: external-inputs
798-
# emptyDir: {}
799793
- name: proc
800794
hostPath:
801795
path: /proc

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

+8-14
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ spec:
2828
# Uncomment if using hints feature
2929
#initContainers:
3030
# - name: k8s-templates-downloader
31-
# image: busybox:1.28
32-
# command: ['sh']
31+
# image: docker.elastic.co/beats/elastic-agent:%VERSION%
32+
# command: ['bash']
3333
# args:
3434
# - -c
3535
# - >-
36-
# mkdir -p /etc/elastic-agent/inputs.d &&
37-
# wget -O - https://github.com/elastic/elastic-agent/archive/%BRANCH%.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-%BRANCH%/deploy/kubernetes/elastic-agent-standalone/templates.d"
36+
# mkdir -p /usr/share/elastic-agent/state/inputs.d &&
37+
# 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"
38+
# securityContext:
39+
# runAsUser: 0
3840
# volumeMounts:
39-
# - name: external-inputs
40-
# mountPath: /etc/elastic-agent/inputs.d
41+
# - name: elastic-agent-state
42+
# mountPath: /usr/share/elastic-agent/state
4143
containers:
4244
- name: elastic-agent-standalone
4345
image: docker.elastic.co/beats/elastic-agent:%VERSION%
@@ -61,8 +63,6 @@ spec:
6163
valueFrom:
6264
fieldRef:
6365
fieldPath: metadata.name
64-
- name: STATE_PATH
65-
value: "/etc/elastic-agent"
6666
# The following ELASTIC_NETINFO:false variable will disable the netinfo.enabled option of add-host-metadata processor. This will remove fields host.ip and host.mac.
6767
# For more info: https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html
6868
- name: ELASTIC_NETINFO
@@ -96,9 +96,6 @@ spec:
9696
mountPath: /etc/elastic-agent/agent.yml
9797
readOnly: true
9898
subPath: agent.yml
99-
# Uncomment if using hints feature
100-
#- name: external-inputs
101-
# mountPath: /etc/elastic-agent/inputs.d
10299
- name: proc
103100
mountPath: /hostfs/proc
104101
readOnly: true
@@ -129,9 +126,6 @@ spec:
129126
configMap:
130127
defaultMode: 0640
131128
name: agent-node-datastreams
132-
# Uncomment if using hints feature
133-
#- name: external-inputs
134-
# emptyDir: {}
135129
- name: proc
136130
hostPath:
137131
path: /proc

0 commit comments

Comments
 (0)