Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1efa39b
reconcile: wait till PVC is in bound phase
AndrewChubatiuk Mar 16, 2026
a629426
test: add tests for useProxyProtocol setting
vrutkovs Mar 18, 2026
de3c010
chore: refactored probe building and cluster defaults management (#1916)
AndrewChubatiuk Mar 6, 2026
4b75b15
fix: set maxUnavailable to 1 when its 0 to avoid an infinite loop (#1…
vrutkovs Mar 5, 2026
df38d2c
ported fixes from PRs #1980 and #1971
AndrewChubatiuk Mar 20, 2026
5e386b7
vmalertmanager: do not ignore tracing config, when to alertmanagercon…
AndrewChubatiuk Mar 30, 2026
060ec35
vmagent: apply scrapeclass relabellings before job ones (#2003)
AndrewChubatiuk Mar 30, 2026
a4ef3aa
Requeue zone update when context is cancelled (#1965)
vrutkovs Mar 17, 2026
b1dd81d
controllers: use single error handling for all CRs (#1964)
AndrewChubatiuk Mar 17, 2026
947ac93
defaults: do not use clusterversion for vl/vt requests load balancer tag
AndrewChubatiuk Mar 30, 2026
f786b8e
do not use cluster tag for vm lb
AndrewChubatiuk Mar 30, 2026
69e3657
fix: sort any unhealthy zone first in VMDistributed (#2009)
vrutkovs Mar 30, 2026
22f7612
vmagent,vmanomaly: render SHARD_NUM placeholder when shards count is …
AndrewChubatiuk Mar 30, 2026
3f2bdea
Rules rebalance tests and configmap / secrets list changes (#2011)
vrutkovs Mar 30, 2026
9c2f004
fix: watch daemonsets for vmagent / vlagent (#2012)
vrutkovs Mar 31, 2026
176c1a4
Improving logging telemetry in the VMDistributed path (#1996)
djluck Mar 31, 2026
e154084
logging: made frequent vmrule, vmscrape logs verbose (#2014)
AndrewChubatiuk Mar 31, 2026
f8ae8da
reconcile: do not swallow error that may happen if STS PVC update fai…
AndrewChubatiuk Mar 31, 2026
d410030
minor logs update
AndrewChubatiuk Mar 31, 2026
1b272bd
vmdistributed: filter vmauth targets by owner reference (#2010)
AndrewChubatiuk Mar 31, 2026
025dffa
vlcluster,vtcluster: do not ignore extraStorageNode, when default sto…
AndrewChubatiuk Mar 30, 2026
14c05a0
followup for 1b272bd
AndrewChubatiuk Mar 31, 2026
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
24 changes: 11 additions & 13 deletions api/operator/v1/vlagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ type VLAgentSpec struct {

// ServiceAccountName is the name of the ServiceAccount to use to run the pods
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`

*vmv1beta1.EmbeddedProbes `json:",inline"`
vmv1beta1.CommonDefaultableParams `json:",inline,omitempty"`
vmv1beta1.CommonApplicationDeploymentParams `json:",inline,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline,omitempty"`
}

type VLAgentK8sCollector struct {
Expand Down Expand Up @@ -186,6 +183,11 @@ func (cr *VLAgent) Validate() error {
return nil
}

// UseProxyProtocol implements build.probeCRD interface
func (cr *VLAgent) UseProxyProtocol() bool {
return vmv1beta1.UseProxyProtocol(cr.Spec.ExtraArgs)
}

// UnmarshalJSON implements json.Unmarshaler interface
func (cr *VLAgent) UnmarshalJSON(src []byte) error {
type pcr VLAgent
Expand Down Expand Up @@ -286,15 +288,16 @@ type VLAgentStatus struct {
}

// GetStatusMetadata returns metadata for object status
func (cr *VLAgentStatus) GetStatusMetadata() *vmv1beta1.StatusMetadata {
return &cr.StatusMetadata
func (cr *VLAgent) GetStatusMetadata() *vmv1beta1.StatusMetadata {
return &cr.Status.StatusMetadata
}

// +genclient

// VLAgent - is a tiny but brave agent, which helps you collect logs from various sources and stores them in VictoriaLogs.
// +operator-sdk:gen-csv:customresourcedefinitions.displayName="VLAgent App"
// +operator-sdk:gen-csv:customresourcedefinitions.resources="Deployment,apps"
// +operator-sdk:gen-csv:customresourcedefinitions.resources="DaemonSet,apps"
// +operator-sdk:gen-csv:customresourcedefinitions.resources="StatefulSet,apps"
// +operator-sdk:gen-csv:customresourcedefinitions.resources="Service,v1"
// +operator-sdk:gen-csv:customresourcedefinitions.resources="Secret,v1"
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -461,11 +464,6 @@ func (cr *VLAgent) AsURL() string {
return fmt.Sprintf("%s://%s.%s.svc:%s", vmv1beta1.HTTPProtoFromFlags(cr.Spec.ExtraArgs), cr.PrefixedName(), cr.Namespace, port)
}

// Probe implements build.probeCRD interface
func (cr *VLAgent) Probe() *vmv1beta1.EmbeddedProbes {
return cr.Spec.EmbeddedProbes
}

// ProbePath implements build.probeCRD interface
func (cr *VLAgent) ProbePath() string {
return vmv1beta1.BuildPathWithPrefixFlag(cr.Spec.ExtraArgs, healthPath)
Expand Down
105 changes: 59 additions & 46 deletions api/operator/v1/vlcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"

Expand Down Expand Up @@ -210,8 +211,8 @@ type VLClusterStatus struct {
}

// GetStatusMetadata returns metadata for object status
func (cr *VLClusterStatus) GetStatusMetadata() *vmv1beta1.StatusMetadata {
return &cr.StatusMetadata
func (cr *VLCluster) GetStatusMetadata() *vmv1beta1.StatusMetadata {
return &cr.Status.StatusMetadata
}

// VLInsert defines vlinsert component configuration at victoria-logs cluster
Expand All @@ -236,8 +237,7 @@ type VLInsert struct {
ServiceScrapeSpec *vmv1beta1.VMServiceScrapeSpec `json:"serviceScrapeSpec,omitempty"`
// PodDisruptionBudget created by operator
// +optional
PodDisruptionBudget *vmv1beta1.EmbeddedPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
*vmv1beta1.EmbeddedProbes `json:",inline"`
PodDisruptionBudget *vmv1beta1.EmbeddedPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
// Configures horizontal pod autoscaling.
// +optional
HPA *vmv1beta1.EmbeddedHPA `json:"hpa,omitempty"`
Expand All @@ -256,20 +256,19 @@ type VLInsert struct {
// +optional
RollingUpdate *appsv1.RollingUpdateDeployment `json:"rollingUpdate,omitempty"`

vmv1beta1.CommonDefaultableParams `json:",inline"`
vmv1beta1.CommonApplicationDeploymentParams `json:",inline"`
}

// Probe implements build.probeCRD interface
func (cr *VLInsert) Probe() *vmv1beta1.EmbeddedProbes {
return cr.EmbeddedProbes
vmv1beta1.CommonAppsParams `json:",inline"`
}

// ProbePath implements build.probeCRD interface
func (cr *VLInsert) ProbePath() string {
return vmv1beta1.BuildPathWithPrefixFlag(cr.ExtraArgs, healthPath)
}

// UseProxyProtocol implements build.probeCRD interface
func (cr *VLInsert) UseProxyProtocol() bool {
return vmv1beta1.UseProxyProtocol(cr.ExtraArgs)
}

// ProbeScheme implements build.probeCRD interface
func (cr *VLInsert) ProbeScheme() string {
return strings.ToUpper(vmv1beta1.HTTPProtoFromFlags(cr.ExtraArgs))
Expand Down Expand Up @@ -421,8 +420,7 @@ type VLSelect struct {
ServiceScrapeSpec *vmv1beta1.VMServiceScrapeSpec `json:"serviceScrapeSpec,omitempty"`
// PodDisruptionBudget created by operator
// +optional
PodDisruptionBudget *vmv1beta1.EmbeddedPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
*vmv1beta1.EmbeddedProbes `json:",inline"`
PodDisruptionBudget *vmv1beta1.EmbeddedPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
// Configures horizontal pod autoscaling.
// +optional
HPA *vmv1beta1.EmbeddedHPA `json:"hpa,omitempty"`
Expand All @@ -441,8 +439,7 @@ type VLSelect struct {
// ExtraStorageNodes - defines additional storage nodes to VLSelect
ExtraStorageNodes []VLStorageNode `json:"extraStorageNodes,omitempty"`

vmv1beta1.CommonDefaultableParams `json:",inline"`
vmv1beta1.CommonApplicationDeploymentParams `json:",inline"`
vmv1beta1.CommonAppsParams `json:",inline"`
}

// GetMetricsPath returns prefixed path for metric requests
Expand All @@ -453,6 +450,11 @@ func (cr *VLSelect) GetMetricsPath() string {
return vmv1beta1.BuildPathWithPrefixFlag(cr.ExtraArgs, metricsPath)
}

// UseProxyProtocol implements build.probeCRD interface
func (cr *VLSelect) UseProxyProtocol() bool {
return vmv1beta1.UseProxyProtocol(cr.ExtraArgs)
}

// ExtraArgs returns additionally configured command-line arguments
func (cr *VLSelect) GetExtraArgs() map[string]string {
return cr.ExtraArgs
Expand All @@ -468,11 +470,6 @@ func (cr *VLSelect) GetServiceScrape() *vmv1beta1.VMServiceScrapeSpec {
return cr.ServiceScrapeSpec
}

// Probe implements build.probeCRD interface
func (cr *VLSelect) Probe() *vmv1beta1.EmbeddedProbes {
return cr.EmbeddedProbes
}

// ProbePath implements build.probeCRD interface
func (cr *VLSelect) ProbePath() string {
return vmv1beta1.BuildPathWithPrefixFlag(cr.ExtraArgs, healthPath)
Expand Down Expand Up @@ -537,8 +534,7 @@ type VLStorage struct {
ServiceScrapeSpec *vmv1beta1.VMServiceScrapeSpec `json:"serviceScrapeSpec,omitempty"`
// PodDisruptionBudget created by operator
// +optional
PodDisruptionBudget *vmv1beta1.EmbeddedPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
*vmv1beta1.EmbeddedProbes `json:",inline"`
PodDisruptionBudget *vmv1beta1.EmbeddedPodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
// RollingUpdateStrategy defines strategy for application updates
// Default is OnDelete, in this case operator handles update process
// Can be changed for RollingUpdate
Expand Down Expand Up @@ -574,8 +570,7 @@ type VLStorage struct {
// +optional
MaintenanceSelectNodeIDs []int32 `json:"maintenanceSelectNodeIDs,omitempty"`

vmv1beta1.CommonDefaultableParams `json:",inline"`
vmv1beta1.CommonApplicationDeploymentParams `json:",inline"`
vmv1beta1.CommonAppsParams `json:",inline"`

// RollingUpdateStrategyBehavior defines customized behavior for rolling updates.
// It applies if the RollingUpdateStrategy is set to OnDelete, which is the default.
Expand All @@ -591,6 +586,11 @@ func (cr *VLStorage) GetStorageVolumeName() string {
return "vlstorage-db"
}

// UseProxyProtocol implements build.probeCRD interface
func (cr *VLStorage) UseProxyProtocol() bool {
return vmv1beta1.UseProxyProtocol(cr.ExtraArgs)
}

// GetMetricsPath returns prefixed path for metric requests
func (cr *VLStorage) GetMetricsPath() string {
if cr == nil {
Expand All @@ -614,11 +614,6 @@ func (cr *VLStorage) GetServiceScrape() *vmv1beta1.VMServiceScrapeSpec {
return cr.ServiceScrapeSpec
}

// Probe implements build.probeCRD interface
func (cr *VLStorage) Probe() *vmv1beta1.EmbeddedProbes {
return cr.EmbeddedProbes
}

// ProbePath implements build.probeCRD interface
func (cr *VLStorage) ProbePath() string {
return vmv1beta1.BuildPathWithPrefixFlag(cr.ExtraArgs, healthPath)
Expand Down Expand Up @@ -702,23 +697,6 @@ func (cr *VLCluster) Validate() error {
if vmv1beta1.MustSkipCRValidation(cr) {
return nil
}
if cr.Spec.VLSelect != nil {
vms := cr.Spec.VLSelect
name := cr.PrefixedName(vmv1beta1.ClusterComponentSelect)
if vms.ServiceSpec != nil && vms.ServiceSpec.Name == name {
return fmt.Errorf(".serviceSpec.Name cannot be equal to prefixed name=%q", name)
}
if vms.HPA != nil {
if err := vms.HPA.Validate(); err != nil {
return err
}
}
if vms.VPA != nil {
if err := vms.VPA.Validate(); err != nil {
return err
}
}
}
if cr.Spec.VLInsert != nil {
vli := cr.Spec.VLInsert
name := cr.PrefixedName(vmv1beta1.ClusterComponentInsert)
Expand All @@ -736,6 +714,7 @@ func (cr *VLCluster) Validate() error {
}
}
}
storageNodes := sets.New[string]()
if cr.Spec.VLStorage != nil {
vls := cr.Spec.VLStorage
name := cr.PrefixedName(vmv1beta1.ClusterComponentStorage)
Expand All @@ -751,6 +730,40 @@ func (cr *VLCluster) Validate() error {
}
}
}
if cr.Spec.VLSelect != nil {
vms := cr.Spec.VLSelect
name := cr.PrefixedName(vmv1beta1.ClusterComponentSelect)
if vms.ServiceSpec != nil && vms.ServiceSpec.Name == name {
return fmt.Errorf(".serviceSpec.Name cannot be equal to prefixed name=%q", name)
}
if vms.HPA != nil {
if err := vms.HPA.Validate(); err != nil {
return err
}
}
if vms.VPA != nil {
if err := vms.VPA.Validate(); err != nil {
return err
}
}
if nodes, ok := cr.Spec.VLSelect.ExtraArgs["storageNode"]; ok {
for _, node := range strings.Split(nodes, ",") {
node = strings.TrimSpace(node)
if storageNodes.Has(node) {
return fmt.Errorf("encountered storageNode=%s multiple times, please make all storage node addresses are unique", node)
} else {
storageNodes.Insert(node)
}
}
}
for _, node := range cr.Spec.VLSelect.ExtraStorageNodes {
if storageNodes.Has(node.Addr) {
return fmt.Errorf("encountered storageNode=%s multiple times, please make all storage node addresses are unique", node.Addr)
} else {
storageNodes.Insert(node.Addr)
}
}
}
if cr.Spec.RequestsLoadBalancer.Enabled {
rlb := cr.Spec.RequestsLoadBalancer.Spec
name := cr.PrefixedName(vmv1beta1.ClusterComponentBalancer)
Expand Down
18 changes: 8 additions & 10 deletions api/operator/v1/vlsingle_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ type VLSingleSpec struct {
// created by operator for the given CustomResource
ManagedMetadata *vmv1beta1.ManagedObjectsMetadata `json:"managedMetadata,omitempty"`

vmv1beta1.CommonDefaultableParams `json:",inline,omitempty"`
vmv1beta1.CommonApplicationDeploymentParams `json:",inline,omitempty"`
vmv1beta1.CommonAppsParams `json:",inline,omitempty"`

// LogLevel for VictoriaLogs to be configured with.
// +optional
Expand Down Expand Up @@ -96,8 +95,6 @@ type VLSingleSpec struct {
// ServiceScrapeSpec that will be added to vlsingle VMServiceScrape spec
// +optional
ServiceScrapeSpec *vmv1beta1.VMServiceScrapeSpec `json:"serviceScrapeSpec,omitempty"`
// LivenessProbe that will be added to VLSingle pod
*vmv1beta1.EmbeddedProbes `json:",inline"`

// ServiceAccountName is the name of the ServiceAccount to use to run the pods
// +optional
Expand All @@ -114,8 +111,8 @@ type VLSingleStatus struct {
}

// GetStatusMetadata returns metadata for object status
func (cr *VLSingleStatus) GetStatusMetadata() *vmv1beta1.StatusMetadata {
return &cr.StatusMetadata
func (cr *VLSingle) GetStatusMetadata() *vmv1beta1.StatusMetadata {
return &cr.Status.StatusMetadata
}

// VLSingle is fast, cost-effective and scalable logs database.
Expand Down Expand Up @@ -148,6 +145,11 @@ func (cr *VLSingle) GetStatus() *VLSingleStatus {
return &cr.Status
}

// UseProxyProtocol implements build.probeCRD interface
func (cr *VLSingle) UseProxyProtocol() bool {
return vmv1beta1.UseProxyProtocol(cr.Spec.ExtraArgs)
}

// DefaultStatusFields implements reconcile.ObjectWithDeepCopyAndStatus interface
func (cr *VLSingle) DefaultStatusFields(vs *VLSingleStatus) {
}
Expand Down Expand Up @@ -211,10 +213,6 @@ func (cr *VLSingleSpec) UnmarshalJSON(src []byte) error {
return nil
}

func (cr *VLSingle) Probe() *vmv1beta1.EmbeddedProbes {
return cr.Spec.EmbeddedProbes
}

func (cr *VLSingle) ProbePath() string {
return vmv1beta1.BuildPathWithPrefixFlag(cr.Spec.ExtraArgs, healthPath)
}
Expand Down
Loading
Loading