Skip to content

Commit

Permalink
Update manifests to leverage hints
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark committed Sep 14, 2022
1 parent ae2c942 commit 9b62535
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
31 changes: 29 additions & 2 deletions deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ data:
providers.kubernetes:
node: ${NODE_NAME}
scope: node
#Uncomment to enable hints' support
#hints.enabled: true
inputs:
- name: kubernetes-cluster-metrics
condition: ${kubernetes_leaderelection.leader} == true
Expand Down Expand Up @@ -651,11 +653,27 @@ spec:
serviceAccountName: elastic-agent-standalone
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
#initContainers:
# - name: k8s-templates-downloader
# image: busybox:1.28
# command: ['sh']
# args:
# - -c
# - >-
# mkdir -p /etc/elastic-agent/inputs.d &&
# 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" &&
# ls &&
# pwd &&
# echo malakies &&
# ls /etc/elastic-agent/inputs.d
# volumeMounts:
# - name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
containers:
- name: elastic-agent-standalone
image: docker.elastic.co/beats/elastic-agent:8.3.0
args: [
"-c", "/etc/agent.yml",
"-c", "/etc/elastic-agent/agent.yml",
"-e",
]
env:
Expand All @@ -677,6 +695,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: STATE_PATH
value: "/etc/elastic-agent"
securityContext:
runAsUser: 0
resources:
Expand All @@ -687,9 +707,12 @@ spec:
memory: 400Mi
volumeMounts:
- name: datastreams
mountPath: /etc/agent.yml
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 @@ -722,6 +745,10 @@ spec:
configMap:
defaultMode: 0640
name: agent-node-datastreams
# Uncomment if using hints feature
#- name: external-inputs
# hostPath:
# path: /etc/elastic-agent/inputs.d
- name: proc
hostPath:
path: /proc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ data:
providers.kubernetes:
node: ${NODE_NAME}
scope: node
#Uncomment to enable hints' support
#hints.enabled: true
inputs:
- name: kubernetes-cluster-metrics
condition: ${kubernetes_leaderelection.leader} == true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,27 @@ spec:
serviceAccountName: elastic-agent-standalone
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
#initContainers:
# - name: k8s-templates-downloader
# image: busybox:1.28
# command: ['sh']
# args:
# - -c
# - >-
# mkdir -p /etc/elastic-agent/inputs.d &&
# 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" &&
# ls &&
# pwd &&
# echo malakies &&
# ls /etc/elastic-agent/inputs.d
# volumeMounts:
# - name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
containers:
- name: elastic-agent-standalone
image: docker.elastic.co/beats/elastic-agent:%VERSION%
args: [
"-c", "/etc/agent.yml",
"-c", "/etc/elastic-agent/agent.yml",
"-e",
]
env:
Expand All @@ -51,6 +67,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: STATE_PATH
value: "/etc/elastic-agent"
securityContext:
runAsUser: 0
resources:
Expand All @@ -61,9 +79,12 @@ spec:
memory: 400Mi
volumeMounts:
- name: datastreams
mountPath: /etc/agent.yml
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 @@ -96,6 +117,10 @@ spec:
configMap:
defaultMode: 0640
name: agent-node-datastreams
# Uncomment if using hints feature
#- name: external-inputs
# hostPath:
# path: /etc/elastic-agent/inputs.d
- name: proc
hostPath:
path: /proc
Expand Down

0 comments on commit 9b62535

Please sign in to comment.