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

Allow the Kubernetes agent to be registered with a pre-install hook #1057

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

liam-mackie
Copy link
Contributor

@liam-mackie liam-mackie commented Jan 17, 2025

Background

As a part of the Kubernetes Monitor, we need to have the Kubernetes agent registered prior to the agent registering with server. To do this, we need to run a pre-installation script.

To keep this backwards-compatible, we can't touch any existing resources, or helm may delete files that have data in them.

As such, we have opted for the pre-installation hook to write the configuration to a different configmap and secret, and have created a new command in tentacle to migrate the configuration to the final destination.

Results

  • There's a new command in Tentacle which copies the data from the pre-installation configmap and secret and overwrites the destination data to use it
    • This should only ever happen if the agent was not registered in the existing configmap
  • There's a new script that's been added called register.sh which only runs the registration commands.

There should be no change to existing behaviour without additional changes to the helm chart to enable it.

I've also fixed up some of the integration tests to escape paths that may have spaces to fix issues running them on MacOS.

How to review this PR

Quality ✔️

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

@liam-mackie liam-mackie force-pushed the lm/pre-install-script-k8s-agent branch from 90cd881 to 6269c10 Compare February 5, 2025 00:38
@liam-mackie liam-mackie changed the title Add register.sh preinstall hook Allow the Kubernetes agent to be registered with a pre-install hook Feb 5, 2025
@liam-mackie liam-mackie marked this pull request as ready for review February 5, 2025 06:54
@liam-mackie liam-mackie requested review from a team as code owners February 5, 2025 06:54
@liam-mackie liam-mackie force-pushed the lm/pre-install-script-k8s-agent branch from c8d93ec to 1a28ce6 Compare February 13, 2025 22:12
Copy link

@eddymoulton eddymoulton left a comment

Choose a reason for hiding this comment

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

Couple of small test things but other wise looks good

@liam-mackie liam-mackie force-pushed the lm/pre-install-script-k8s-agent branch from 5e079f0 to 3f1483f Compare February 14, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants