Skip to content

Commit

Permalink
Update kubernetes templates for elastic-agent (#143275)
Browse files Browse the repository at this point in the history
Automated by
https://fleet-ci.elastic.co/job/elastic-agent/job/elastic-agent-mbp/job/main/509/

Co-authored-by: obscloudnativemonitoring <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Jaime Soriano Pastor <[email protected]>
Co-authored-by: Andrew Gizas <[email protected]>
  • Loading branch information
5 people authored Dec 21, 2022
1 parent 4e0a0a5 commit e9b2e60
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,24 @@ spec:
serviceAccountName: elastic-agent
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
# Uncomment if using hints feature
#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/main.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent/templates.d"
# volumeMounts:
# - name: external-inputs
# mountPath: /etc/elastic-agent/inputs.d
containers:
- name: elastic-agent
image: docker.elastic.co/beats/elastic-agent:VERSION
args: [
"-c", "/etc/agent.yml",
"-c", "/etc/elastic-agent/agent.yml",
"-e",
]
env:
Expand All @@ -56,6 +69,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: STATE_PATH
value: "/etc/elastic-agent"
securityContext:
runAsUser: 0
resources:
Expand All @@ -66,9 +81,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 All @@ -92,6 +110,9 @@ spec:
configMap:
defaultMode: 0640
name: agent-node-datastreams
# Uncomment if using hints feature
#- name: external-inputs
# emptyDir: {}
- name: proc
hostPath:
path: /proc
Expand Down Expand Up @@ -220,6 +241,10 @@ rules:
resources:
- podsecuritypolicies
verbs: ["get", "list", "watch"]
- apiGroups: [ "storage.k8s.io" ]
resources:
- storageclasses
verbs: [ "get", "list", "watch" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down Expand Up @@ -262,7 +287,7 @@ metadata:
`;

export const elasticAgentManagedManifest = `---
# For more information refer to https://www.elastic.co/guide/en/fleet/current/running-on-kubernetes-managed-by-fleet.html
# For more information https://www.elastic.co/guide/en/fleet/current/running-on-kubernetes-managed-by-fleet.html
apiVersion: apps/v1
kind: DaemonSet
metadata:
Expand Down Expand Up @@ -491,6 +516,10 @@ rules:
resources:
- podsecuritypolicies
verbs: ["get", "list", "watch"]
- apiGroups: [ "storage.k8s.io" ]
resources:
- storageclasses
verbs: [ "get", "list", "watch" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down

0 comments on commit e9b2e60

Please sign in to comment.