elastic / elastic/elastic-agent
[Discuss] Support upgrade for standalone elastic agent in k8s manifest
- Dominant language
- Go
- Stars
- 275
- Forks
- 264
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 312
Description
**Describe the enhancement:** Supporting elastic agent upgrade for standalone agents in k8s.
At the moment users can only execute clean installations using https://github.com/elastic/elastic-agent/blob/main/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml.
Few workarounds:
- tweaking scripts to copy existing agent data/config to the new agent
- adding specific flag (potential data path, etc.) when installing the agent to detect potential upgrade scenario
- remove version number from the data mount to ensure location is fixed
current situation:
`/usr/share/elastic-agent/state/data/run/ut_regsys/filebeat--8.2.0/registry/filebeat`
`/usr/share/elastic-agent/state/data/run/ut_regsys/filebeat--8.3.2/registry/filebeat`
- (?)run the `elastic-agent upgrade` cmd as a pre-init in k8s (if possible), with the version of the current image
Cons
- maintain breaking changes
- it goes against desired state deployment paradigms
@elastic/cloud-k8s do you have any pointers on how this is currently handled/can be handled ?
Contributor guide
Research direction
Start with deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml and trace how the standalone agent mounts state across image versions. Review the existing versioned data paths and whether the elastic-agent upgrade command can run during Kubernetes startup. Done means agreeing on and documenting a supported upgrade flow that preserves agent state without ad hoc scripts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100