Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes standalone manifest: remove STATE_PATH, replace initcontainer image #4625

22 changes: 8 additions & 14 deletions deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -692,16 +692,18 @@ spec:
# Uncomment if using hints feature
#initContainers:
# - name: k8s-templates-downloader
# image: busybox:1.28
Copy link
Contributor Author

@tetianakravchenko tetianakravchenko Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reason: with busybox:1.28 error:

wget: TLS error from peer (alert code 80): 80
wget: error getting response: Connection reset by peer

with the latest busybox image:

Connecting to github.com (140.82.121.3:443)
wget: note: TLS certificate validation not implemented

it is not an error, see docker-library/busybox#64 but as suggested in this issue should be used image with openssl and ca-certificates.
Option would be to use an alpine image, but since docker.elastic.co/beats/elastic-agent has curl that can be used to download templates, I think it makes sense to remove extra image dependency

# command: ['sh']
# image: docker.elastic.co/beats/elastic-agent:8.15.0
# command: ['bash']
# args:
# - -c
# - >-
# mkdir -p /etc/elastic-agent/inputs.d &&
# 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"
# mkdir -p /usr/share/elastic-agent/state/inputs.d &&
# 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"
# securityContext:
# runAsUser: 0
# volumeMounts:
# - name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
# - name: elastic-agent-state
# mountPath: /usr/share/elastic-agent/state
containers:
- name: elastic-agent-standalone
image: docker.elastic.co/beats/elastic-agent:8.15.0
Expand All @@ -725,8 +727,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: STATE_PATH
value: "/etc/elastic-agent"
# 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.
# For more info: https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html
- name: ELASTIC_NETINFO
Expand Down Expand Up @@ -760,9 +760,6 @@ spec:
mountPath: /etc/elastic-agent/agent.yml
readOnly: true
subPath: agent.yml
# Uncomment if using hints feature
#- name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
- name: proc
mountPath: /hostfs/proc
readOnly: true
Expand Down Expand Up @@ -793,9 +790,6 @@ spec:
configMap:
defaultMode: 0640
name: agent-node-datastreams
# Uncomment if using hints feature
#- name: external-inputs
# emptyDir: {}
- name: proc
hostPath:
path: /proc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ spec:
# Uncomment if using hints feature
#initContainers:
# - name: k8s-templates-downloader
# image: busybox:1.28
# command: ['sh']
# image: docker.elastic.co/beats/elastic-agent:%VERSION%
# command: ['bash']
# args:
# - -c
# - >-
# mkdir -p /etc/elastic-agent/inputs.d &&
# 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"
# mkdir -p /usr/share/elastic-agent/state/inputs.d &&
# 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"
# securityContext:
# runAsUser: 0
# volumeMounts:
# - name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
# - name: elastic-agent-state
# mountPath: /usr/share/elastic-agent/state
containers:
- name: elastic-agent-standalone
image: docker.elastic.co/beats/elastic-agent:%VERSION%
Expand All @@ -61,8 +63,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: STATE_PATH
value: "/etc/elastic-agent"
# 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.
# For more info: https://www.elastic.co/guide/en/beats/metricbeat/current/add-host-metadata.html
- name: ELASTIC_NETINFO
Expand Down Expand Up @@ -96,9 +96,6 @@ spec:
mountPath: /etc/elastic-agent/agent.yml
readOnly: true
subPath: agent.yml
# Uncomment if using hints feature
#- name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
- name: proc
mountPath: /hostfs/proc
readOnly: true
Expand Down Expand Up @@ -129,9 +126,6 @@ spec:
configMap:
defaultMode: 0640
name: agent-node-datastreams
# Uncomment if using hints feature
#- name: external-inputs
# emptyDir: {}
- name: proc
hostPath:
path: /proc
Expand Down
Loading