How kentik/kagent-helm works
Purpose and entry points
This repository is a Helm 3 chart that renders Kubernetes resources for Kentik Universal Agent (kagent). Operators install or upgrade it with helm install / helm upgrade; Helm package metadata and defaults enter through Chart.yaml and values.yaml. Values are contract-validated by contracts/values.schema.json.
Deployment-pattern selection
deploymentType is the top-level control boundary: StatefulSet is the default for stable pod identity and PVC-backed persistence; DaemonSet targets one agent per node for node-local monitoring. Templates conditionally render the appropriate immutable workload type, so switching patterns requires uninstall/reinstall rather than in-place upgrade.
• templates/statefulset.yaml
• templates/daemonset.yaml
• values.yaml
Agent runtime and registration
The rendered workload runs the external kentik/kagent container image. Configuration passes company ID, release/channel/log/API settings, and optional overrides into the container; the provisioning token is isolated in a Kubernetes Secret and consumed through a secret reference. The agent registers/connects to Kentik’s gRPC API (grpc.api.kentik.com:443) and awaits authorization in the Kentik Portal.
• templates/statefulset.yaml
• templates/daemonset.yaml
• templates/secret-provisioning-token.yaml
Identity and persistence boundary
The agent’s ed25519 keypair is its durable identity and must survive pod recreation. The chart supports secret, PVC, hostPath, or emptyDir keypair backends, while application data can use PVC, hostPath, or emptyDir. StatefulSet supports per-pod PVCs and stable ordinal identity; DaemonSet operationally requires hostPath for persistent storage. Secret-backed keys are expected to be provisioned before installation and are copied into the runtime key directory by workload initialization.
• templates/statefulset.yaml
• templates/daemonset.yaml
• templates/pvc.yaml
Kubernetes support resources
The chart establishes the workload’s Kubernetes identity and optional access controls: ServiceAccount is normally created, RBAC resources are opt-in, and helper templates provide consistent release/name labels. PVC manifests supply persistent claims when selected by values.
• templates/serviceaccount.yaml
• templates/role.yaml
• templates/rolebinding.yaml
Network and configuration controls
An optional ConfigMap supplies advanced environment-level settings, with workload environment values taking precedence. An optional NetworkPolicy constrains egress, intended to allow DNS, Kentik API HTTPS/gRPC traffic, and optionally SNMP target networks. These are cluster-enforced boundaries and depend on a CNI that implements NetworkPolicy.
• templates/configmap.yaml
• templates/networkpolicy.yaml
• values.yaml
Secret provisioning and delivery
The chart creates the registration-token Secret, but keypair Secrets are an external lifecycle concern when persistence.keypair.type=secret. Helper scripts generate provisioning tokens and per-replica PEM-secret manifests; production users may instead synchronize Kubernetes Secrets from Vault or cloud secret managers. Scaling a StatefulSet requires identity material for each new ordinal before scaling.
• generate-provisioning-token.sh
• generate-secrets.sh
• templates/secret-provisioning-token.yaml
Validation and CI
Schema validation constrains chart inputs, while CI and Helm-oriented tests validate rendered manifests across the two workload patterns and persistence/token choices.
• contracts/values.schema.json
• .github/workflows/ci.yaml
• tests/validation_test.yaml
Main entry points: values.yaml Chart values · validation_test.yaml Helm validation tests · statefulset.yaml StatefulSet template · daemonset.yaml DaemonSet template
Components 18
Chart inputs & rendering
- Chart metadata
Chart.yaml - Chart values · Selects deployment, persistence, access, and network options.
values.yaml - Values schema
contracts/values.schema.json - StatefulSet template · Default pattern with stable ordinals and per-pod PVCs.
templates/statefulset.yaml - DaemonSet template · One node-local agent per node.
templates/daemonset.yaml
Kubernetes resources
- ServiceAccount & RBAC · ServiceAccount is normally created; RBAC is opt-in.
templates/serviceaccount.yaml - PersistentVolumeClaim
templates/pvc.yaml - Provisioning token Secret · Injects the registration token by secret reference.
templates/secret-provisioning-token.yaml - Advanced ConfigMap · Workload environment values take precedence.
templates/configmap.yaml - NetworkPolicy · Requires a NetworkPolicy-enforcing CNI.
templates/networkpolicy.yaml - Durable keypair storage · Secret, PVC, hostPath, or emptyDir; secret keys are externally provisioned.
Agent & external services
- Rendered agent workload · Runs the selected immutable workload pattern.
- kentik/kagent container · Uses durable ed25519 identity and runtime configuration.
- Kentik gRPC API · grpc.api.kentik.com:443 registration and telemetry endpoint.
Provisioning & validation
- Token generator
generate-provisioning-token.sh - Keypair secret generator · Generates per-replica PEM Secret manifests before StatefulSet scaling.
generate-secrets.sh - CI validation · Validates rendered patterns and persistence/token choices.
.github/workflows/ci.yaml - Helm validation tests
tests/validation_test.yaml
Connections 19
- Chart metadata → Chart values: packages with
- Values schema → Chart values: validates
- Chart values → StatefulSet template: selects default
- Chart values → DaemonSet template: selects node mode
- StatefulSet template → Rendered agent workload: renders
- DaemonSet template → Rendered agent workload: renders
- Rendered agent workload → kentik/kagent container: runs
- ServiceAccount & RBAC → Rendered agent workload: supplies identity/access
- PersistentVolumeClaim → Rendered agent workload: mounts when selected
- Durable keypair storage → Rendered agent workload: mounts identity
- Provisioning token Secret → Rendered agent workload: injects token
- Advanced ConfigMap → Rendered agent workload: adds optional settings
- NetworkPolicy → Rendered agent workload: constrains egress
- kentik/kagent container → Kentik gRPC API: registers/connects
- Token generator → Provisioning token Secret: generates token for
- Keypair secret generator → Durable keypair storage: provisions secret-backed keys
- CI validation → Helm validation tests: runs
- Helm validation tests → StatefulSet template: validates
- Helm validation tests → DaemonSet template: validates