Add health probe overrides to sidecar (#278)

Add support for overriding the health probes.
This is useful, for example, when injecting NetBird as a sidecar. In
that setup, the main container could start before NetBird has
established the VPN connection, resulting in failing to connect to
peers.

Example usage:
```yaml
apiVersion: netbird.io/v1alpha1
kind: SidecarProfile
metadata:
  name: netbird-sidecar
  labels:
spec:
  injectionMode: Sidecar
  setupKeyRef:
    name: netbird-setup-key
  containerOverride:
    startupProbe:
      exec:
        command: ["netbird", "status", "--check", "startup"]
      initialDelaySeconds: 10
      failureThreshold: 10
      periodSeconds: 5
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* SidecarProfile now supports overriding container health check probes
(startup, liveness, and readiness) for sidecar containers, enabling
fine-grained control over probe configurations.

* **Documentation**
* Updated API reference documentation with new probe override
configuration options.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/kubernetes-operator/pull/278?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
pallieter-verhoeven-glbnxt
2026-05-29 10:58:28 +02:00
committed by GitHub
parent c5eaa832d3
commit 3bb745de19
6 changed files with 972 additions and 0 deletions
+12
View File
@@ -53,6 +53,18 @@ type ContainerOverride struct {
// +optional
SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
// StartupProbe overrides the startup probe for the sidecar container.
// +optional
StartupProbe *corev1.Probe `json:"startupProbe,omitempty"`
// LivenessProbe overrides the liveness probe for the sidecar container.
// +optional
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
// ReadinessProbe overrides the readiness probe for the sidecar container.
// +optional
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
}
// SidecarProfileStatus defines the observed state of SidecarProfile.
+15
View File
@@ -27,6 +27,21 @@ func (in *ContainerOverride) DeepCopyInto(out *ContainerOverride) {
*out = new(v1.SecurityContext)
(*in).DeepCopyInto(*out)
}
if in.StartupProbe != nil {
in, out := &in.StartupProbe, &out.StartupProbe
*out = new(v1.Probe)
(*in).DeepCopyInto(*out)
}
if in.LivenessProbe != nil {
in, out := &in.LivenessProbe, &out.LivenessProbe
*out = new(v1.Probe)
(*in).DeepCopyInto(*out)
}
if in.ReadinessProbe != nil {
in, out := &in.ReadinessProbe, &out.ReadinessProbe
*out = new(v1.Probe)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerOverride.