Documentation ¶
Index ¶
Constants ¶
const (
UnLimitedResource = "unlimited"
)
Variables ¶
var WatchNamespaceEnvVar = "WATCH_NAMESPACE"
WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE which specifies the Namespace to watch. An empty value means the operator is running with cluster scope.
Functions ¶
func IsClusterWideAccessAllowed ¶ added in v0.34.0
func IsClusterWideAccessAllowed() bool
IsClusterWideAccessAllowed checks if cluster wide access for components is needed
func MustGetWatchNamespaces ¶ added in v0.42.0
func MustGetWatchNamespaces() []string
MustGetWatchNamespaces returns a list of namespaces to be watched by operator Operator don't perform any cluster wide API calls if namespaces not empty in case of empty list it performs only clusterwide api calls
Types ¶
type ApplicationDefaults ¶ added in v0.48.0
type ApplicationDefaults struct { Image string Version string ConfigReloadImage string Port string UseDefaultResources bool Resource struct { Limit struct { Mem string Cpu string } Request struct { Mem string Cpu string } } ConfigReloaderCPU string ConfigReloaderMemory string }
ApplicationDefaults is useful for generic default building uses the same memory as application default at config
type BaseOperatorConf ¶
type BaseOperatorConf struct { // enables custom config reloader for vmauth and vmagent, // it should speed-up config reloading process. UseCustomConfigReloader bool `default:"false"` // container registry name prefix, e.g. docker.io ContainerRegistry string `default:""` CustomConfigReloaderImage string `default:"victoriametrics/operator:config-reloader-v0.48.4"` PSPAutoCreateEnabled bool `default:"false"` VLogsDefault struct { Image string `default:"victoriametrics/victoria-logs"` Version string `default:"v0.32.0-victorialogs"` // ignored ConfigReloadImage string `ignored:"true"` Port string `default:"9428"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"1500Mi"` Cpu string `default:"1200m"` } Request struct { Mem string `default:"500Mi"` Cpu string `default:"150m"` } } // ignored ConfigReloaderCPU string `ignored:"true"` // ignored ConfigReloaderMemory string `ignored:"true"` } VMAlertDefault struct { Image string `default:"victoriametrics/vmalert"` Version string `default:"v1.106.1"` ConfigReloadImage string `default:"jimmidyson/configmap-reload:v0.3.0"` Port string `default:"8080"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"500Mi"` Cpu string `default:"200m"` } Request struct { Mem string `default:"200Mi"` Cpu string `default:"50m"` } } ConfigReloaderCPU string `default:"100m"` ConfigReloaderMemory string `default:"25Mi"` } VMServiceScrapeDefault struct { // Use endpointslices instead of endpoints as discovery role // for vmservicescrape when generate scrape config for vmagent. EnforceEndpointslices bool `default:"false"` } VMAgentDefault struct { Image string `default:"victoriametrics/vmagent"` Version string `default:"v1.106.1"` ConfigReloadImage string `default:"quay.io/prometheus-operator/prometheus-config-reloader:v0.68.0"` Port string `default:"8429"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"500Mi"` Cpu string `default:"200m"` } Request struct { Mem string `default:"200Mi"` Cpu string `default:"50m"` } } ConfigReloaderCPU string `default:"100m"` ConfigReloaderMemory string `default:"25Mi"` } VMSingleDefault struct { Image string `default:"victoriametrics/victoria-metrics"` Version string `default:"v1.106.1"` // ignored ConfigReloadImage string `ignored:"true"` Port string `default:"8429"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"1500Mi"` Cpu string `default:"1200m"` } Request struct { Mem string `default:"500Mi"` Cpu string `default:"150m"` } } // ignored ConfigReloaderCPU string `ignored:"true"` // ignored ConfigReloaderMemory string `ignored:"true"` } VMClusterDefault struct { UseDefaultResources bool `default:"true"` VMSelectDefault struct { Image string `default:"victoriametrics/vmselect"` Version string `default:"v1.106.1-cluster"` Port string `default:"8481"` Resource struct { Limit struct { Mem string `default:"1000Mi"` Cpu string `default:"500m"` } Request struct { Mem string `default:"500Mi"` Cpu string `default:"100m"` } } } VMStorageDefault struct { Image string `default:"victoriametrics/vmstorage"` Version string `default:"v1.106.1-cluster"` VMInsertPort string `default:"8400"` VMSelectPort string `default:"8401"` Port string `default:"8482"` Resource struct { Limit struct { Mem string `default:"1500Mi"` Cpu string `default:"1000m"` } Request struct { Mem string `default:"500Mi"` Cpu string `default:"250m"` } } } VMInsertDefault struct { Image string `default:"victoriametrics/vminsert"` Version string `default:"v1.106.1-cluster"` Port string `default:"8480"` Resource struct { Limit struct { Mem string `default:"500Mi"` Cpu string `default:"500m"` } Request struct { Mem string `default:"200Mi"` Cpu string `default:"150m"` } } } } VMAlertManager struct { ConfigReloaderImage string `default:"jimmidyson/configmap-reload:v0.3.0"` ConfigReloaderCPU string `default:"100m"` ConfigReloaderMemory string `default:"25Mi"` AlertmanagerDefaultBaseImage string `default:"prom/alertmanager"` AlertManagerVersion string `default:"v0.27.0"` LocalHost string `default:"127.0.0.1"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"256Mi"` Cpu string `default:"100m"` } Request struct { Mem string `default:"56Mi"` Cpu string `default:"30m"` } } } DisableSelfServiceScrapeCreation bool `default:"false"` VMBackup struct { Image string `default:"victoriametrics/vmbackupmanager"` Version string `default:"v1.106.1-enterprise"` Port string `default:"8300"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"500Mi"` Cpu string `default:"500m"` } Request struct { Mem string `default:"200Mi"` Cpu string `default:"150m"` } } } VMAuthDefault struct { Image string `default:"victoriametrics/vmauth"` Version string `default:"v1.106.1"` ConfigReloadImage string `default:"quay.io/prometheus-operator/prometheus-config-reloader:v0.68.0"` Port string `default:"8427"` UseDefaultResources bool `default:"true"` Resource struct { Limit struct { Mem string `default:"300Mi"` Cpu string `default:"200m"` } Request struct { Mem string `default:"100Mi"` Cpu string `default:"50m"` } } ConfigReloaderCPU string `default:"100m"` ConfigReloaderMemory string `default:"25Mi"` } EnabledPrometheusConverter struct { PodMonitor bool `default:"true"` ServiceScrape bool `default:"true"` PrometheusRule bool `default:"true"` Probe bool `default:"true"` AlertmanagerConfig bool `default:"true"` ScrapeConfig bool `default:"true"` } FilterChildLabelPrefixes []string `default:""` FilterChildAnnotationPrefixes []string `default:""` // adds compare-options and sync-options for prometheus objects converted by operator. // It helps to properly use converter with ArgoCD PrometheusConverterAddArgoCDIgnoreAnnotations bool `default:"false"` EnabledPrometheusConverterOwnerReferences bool `default:"false"` // allows filtering for converted labels, labels with matched prefix will be ignored FilterPrometheusConverterLabelPrefixes []string `default:""` // allows filtering for converted annotations, annotations with matched prefix will be ignored FilterPrometheusConverterAnnotationPrefixes []string `default:""` // Defines domain name suffix for in-cluster addresses // most known ClusterDomainName is .cluster.local ClusterDomainName string `default:""` // Defines deadline for deploymnet/statefulset // to transit into ready state // to wait for transition to ready state AppReadyTimeout time.Duration `default:"80s"` // Defines single pod deadline // to wait for transition to ready state PodWaitReadyTimeout time.Duration `default:"80s"` // Defines poll interval for pods ready check // at statefulset rollout update PodWaitReadyIntervalCheck time.Duration `default:"5s"` // configures force resync interval for VMAgent, VMAlert, VMAlertmanager and VMAuth. ForceResyncInterval time.Duration `default:"60s"` // EnableStrictSecurity will add default `securityContext` to pods and containers created by operator // Default PodSecurityContext include: // 1. RunAsNonRoot: true // 2. RunAsUser/RunAsGroup/FSGroup: 65534 // '65534' refers to 'nobody' in all the used default images like alpine, busybox. // If you're using customize image, please make sure '65534' is a valid uid in there or specify SecurityContext. // 3. FSGroupChangePolicy: &onRootMismatch // If KubeVersion>=1.20, use `FSGroupChangePolicy="onRootMismatch"` to skip the recursive permission change // when the root of the volume already has the correct permissions // 4. SeccompProfile: // type: RuntimeDefault // Use `RuntimeDefault` seccomp profile by default, which is defined by the container runtime, // instead of using the Unconfined (seccomp disabled) mode. // // Default container SecurityContext include: // 1. AllowPrivilegeEscalation: false // 2. ReadOnlyRootFilesystem: true // 3. Capabilities: // drop: // - all // turn off `EnableStrictSecurity` by default, see https://github.com/VictoriaMetrics/operator/issues/749 for details EnableStrictSecurity bool `default:"false"` // contains filtered or unexported fields }
func MustGetBaseConfig ¶
func MustGetBaseConfig() *BaseOperatorConf
MustGetBaseConfig returns operator configuration with default values populated from env variables
func (*BaseOperatorConf) CustomConfigReloaderImageVersion ¶ added in v0.43.0
func (boc *BaseOperatorConf) CustomConfigReloaderImageVersion() *version.Version
CustomConfigReloaderImageVersion returns version of custom config-reloader
func (BaseOperatorConf) PrintDefaults ¶ added in v0.38.0
func (boc BaseOperatorConf) PrintDefaults(format string) error
PrintDefaults prints default values for all config variables. format can be one of: table, list, json, yaml.
func (*BaseOperatorConf) ResyncAfterDuration ¶ added in v0.48.0
func (boc *BaseOperatorConf) ResyncAfterDuration() time.Duration
ResyncAfterDuration returns requeue duration for object period reconcile adds 10% jitter
func (BaseOperatorConf) Validate ¶ added in v0.10.0
func (boc BaseOperatorConf) Validate() error
Validate - validates config on best effort.