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

Update kubernetes templates for elastic-agent #138260

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ spec:
args: [
"-c", "/etc/agent.yml",
"-e",
"-d", "'*'",
]
env:
# The basic authentication username used to connect to Elasticsearch
Expand All @@ -46,7 +45,10 @@ spec:
value: "elastic"
# The basic authentication password used to connect to Elasticsearch
- name: ES_PASSWORD
value: "changeme"
value: ""
# The Elasticsearch host to communicate with
- name: ES_HOST
Copy link
Contributor

Choose a reason for hiding this comment

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

just wondering if this variable wasn't skipped on purpose - for standalone mode ES_HOST will get rendered to the actual value in configmap

Copy link
Contributor

Choose a reason for hiding this comment

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

value: ""
- name: NODE_NAME
valueFrom:
fieldRef:
Expand All @@ -59,10 +61,10 @@ spec:
runAsUser: 0
resources:
limits:
memory: 500Mi
memory: 700Mi
requests:
cpu: 100m
memory: 200Mi
memory: 400Mi
volumeMounts:
- name: datastreams
mountPath: /etc/agent.yml
Expand All @@ -71,12 +73,6 @@ spec:
- name: proc
mountPath: /hostfs/proc
readOnly: true
- name: etc-kubernetes
mountPath: /hostfs/etc/kubernetes
readOnly: true
- name: var-lib
mountPath: /hostfs/var/lib
readOnly: true
- name: cgroup
mountPath: /hostfs/sys/fs/cgroup
readOnly: true
Expand All @@ -86,6 +82,12 @@ spec:
- name: varlog
mountPath: /var/log
readOnly: true
- name: etc-kubernetes
mountPath: /hostfs/etc/kubernetes
readOnly: true
- name: var-lib
mountPath: /hostfs/var/lib
readOnly: true
- name: passwd
mountPath: /hostfs/etc/passwd
readOnly: true
Expand All @@ -103,6 +105,15 @@ spec:
- name: proc
hostPath:
path: /proc
- name: cgroup
hostPath:
path: /sys/fs/cgroup
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: varlog
hostPath:
path: /var/log
# Needed for cloudbeat
- name: etc-kubernetes
hostPath:
Expand All @@ -119,15 +130,6 @@ spec:
- name: group
hostPath:
path: /etc/group
- name: cgroup
hostPath:
path: /sys/fs/cgroup
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: varlog
hostPath:
path: /var/log
# Needed for cloudbeat
- name: etcsysmd
hostPath:
Expand Down Expand Up @@ -234,7 +236,7 @@ rules:
- rolebindings
- roles
verbs: ["get", "list", "watch"]
# Needed for cloudbeat
# Needed for cloudbeat
- apiGroups: ["policy"]
resources:
- podsecuritypolicies
Expand Down Expand Up @@ -326,7 +328,7 @@ spec:
# Elasticsearch API key used to enroll Elastic Agents in Fleet (https://www.elastic.co/guide/en/fleet/current/fleet-enrollment-tokens.html#fleet-enrollment-tokens)
# If FLEET_ENROLLMENT_TOKEN is empty then KIBANA_HOST, KIBANA_FLEET_USERNAME, KIBANA_FLEET_PASSWORD are needed
- name: FLEET_ENROLLMENT_TOKEN
value: "token-id"
value: ""
Copy link
Member

Choose a reason for hiding this comment

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

Looks like it's needed as we replace this by the ENROLLMENT token in the instructions

Suggested change
value: ""
value: "token-id"

Copy link
Contributor

Choose a reason for hiding this comment

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

oh nice let me change this

Copy link
Contributor

Choose a reason for hiding this comment

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

- name: KIBANA_HOST
value: "http://kibana:5601"
# The basic authentication username used to connect to Kibana and retrieve a service_token to enable Fleet
Expand Down Expand Up @@ -355,12 +357,6 @@ spec:
- name: proc
mountPath: /hostfs/proc
readOnly: true
- name: etc-kubernetes
mountPath: /hostfs/etc/kubernetes
readOnly: true
- name: var-lib
mountPath: /hostfs/var/lib
readOnly: true
- name: cgroup
mountPath: /hostfs/sys/fs/cgroup
readOnly: true
Expand All @@ -370,6 +366,12 @@ spec:
- name: varlog
mountPath: /var/log
readOnly: true
- name: etc-kubernetes
mountPath: /hostfs/etc/kubernetes
readOnly: true
- name: var-lib
mountPath: /hostfs/var/lib
readOnly: true
- name: passwd
mountPath: /hostfs/etc/passwd
readOnly: true
Expand Down