Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions api/v1alpha1/bindplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
autoscalingv2 "k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
Expand Down Expand Up @@ -113,6 +114,20 @@ type NodeAutoscalingSpec struct {
Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"`
}

// PodDisruptionBudgetSpec configures the operator-managed PodDisruptionBudget for a component.
// +kubebuilder:validation:XValidation:rule="!(has(self.minAvailable) && has(self.maxUnavailable))",message="minAvailable and maxUnavailable are mutually exclusive"
type PodDisruptionBudgetSpec struct {
// MinAvailable is the number or percentage of pods that must stay available
// during a voluntary disruption. Mutually exclusive with maxUnavailable.
// +optional
MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`

// MaxUnavailable is the number or percentage of pods that can be unavailable
// during a voluntary disruption. Mutually exclusive with minAvailable.
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
}

// ServiceAccountSpec defines configuration for an operator-managed ServiceAccount.
type ServiceAccountSpec struct {
// Annotations are added to the ServiceAccount's metadata.annotations.
Expand Down Expand Up @@ -147,6 +162,12 @@ type BindplaneComponentSpec struct {
// +kubebuilder:default=false
DisablePodDisruptionBudget bool `json:"disablePodDisruptionBudget,omitempty"`

// PodDisruptionBudget configures the operator-managed PodDisruptionBudget for this component.
// When omitted, the operator creates a PDB with minAvailable: 1. Ignored when
// disablePodDisruptionBudget is true.
// +optional
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// MinReadySeconds is the minimum number of seconds a newly created Node pod must be
// ready (passing its readiness probe) before it is considered available. During a
// rolling update the next pod is not replaced until this window elapses. When omitted,
Expand Down Expand Up @@ -294,6 +315,12 @@ type OpAMPComponentSpec struct {
// +kubebuilder:default=false
DisablePodDisruptionBudget bool `json:"disablePodDisruptionBudget,omitempty"`

// PodDisruptionBudget configures the operator-managed PodDisruptionBudget for this component.
// When omitted, the operator creates a PDB with minAvailable: 1. Ignored when
// disablePodDisruptionBudget is true.
// +optional
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// MinReadySeconds is the minimum number of seconds a newly created OpAMP pod
// must be ready before it is considered available. When omitted, the operator
// defaults this to the pod's termination grace period.
Expand Down Expand Up @@ -987,6 +1014,12 @@ type TransformAgentComponentSpec struct {
// +optional
DisablePodDisruptionBudget bool `json:"disablePodDisruptionBudget,omitempty"`

// PodDisruptionBudget configures the operator-managed PodDisruptionBudget for this component.
// When omitted, the operator creates a PDB with minAvailable: 1. Ignored when
// disablePodDisruptionBudget is true.
// +optional
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// ExtraEnv is a list of additional environment variables to inject into the
// primary container of this component. These are prepended BEFORE the
// operator-managed environment variables, so a duplicate Name set here will
Expand Down Expand Up @@ -1127,6 +1160,12 @@ type NatsComponentSpec struct {
// +optional
DisablePodDisruptionBudget bool `json:"disablePodDisruptionBudget,omitempty"`

// PodDisruptionBudget configures the operator-managed PodDisruptionBudget for this component.
// When omitted, the operator creates a PDB with minAvailable: 1. Ignored when
// disablePodDisruptionBudget is true.
// +optional
PodDisruptionBudget *PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// ExtraEnv is a list of additional environment variables to inject into the
// primary container of this component. These are prepended BEFORE the
// operator-managed environment variables, so a duplicate Name set here will
Expand Down
46 changes: 46 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions config/crd/bases/k8s.bindplane.com_bindplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,22 @@ spec:
format: int32
minimum: 0
type: integer
podDisruptionBudget:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
minAvailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
x-kubernetes-validations:
- message: minAvailable and maxUnavailable are mutually exclusive
rule: '!(has(self.minAvailable) && has(self.maxUnavailable))'
podTemplate:
properties:
metadata:
Expand Down Expand Up @@ -16767,6 +16783,22 @@ spec:
image:
minLength: 1
type: string
podDisruptionBudget:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
minAvailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
x-kubernetes-validations:
- message: minAvailable and maxUnavailable are mutually exclusive
rule: '!(has(self.minAvailable) && has(self.maxUnavailable))'
podTemplate:
properties:
metadata:
Expand Down Expand Up @@ -22054,6 +22086,22 @@ spec:
format: int32
minimum: 0
type: integer
podDisruptionBudget:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
minAvailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
x-kubernetes-validations:
- message: minAvailable and maxUnavailable are mutually exclusive
rule: '!(has(self.minAvailable) && has(self.maxUnavailable))'
podTemplate:
properties:
metadata:
Expand Down Expand Up @@ -26999,6 +27047,22 @@ spec:
image:
minLength: 1
type: string
podDisruptionBudget:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
minAvailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
x-kubernetes-validations:
- message: minAvailable and maxUnavailable are mutually exclusive
rule: '!(has(self.minAvailable) && has(self.maxUnavailable))'
podTemplate:
properties:
metadata:
Expand Down
Loading
Loading