-
Notifications
You must be signed in to change notification settings - Fork 20
Use script pod template custom resource to create pods and containers #1136
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
Conversation
"DefaultLogDirectory": "<telepresence-root>/octopus/logs", | ||
"BOOTSTRAPRUNNEREXECUTABLEPATH": "/tmp/k8s-agent-debug-vol/bootstrapRunner", | ||
"TELEPRESENCE_ROOT": "<telepresence-root>", | ||
"OCTOPUS_HOME": "<telepresence-root>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small fix from me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for customizing Kubernetes script pod creation through a new custom resource called scriptpodtemplate.agent.octopus.com
. The implementation allows users to define custom pod specifications, script container specs, and watchdog container specs that serve as base templates for script execution pods.
Key changes:
- Introduces
ScriptPodTemplateCustomResource
to define custom pod templates - Adds
KubernetesCustomResourceService
to retrieve and manage custom resources - Updates pod creation logic to merge custom resource specifications with default configurations
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
ScriptPodTemplateCustomResource.cs | Defines the custom resource structure for script pod templates |
KubernetesCustomResourceService.cs | Service for retrieving script pod template custom resources |
KubernetesScriptPodCreator.cs | Updated pod creation logic to integrate custom resource templates |
KubernetesRawScriptPodCreator.cs | Updated raw script pod creator to support custom resource templates |
KubernetesContainerExtensionMethods.cs | Utility extension method for deep cloning Kubernetes containers |
KubernetesModule.cs | Dependency injection registration for the new service |
launchSettings.template.json | Configuration update for telepresence debugging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Background
Allows the script pods and containers to have certain fields controlled via a new custom resource, the
scriptpodtemplate.agent.octopus.com
Results
When creating the script pod, we now try and read the old custom resource. If this exists, we then use its pod spec, script container and/or the watchdog container spec's to build the base specs/containers.
We then modify these with any additional changes we require for the pods to execute correctly
How to review this PR
Quality ✔️
Pre-requisites