Documentation
¶
Overview ¶
Package helm provides agent-side label injection into rendered Kubernetes manifests for release tracking. Shared chart utilities and container image extraction are provided by internal/chartutil.
Index ¶
Constants ¶
const ( // AppLabelKey is the label key used to identify which application // owns a Kubernetes resource. This enables querying all resources // belonging to a specific application. AppLabelKey = "agent.flightctl.io/app" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler injects labels into Kubernetes manifests using kubectl kustomize. It leverages kustomize's built-in label transformer which automatically handles all Kubernetes resource types and their pod templates.
func NewLabeler ¶
func NewLabeler(kube *client.Kube, readWriter fileio.ReadWriter) *Labeler
NewLabeler creates a new Labeler that uses kubectl kustomize to inject labels.
func (*Labeler) InjectLabels ¶
func (l *Labeler) InjectLabels(ctx context.Context, input io.Reader, output io.Writer, labels map[string]string) error
InjectLabels reads multi-document YAML from input, injects the provided labels into each Kubernetes resource using kustomize, and writes the modified YAML to output.
This function is designed to be used as a Helm post-renderer. Helm pipes rendered templates through the post-renderer before applying them to the cluster.
Labels are injected using kustomize's label transformer with:
- includeSelectors: false (avoids modifying immutable selectors)
- includeTemplates: true (ensures pods inherit labels from their controllers)
This approach automatically handles all Kubernetes resource types including Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, and any future types.