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 -->
[](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 -->
18 KiB
API Reference
Packages
netbird.io/v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
Resource Types
ContainerOverride
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
image string |
Image overrides the image used by the client. | Optional: {} |
|
env EnvVar array |
Optional: {} |
||
securityContext SecurityContext |
Optional: {} |
||
startupProbe Probe |
StartupProbe overrides the startup probe for the sidecar container. | Optional: {} |
|
livenessProbe Probe |
LivenessProbe overrides the liveness probe for the sidecar container. | Optional: {} |
|
readinessProbe Probe |
ReadinessProbe overrides the readiness probe for the sidecar container. | Optional: {} |
CrossNamespaceReference
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string |
Name of the referent. | Required: {} |
|
namespace string |
Namespace of the referent. | Required: {} |
DNSZoneReference
DNSZoneReference references a Netbird DNS zone by domain name.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string |
Name is the domain name of an existing Netbird DNS zone, e.g. "example.com". | Required: {} |
Group
Group is the Schema for the groups API.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string |
netbird.io/v1alpha1 |
||
kind string |
Group |
||
kind string |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
Optional: {} |
|
apiVersion string |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
Optional: {} |
|
metadata ObjectMeta |
Refer to Kubernetes API documentation for fields of metadata. |
||
spec GroupSpec |
Required: {} |
||
status GroupStatus |
{ observedGeneration:-1 } |
GroupReference
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string |
Name is the name of the group. | Optional: {} |
|
id string |
ID is the id of the group. | Optional: {} |
|
localRef LocalObjectReference |
LocalReference is a reference to a group in the same namespace. | Optional: {} |
GroupSpec
GroupSpec defines the desired state of Group.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string |
Name of the group. | MinLength: 1 |
GroupStatus
GroupStatus defines the observed state of Group.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
observedGeneration integer |
ObservedGeneration is the last reconciled generation. | Optional: {} |
|
conditions Condition array |
Conditions holds the conditions for the Group. | Optional: {} |
|
groupID string |
GroupID is the id of the created group. | Optional: {} |
InjectionMode
Underlying type: string
InjectionMode defines how the sidecar is injected into the pod.
Validation:
- Enum: [Sidecar Container]
Appears in:
| Field | Description |
|---|---|
Sidecar |
InjectionModeSidecar injects the client as a sidecar container. |
Container |
InjectionModeContainer injects the client as a regular container. |
NetworkResource
NetworkResource is the Schema for the networkresources API.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string |
netbird.io/v1alpha1 |
||
kind string |
NetworkResource |
||
kind string |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
Optional: {} |
|
apiVersion string |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
Optional: {} |
|
metadata ObjectMeta |
Refer to Kubernetes API documentation for fields of metadata. |
||
spec NetworkResourceSpec |
Required: {} |
||
status NetworkResourceStatus |
{ observedGeneration:-1 } |
NetworkResourceSpec
NetworkResourceSpec defines the desired state of NetworkResource.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
networkRouterRef CrossNamespaceReference |
NetworkRouterRef is a reference to the network and router where the resource will be created. | ||
serviceRef LocalObjectReference |
ServiceRef is a reference to the service to expose in the Network. | ||
groups GroupReference array |
Groups are references to groups that the resource will be a part of. | Optional: {} |
NetworkResourceStatus
NetworkResourceStatus defines the observed state of NetworkResource.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
observedGeneration integer |
ObservedGeneration is the last reconciled generation. | Optional: {} |
|
conditions Condition array |
Conditions holds the conditions for the NetworkResource. | Optional: {} |
|
networkID string |
NetworkID is the id of the network the resource is created in. | Optional: {} |
|
resourceID string |
ResourceID is the id of the created resource. | Optional: {} |
|
dnsZoneID string |
DNSZoneID is the id of the zone the DNS record is created in. | Optional: {} |
|
dnsRecordID string |
DNSRecordID is the id of the created DNS record. | Optional: {} |
NetworkRouter
NetworkRouter is the Schema for the networkrouters API.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string |
netbird.io/v1alpha1 |
||
kind string |
NetworkRouter |
||
kind string |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
Optional: {} |
|
apiVersion string |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
Optional: {} |
|
metadata ObjectMeta |
Refer to Kubernetes API documentation for fields of metadata. |
||
spec NetworkRouterSpec |
Required: {} |
||
status NetworkRouterStatus |
{ observedGeneration:-1 } |
NetworkRouterSpec
NetworkRouterSpec defines the desired state of NetworkRouter.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
dnsZoneRef DNSZoneReference |
DNSZoneRef is a reference to the DNS zone used to create records for resources. | Required: {} |
|
image string |
Netbird client image. | Optional: {} |
|
logLevel string |
Log level for Netbird client. | Optional: {} |
|
workloadOverride WorkloadOverride |
WorkloadOverride contains configuration that will override the default workload. | Optional: {} |
NetworkRouterStatus
NetworkRouterStatus defines the observed state of NetworkRouter.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
observedGeneration integer |
ObservedGeneration is the last reconciled generation. | Optional: {} |
|
conditions Condition array |
Conditions holds the conditions for the NetworkRouter. | Optional: {} |
|
routingPeerID string |
RoutingPeerID is the id of the created routing peer. | Optional: {} |
|
networkID string |
NetworkID is the id of the network the routing peer was created in. | Optional: {} |
SetupKey
SetupKey is the Schema for the setupkeys API.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string |
netbird.io/v1alpha1 |
||
kind string |
SetupKey |
||
kind string |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
Optional: {} |
|
apiVersion string |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
Optional: {} |
|
metadata ObjectMeta |
Refer to Kubernetes API documentation for fields of metadata. |
||
spec SetupKeySpec |
Required: {} |
||
status SetupKeyStatus |
{ observedGeneration:-1 } |
SetupKeySpec
SetupKeySpec defines the desired state of SetupKey.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
name string |
Name of the setup key. | MinLength: 1 |
|
ephemeral boolean |
Ephemeral decides if peers added with the key are ephemeral or not. | ||
allowExtraDnsLabels boolean |
AllowExtraDnsLabels decides if peers added with the key can have extra DNS labels. | false | |
duration Duration |
Duration sets how long the setup key is valid for. | Pattern: ^([0-9]+(\.[0-9]+)?(m|h))+$ Type: string Optional: {} |
|
autoGroups GroupReference array |
AutoGroups are groups that will be automatically assigned to peers using setup key. | Optional: {} |
SetupKeyStatus
SetupKeyStatus defines the observed state of SetupKey.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
observedGeneration integer |
ObservedGeneration is the last reconciled generation. | Optional: {} |
|
conditions Condition array |
Conditions holds the conditions for the SetupKey. | Optional: {} |
|
setupKeyID string |
SetupKeyID is the id of the created setup key. |
SidecarProfile
SidecarProfile is the Schema for the sidecarprofiles API.
| Field | Description | Default | Validation |
|---|---|---|---|
apiVersion string |
netbird.io/v1alpha1 |
||
kind string |
SidecarProfile |
||
kind string |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
Optional: {} |
|
apiVersion string |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
Optional: {} |
|
metadata ObjectMeta |
Refer to Kubernetes API documentation for fields of metadata. |
||
spec SidecarProfileSpec |
Required: {} |
||
status SidecarProfileStatus |
{ } |
SidecarProfileSpec
SidecarProfileSpec defines the desired state of SidecarProfile.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
setupKeyRef LocalObjectReference |
SetupKeyRef is the reference to the setup key used in the client. | Required: {} |
|
podSelector LabelSelector |
PodSelector determines which pods the profile should apply to. An empty slector means the profile will apply to all pods in the namespace. |
Optional: {} |
|
injectionMode InjectionMode |
InjectionMode defines whether the sidecar is injected as a native Kubernetes sidecar container or as a regular container. | Sidecar | Enum: [Sidecar Container] Optional: {} |
extraDNSLabels string array |
ExtraDNSLabels assigns additional DNS names to peers beyond their default hostname. | Optional: {} |
|
containerOverride ContainerOverride |
Optional: {} |
SidecarProfileStatus
SidecarProfileStatus defines the observed state of SidecarProfile.
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
conditions Condition array |
Conditions holds the conditions for the SidecarProfile. | Optional: {} |
WorkloadOverride
Appears in:
| Field | Description | Default | Validation |
|---|---|---|---|
labels object (keys:string, values:string) |
Labels that will be added. | Optional: {} |
|
annotations object (keys:string, values:string) |
Annotations that will be added. | Optional: {} |
|
replicas integer |
Replicas sets the amount of client replicas. | 3 | Minimum: 1 Optional: {} |
podTemplate PodTemplateSpec |
PodTemplate overrides the pod template. | Schemaless: {} Optional: {} |