Skip to content

Mount /etc/machine-id in elastic-agent-managed-kubernetes.yaml #512

@daniel-almeida

Description

@daniel-almeida

Describe the enhancement:

Change the yaml for managed Agent in k8s so that it has a volume for /etc/machine-id that is mounted in the Agent's container.

New volume mount for the elastic-agent container:

- name: etc-mid
  mountPath: /etc/machine-id
  readOnly: true

New volume:

- name: etc-mid
  hostPath:
    path: /etc/machine-id
    type: File

Describe a specific use case for the enhancement or feature:

To determine host ID, Agent needs the content of /etc/machine-id (see https://github.com/elastic/go-sysinfo/blob/main/providers/linux/machineid.go#L32).

Currently, the file is present in the container, but empty, which results in Agent using the value "" when determining the host ID, and sending an empty host ID to endpoint. That makes the policy status unhealthy because Endpoint requires a valid host ID.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions