Class PrometheusSpec

  • All Implemented Interfaces:
    io.fabric8.kubernetes.api.builder.Editable<PrometheusSpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource, Serializable

    @Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator")
    public class PrometheusSpec
    extends Object
    implements io.fabric8.kubernetes.api.builder.Editable<PrometheusSpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
    PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PrometheusSpec()
      No args constructor for use in serialization
      PrometheusSpec​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertManagerConfigs, io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertRelabelConfigs, List<Argument> additionalArgs, io.fabric8.kubernetes.api.model.SecretKeySelector additionalScrapeConfigs, io.fabric8.kubernetes.api.model.Affinity affinity, AlertingSpec alerting, Boolean allowOverlappingBlocks, APIServerConfig apiserverConfig, ArbitraryFSAccessThroughSMsConfig arbitraryFSAccessThroughSMs, Boolean automountServiceAccountToken, String baseImage, String bodySizeLimit, List<String> configMaps, List<io.fabric8.kubernetes.api.model.Container> containers, Boolean disableCompaction, PodDNSConfig dnsConfig, String dnsPolicy, Boolean enableAdminAPI, List<String> enableFeatures, Boolean enableOTLPReceiver, Boolean enableRemoteWriteReceiver, String enforcedBodySizeLimit, Long enforcedKeepDroppedTargets, Long enforcedLabelLimit, Long enforcedLabelNameLengthLimit, Long enforcedLabelValueLengthLimit, String enforcedNamespaceLabel, Long enforcedSampleLimit, Long enforcedTargetLimit, String evaluationInterval, List<ObjectReference> excludedFromEnforcement, Exemplars exemplars, Map<String,​String> externalLabels, String externalUrl, List<HostAlias> hostAliases, Boolean hostNetwork, Boolean ignoreNamespaceSelectors, String image, String imagePullPolicy, List<io.fabric8.kubernetes.api.model.LocalObjectReference> imagePullSecrets, List<io.fabric8.kubernetes.api.model.Container> initContainers, Long keepDroppedTargets, Long labelLimit, Long labelNameLengthLimit, Long labelValueLengthLimit, Boolean listenLocal, String logFormat, String logLevel, Integer maximumStartupDurationSeconds, Long minReadySeconds, String nameValidationScheme, Map<String,​String> nodeSelector, OTLPConfig otlp, Boolean overrideHonorLabels, Boolean overrideHonorTimestamps, Boolean paused, io.fabric8.kubernetes.api.model.apps.StatefulSetPersistentVolumeClaimRetentionPolicy persistentVolumeClaimRetentionPolicy, EmbeddedObjectMetadata podMetadata, io.fabric8.kubernetes.api.model.LabelSelector podMonitorNamespaceSelector, io.fabric8.kubernetes.api.model.LabelSelector podMonitorSelector, List<String> podTargetLabels, String portName, String priorityClassName, io.fabric8.kubernetes.api.model.LabelSelector probeNamespaceSelector, io.fabric8.kubernetes.api.model.LabelSelector probeSelector, String prometheusExternalLabelName, List<PrometheusRuleExcludeConfig> prometheusRulesExcludedFromEnforce, QuerySpec query, String queryLogFile, String reloadStrategy, List<RemoteReadSpec> remoteRead, List<RemoteWriteSpec> remoteWrite, List<String> remoteWriteReceiverMessageVersions, String replicaExternalLabelName, Integer replicas, io.fabric8.kubernetes.api.model.ResourceRequirements resources, String retention, String retentionSize, String routePrefix, io.fabric8.kubernetes.api.model.LabelSelector ruleNamespaceSelector, String ruleQueryOffset, io.fabric8.kubernetes.api.model.LabelSelector ruleSelector, Rules rules, RuntimeConfig runtime, Long sampleLimit, List<ScrapeClass> scrapeClasses, io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigNamespaceSelector, io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigSelector, String scrapeInterval, List<String> scrapeProtocols, String scrapeTimeout, List<String> secrets, io.fabric8.kubernetes.api.model.PodSecurityContext securityContext, String serviceAccountName, String serviceDiscoveryRole, io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorNamespaceSelector, io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorSelector, String sha, Integer shards, StorageSpec storage, String tag, Long targetLimit, ThanosSpec thanos, List<io.fabric8.kubernetes.api.model.Toleration> tolerations, List<TopologySpreadConstraint> topologySpreadConstraints, PrometheusTracingConfig tracingConfig, TSDBSpec tsdb, String version, List<io.fabric8.kubernetes.api.model.VolumeMount> volumeMounts, List<io.fabric8.kubernetes.api.model.Volume> volumes, Boolean walCompression, PrometheusWebSpec web)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PrometheusSpecBuilder edit()  
      io.fabric8.kubernetes.api.model.SecretKeySelector getAdditionalAlertManagerConfigs()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.SecretKeySelector getAdditionalAlertRelabelConfigs()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      List<Argument> getAdditionalArgs()
      AdditionalArgs allows setting additional arguments for the 'prometheus' container.
      Map<String,​Object> getAdditionalProperties()  
      io.fabric8.kubernetes.api.model.SecretKeySelector getAdditionalScrapeConfigs()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.Affinity getAffinity()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      AlertingSpec getAlerting()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      Boolean getAllowOverlappingBlocks()
      AllowOverlappingBlocks enables vertical compaction and vertical query merge in Prometheus.
      APIServerConfig getApiserverConfig()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      ArbitraryFSAccessThroughSMsConfig getArbitraryFSAccessThroughSMs()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      Boolean getAutomountServiceAccountToken()
      AutomountServiceAccountToken indicates whether a service account token should be automatically mounted in the pod.
      String getBaseImage()
      Deprecated: use 'spec.image' instead.
      String getBodySizeLimit()
      BodySizeLimit defines per-scrape on response body size.
      List<String> getConfigMaps()
      ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods.
      List<io.fabric8.kubernetes.api.model.Container> getContainers()
      Containers allows injecting additional containers or modifying operator generated containers.
      Boolean getDisableCompaction()
      When true, the Prometheus compaction is disabled.
      PodDNSConfig getDnsConfig()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getDnsPolicy()
      Defines the DNS policy for the pods.
      Boolean getEnableAdminAPI()
      Enables access to the Prometheus web admin API.
      List<String> getEnableFeatures()
      Enable access to Prometheus feature flags.
      Boolean getEnableOTLPReceiver()
      Enable Prometheus to be used as a receiver for the OTLP Metrics protocol.
      Boolean getEnableRemoteWriteReceiver()
      Enable Prometheus to be used as a receiver for the Prometheus remote write protocol.
      String getEnforcedBodySizeLimit()
      When defined, enforcedBodySizeLimit specifies a global limit on the size of uncompressed response body that will be accepted by Prometheus.
      Long getEnforcedKeepDroppedTargets()
      When defined, enforcedKeepDroppedTargets specifies a global limit on the number of targets dropped by relabeling that will be kept in memory.
      Long getEnforcedLabelLimit()
      When defined, enforcedLabelLimit specifies a global limit on the number of labels per sample.
      Long getEnforcedLabelNameLengthLimit()
      When defined, enforcedLabelNameLengthLimit specifies a global limit on the length of labels name per sample.
      Long getEnforcedLabelValueLengthLimit()
      When not null, enforcedLabelValueLengthLimit defines a global limit on the length of labels value per sample.
      String getEnforcedNamespaceLabel()
      When not empty, a label will be added to:
      Long getEnforcedSampleLimit()
      When defined, enforcedSampleLimit specifies a global limit on the number of scraped samples that will be accepted.
      Long getEnforcedTargetLimit()
      When defined, enforcedTargetLimit specifies a global limit on the number of scraped targets.
      String getEvaluationInterval()
      Interval between rule evaluations.
      List<ObjectReference> getExcludedFromEnforcement()
      List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects to be excluded from enforcing a namespace label of origin.
      Exemplars getExemplars()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      Map<String,​String> getExternalLabels()
      The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager).
      String getExternalUrl()
      The external URL under which the Prometheus service is externally available.
      List<HostAlias> getHostAliases()
      Optional list of hosts and IPs that will be injected into the Pod's hosts file if specified.
      Boolean getHostNetwork()
      Use the host's network namespace if true.
      Boolean getIgnoreNamespaceSelectors()
      When true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor and Probe objects will be ignored.
      String getImage()
      Container image name for Prometheus.
      String getImagePullPolicy()
      Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers.
      List<io.fabric8.kubernetes.api.model.LocalObjectReference> getImagePullSecrets()
      An optional list of references to Secrets in the same namespace to use for pulling images from registries.
      List<io.fabric8.kubernetes.api.model.Container> getInitContainers()
      InitContainers allows injecting initContainers to the Pod definition.
      Long getKeepDroppedTargets()
      Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit.
      Long getLabelLimit()
      Per-scrape limit on number of labels that will be accepted for a sample.
      Long getLabelNameLengthLimit()
      Per-scrape limit on length of labels name that will be accepted for a sample.
      Long getLabelValueLengthLimit()
      Per-scrape limit on length of labels value that will be accepted for a sample.
      Boolean getListenLocal()
      When true, the Prometheus server listens on the loopback address instead of the Pod IP's address.
      String getLogFormat()
      Log format for Log level for Prometheus and the config-reloader sidecar.
      String getLogLevel()
      Log level for Prometheus and the config-reloader sidecar.
      Integer getMaximumStartupDurationSeconds()
      Defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed.
      Long getMinReadySeconds()
      Minimum number of seconds for which a newly created Pod should be ready without any of its container crashing for it to be considered available.
      String getNameValidationScheme()
      Specifies the validation scheme for metric and label names.
      Map<String,​String> getNodeSelector()
      Defines on which Nodes the Pods are scheduled.
      OTLPConfig getOtlp()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      Boolean getOverrideHonorLabels()
      When true, Prometheus resolves label conflicts by renaming the labels in the scraped data
      Boolean getOverrideHonorTimestamps()
      When true, Prometheus ignores the timestamps for all the targets created from service and pod monitors.
      Boolean getPaused()
      When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects.
      io.fabric8.kubernetes.api.model.apps.StatefulSetPersistentVolumeClaimRetentionPolicy getPersistentVolumeClaimRetentionPolicy()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      EmbeddedObjectMetadata getPodMetadata()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.LabelSelector getPodMonitorNamespaceSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.LabelSelector getPodMonitorSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      List<String> getPodTargetLabels()
      PodTargetLabels are appended to the `spec.podTargetLabels` field of all PodMonitor and ServiceMonitor objects.
      String getPortName()
      Port name used for the pods and governing service.
      String getPriorityClassName()
      Priority class assigned to the Pods.
      io.fabric8.kubernetes.api.model.LabelSelector getProbeNamespaceSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.LabelSelector getProbeSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getPrometheusExternalLabelName()
      Name of Prometheus external label used to denote the Prometheus instance name.
      List<PrometheusRuleExcludeConfig> getPrometheusRulesExcludedFromEnforce()
      Defines the list of PrometheusRule objects to which the namespace label enforcement doesn't apply.
      QuerySpec getQuery()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getQueryLogFile()
      queryLogFile specifies where the file to which PromQL queries are logged.
      String getReloadStrategy()
      Defines the strategy used to reload the Prometheus configuration.
      List<RemoteReadSpec> getRemoteRead()
      Defines the list of remote read configurations.
      List<RemoteWriteSpec> getRemoteWrite()
      Defines the list of remote write configurations.
      List<String> getRemoteWriteReceiverMessageVersions()
      List of the protobuf message versions to accept when receiving the remote writes.
      String getReplicaExternalLabelName()
      Name of Prometheus external label used to denote the replica name.
      Integer getReplicas()
      Number of replicas of each shard to deploy for a Prometheus deployment.
      io.fabric8.kubernetes.api.model.ResourceRequirements getResources()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getRetention()
      How long to retain the Prometheus data.
      String getRetentionSize()
      Maximum number of bytes used by the Prometheus data.
      String getRoutePrefix()
      The route prefix Prometheus registers HTTP handlers for.
      io.fabric8.kubernetes.api.model.LabelSelector getRuleNamespaceSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getRuleQueryOffset()
      Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past.
      Rules getRules()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.LabelSelector getRuleSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      RuntimeConfig getRuntime()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      Long getSampleLimit()
      SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
      List<ScrapeClass> getScrapeClasses()
      List of scrape classes to expose to scraping objects such as PodMonitors, ServiceMonitors, Probes and ScrapeConfigs.
      io.fabric8.kubernetes.api.model.LabelSelector getScrapeConfigNamespaceSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.LabelSelector getScrapeConfigSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getScrapeInterval()
      Interval between consecutive scrapes.
      List<String> getScrapeProtocols()
      The protocols to negotiate during a scrape.
      String getScrapeTimeout()
      Number of seconds to wait until a scrape request times out.
      List<String> getSecrets()
      Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods.
      io.fabric8.kubernetes.api.model.PodSecurityContext getSecurityContext()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getServiceAccountName()
      ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods.
      String getServiceDiscoveryRole()
      Defines the service discovery role used to discover targets from `ServiceMonitor` objects and Alertmanager endpoints.
      io.fabric8.kubernetes.api.model.LabelSelector getServiceMonitorNamespaceSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      io.fabric8.kubernetes.api.model.LabelSelector getServiceMonitorSelector()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getSha()
      Deprecated: use 'spec.image' instead.
      Integer getShards()
      Number of shards to distribute scraped targets onto.
      StorageSpec getStorage()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getTag()
      Deprecated: use 'spec.image' instead.
      Long getTargetLimit()
      TargetLimit defines a limit on the number of scraped targets that will be accepted.
      ThanosSpec getThanos()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      List<io.fabric8.kubernetes.api.model.Toleration> getTolerations()
      Defines the Pods' tolerations if specified.
      List<TopologySpreadConstraint> getTopologySpreadConstraints()
      Defines the pod's topology spread constraints if specified.
      PrometheusTracingConfig getTracingConfig()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      TSDBSpec getTsdb()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      String getVersion()
      Version of Prometheus being deployed.
      List<io.fabric8.kubernetes.api.model.VolumeMount> getVolumeMounts()
      VolumeMounts allows the configuration of additional VolumeMounts.
      List<io.fabric8.kubernetes.api.model.Volume> getVolumes()
      Volumes allows the configuration of additional volumes on the output StatefulSet definition.
      Boolean getWalCompression()
      Configures compression of the write-ahead log (WAL) using Snappy.
      PrometheusWebSpec getWeb()
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAdditionalAlertManagerConfigs​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertManagerConfigs)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAdditionalAlertRelabelConfigs​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertRelabelConfigs)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAdditionalArgs​(List<Argument> additionalArgs)
      AdditionalArgs allows setting additional arguments for the 'prometheus' container.
      void setAdditionalProperties​(Map<String,​Object> additionalProperties)  
      void setAdditionalProperty​(String name, Object value)  
      void setAdditionalScrapeConfigs​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalScrapeConfigs)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAffinity​(io.fabric8.kubernetes.api.model.Affinity affinity)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAlerting​(AlertingSpec alerting)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAllowOverlappingBlocks​(Boolean allowOverlappingBlocks)
      AllowOverlappingBlocks enables vertical compaction and vertical query merge in Prometheus.
      void setApiserverConfig​(APIServerConfig apiserverConfig)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setArbitraryFSAccessThroughSMs​(ArbitraryFSAccessThroughSMsConfig arbitraryFSAccessThroughSMs)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setAutomountServiceAccountToken​(Boolean automountServiceAccountToken)
      AutomountServiceAccountToken indicates whether a service account token should be automatically mounted in the pod.
      void setBaseImage​(String baseImage)
      Deprecated: use 'spec.image' instead.
      void setBodySizeLimit​(String bodySizeLimit)
      BodySizeLimit defines per-scrape on response body size.
      void setConfigMaps​(List<String> configMaps)
      ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods.
      void setContainers​(List<io.fabric8.kubernetes.api.model.Container> containers)
      Containers allows injecting additional containers or modifying operator generated containers.
      void setDisableCompaction​(Boolean disableCompaction)
      When true, the Prometheus compaction is disabled.
      void setDnsConfig​(PodDNSConfig dnsConfig)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setDnsPolicy​(String dnsPolicy)
      Defines the DNS policy for the pods.
      void setEnableAdminAPI​(Boolean enableAdminAPI)
      Enables access to the Prometheus web admin API.
      void setEnableFeatures​(List<String> enableFeatures)
      Enable access to Prometheus feature flags.
      void setEnableOTLPReceiver​(Boolean enableOTLPReceiver)
      Enable Prometheus to be used as a receiver for the OTLP Metrics protocol.
      void setEnableRemoteWriteReceiver​(Boolean enableRemoteWriteReceiver)
      Enable Prometheus to be used as a receiver for the Prometheus remote write protocol.
      void setEnforcedBodySizeLimit​(String enforcedBodySizeLimit)
      When defined, enforcedBodySizeLimit specifies a global limit on the size of uncompressed response body that will be accepted by Prometheus.
      void setEnforcedKeepDroppedTargets​(Long enforcedKeepDroppedTargets)
      When defined, enforcedKeepDroppedTargets specifies a global limit on the number of targets dropped by relabeling that will be kept in memory.
      void setEnforcedLabelLimit​(Long enforcedLabelLimit)
      When defined, enforcedLabelLimit specifies a global limit on the number of labels per sample.
      void setEnforcedLabelNameLengthLimit​(Long enforcedLabelNameLengthLimit)
      When defined, enforcedLabelNameLengthLimit specifies a global limit on the length of labels name per sample.
      void setEnforcedLabelValueLengthLimit​(Long enforcedLabelValueLengthLimit)
      When not null, enforcedLabelValueLengthLimit defines a global limit on the length of labels value per sample.
      void setEnforcedNamespaceLabel​(String enforcedNamespaceLabel)
      When not empty, a label will be added to:
      void setEnforcedSampleLimit​(Long enforcedSampleLimit)
      When defined, enforcedSampleLimit specifies a global limit on the number of scraped samples that will be accepted.
      void setEnforcedTargetLimit​(Long enforcedTargetLimit)
      When defined, enforcedTargetLimit specifies a global limit on the number of scraped targets.
      void setEvaluationInterval​(String evaluationInterval)
      Interval between rule evaluations.
      void setExcludedFromEnforcement​(List<ObjectReference> excludedFromEnforcement)
      List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects to be excluded from enforcing a namespace label of origin.
      void setExemplars​(Exemplars exemplars)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setExternalLabels​(Map<String,​String> externalLabels)
      The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager).
      void setExternalUrl​(String externalUrl)
      The external URL under which the Prometheus service is externally available.
      void setHostAliases​(List<HostAlias> hostAliases)
      Optional list of hosts and IPs that will be injected into the Pod's hosts file if specified.
      void setHostNetwork​(Boolean hostNetwork)
      Use the host's network namespace if true.
      void setIgnoreNamespaceSelectors​(Boolean ignoreNamespaceSelectors)
      When true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor and Probe objects will be ignored.
      void setImage​(String image)
      Container image name for Prometheus.
      void setImagePullPolicy​(String imagePullPolicy)
      Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers.
      void setImagePullSecrets​(List<io.fabric8.kubernetes.api.model.LocalObjectReference> imagePullSecrets)
      An optional list of references to Secrets in the same namespace to use for pulling images from registries.
      void setInitContainers​(List<io.fabric8.kubernetes.api.model.Container> initContainers)
      InitContainers allows injecting initContainers to the Pod definition.
      void setKeepDroppedTargets​(Long keepDroppedTargets)
      Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit.
      void setLabelLimit​(Long labelLimit)
      Per-scrape limit on number of labels that will be accepted for a sample.
      void setLabelNameLengthLimit​(Long labelNameLengthLimit)
      Per-scrape limit on length of labels name that will be accepted for a sample.
      void setLabelValueLengthLimit​(Long labelValueLengthLimit)
      Per-scrape limit on length of labels value that will be accepted for a sample.
      void setListenLocal​(Boolean listenLocal)
      When true, the Prometheus server listens on the loopback address instead of the Pod IP's address.
      void setLogFormat​(String logFormat)
      Log format for Log level for Prometheus and the config-reloader sidecar.
      void setLogLevel​(String logLevel)
      Log level for Prometheus and the config-reloader sidecar.
      void setMaximumStartupDurationSeconds​(Integer maximumStartupDurationSeconds)
      Defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed.
      void setMinReadySeconds​(Long minReadySeconds)
      Minimum number of seconds for which a newly created Pod should be ready without any of its container crashing for it to be considered available.
      void setNameValidationScheme​(String nameValidationScheme)
      Specifies the validation scheme for metric and label names.
      void setNodeSelector​(Map<String,​String> nodeSelector)
      Defines on which Nodes the Pods are scheduled.
      void setOtlp​(OTLPConfig otlp)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setOverrideHonorLabels​(Boolean overrideHonorLabels)
      When true, Prometheus resolves label conflicts by renaming the labels in the scraped data
      void setOverrideHonorTimestamps​(Boolean overrideHonorTimestamps)
      When true, Prometheus ignores the timestamps for all the targets created from service and pod monitors.
      void setPaused​(Boolean paused)
      When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects.
      void setPersistentVolumeClaimRetentionPolicy​(io.fabric8.kubernetes.api.model.apps.StatefulSetPersistentVolumeClaimRetentionPolicy persistentVolumeClaimRetentionPolicy)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setPodMetadata​(EmbeddedObjectMetadata podMetadata)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setPodMonitorNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector podMonitorNamespaceSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setPodMonitorSelector​(io.fabric8.kubernetes.api.model.LabelSelector podMonitorSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setPodTargetLabels​(List<String> podTargetLabels)
      PodTargetLabels are appended to the `spec.podTargetLabels` field of all PodMonitor and ServiceMonitor objects.
      void setPortName​(String portName)
      Port name used for the pods and governing service.
      void setPriorityClassName​(String priorityClassName)
      Priority class assigned to the Pods.
      void setProbeNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector probeNamespaceSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setProbeSelector​(io.fabric8.kubernetes.api.model.LabelSelector probeSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setPrometheusExternalLabelName​(String prometheusExternalLabelName)
      Name of Prometheus external label used to denote the Prometheus instance name.
      void setPrometheusRulesExcludedFromEnforce​(List<PrometheusRuleExcludeConfig> prometheusRulesExcludedFromEnforce)
      Defines the list of PrometheusRule objects to which the namespace label enforcement doesn't apply.
      void setQuery​(QuerySpec query)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setQueryLogFile​(String queryLogFile)
      queryLogFile specifies where the file to which PromQL queries are logged.
      void setReloadStrategy​(String reloadStrategy)
      Defines the strategy used to reload the Prometheus configuration.
      void setRemoteRead​(List<RemoteReadSpec> remoteRead)
      Defines the list of remote read configurations.
      void setRemoteWrite​(List<RemoteWriteSpec> remoteWrite)
      Defines the list of remote write configurations.
      void setRemoteWriteReceiverMessageVersions​(List<String> remoteWriteReceiverMessageVersions)
      List of the protobuf message versions to accept when receiving the remote writes.
      void setReplicaExternalLabelName​(String replicaExternalLabelName)
      Name of Prometheus external label used to denote the replica name.
      void setReplicas​(Integer replicas)
      Number of replicas of each shard to deploy for a Prometheus deployment.
      void setResources​(io.fabric8.kubernetes.api.model.ResourceRequirements resources)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setRetention​(String retention)
      How long to retain the Prometheus data.
      void setRetentionSize​(String retentionSize)
      Maximum number of bytes used by the Prometheus data.
      void setRoutePrefix​(String routePrefix)
      The route prefix Prometheus registers HTTP handlers for.
      void setRuleNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector ruleNamespaceSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setRuleQueryOffset​(String ruleQueryOffset)
      Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past.
      void setRules​(Rules rules)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setRuleSelector​(io.fabric8.kubernetes.api.model.LabelSelector ruleSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setRuntime​(RuntimeConfig runtime)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setSampleLimit​(Long sampleLimit)
      SampleLimit defines per-scrape limit on number of scraped samples that will be accepted.
      void setScrapeClasses​(List<ScrapeClass> scrapeClasses)
      List of scrape classes to expose to scraping objects such as PodMonitors, ServiceMonitors, Probes and ScrapeConfigs.
      void setScrapeConfigNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigNamespaceSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setScrapeConfigSelector​(io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setScrapeInterval​(String scrapeInterval)
      Interval between consecutive scrapes.
      void setScrapeProtocols​(List<String> scrapeProtocols)
      The protocols to negotiate during a scrape.
      void setScrapeTimeout​(String scrapeTimeout)
      Number of seconds to wait until a scrape request times out.
      void setSecrets​(List<String> secrets)
      Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods.
      void setSecurityContext​(io.fabric8.kubernetes.api.model.PodSecurityContext securityContext)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setServiceAccountName​(String serviceAccountName)
      ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods.
      void setServiceDiscoveryRole​(String serviceDiscoveryRole)
      Defines the service discovery role used to discover targets from `ServiceMonitor` objects and Alertmanager endpoints.
      void setServiceMonitorNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorNamespaceSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setServiceMonitorSelector​(io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorSelector)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setSha​(String sha)
      Deprecated: use 'spec.image' instead.
      void setShards​(Integer shards)
      Number of shards to distribute scraped targets onto.
      void setStorage​(StorageSpec storage)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setTag​(String tag)
      Deprecated: use 'spec.image' instead.
      void setTargetLimit​(Long targetLimit)
      TargetLimit defines a limit on the number of scraped targets that will be accepted.
      void setThanos​(ThanosSpec thanos)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setTolerations​(List<io.fabric8.kubernetes.api.model.Toleration> tolerations)
      Defines the Pods' tolerations if specified.
      void setTopologySpreadConstraints​(List<TopologySpreadConstraint> topologySpreadConstraints)
      Defines the pod's topology spread constraints if specified.
      void setTracingConfig​(PrometheusTracingConfig tracingConfig)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setTsdb​(TSDBSpec tsdb)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      void setVersion​(String version)
      Version of Prometheus being deployed.
      void setVolumeMounts​(List<io.fabric8.kubernetes.api.model.VolumeMount> volumeMounts)
      VolumeMounts allows the configuration of additional VolumeMounts.
      void setVolumes​(List<io.fabric8.kubernetes.api.model.Volume> volumes)
      Volumes allows the configuration of additional volumes on the output StatefulSet definition.
      void setWalCompression​(Boolean walCompression)
      Configures compression of the write-ahead log (WAL) using Snappy.
      void setWeb​(PrometheusWebSpec web)
      PrometheusSpec is a specification of the desired behavior of the Prometheus cluster.
      PrometheusSpecBuilder toBuilder()  
    • Constructor Detail

      • PrometheusSpec

        public PrometheusSpec()
        No args constructor for use in serialization
      • PrometheusSpec

        public PrometheusSpec​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertManagerConfigs,
                              io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertRelabelConfigs,
                              List<Argument> additionalArgs,
                              io.fabric8.kubernetes.api.model.SecretKeySelector additionalScrapeConfigs,
                              io.fabric8.kubernetes.api.model.Affinity affinity,
                              AlertingSpec alerting,
                              Boolean allowOverlappingBlocks,
                              APIServerConfig apiserverConfig,
                              ArbitraryFSAccessThroughSMsConfig arbitraryFSAccessThroughSMs,
                              Boolean automountServiceAccountToken,
                              String baseImage,
                              String bodySizeLimit,
                              List<String> configMaps,
                              List<io.fabric8.kubernetes.api.model.Container> containers,
                              Boolean disableCompaction,
                              PodDNSConfig dnsConfig,
                              String dnsPolicy,
                              Boolean enableAdminAPI,
                              List<String> enableFeatures,
                              Boolean enableOTLPReceiver,
                              Boolean enableRemoteWriteReceiver,
                              String enforcedBodySizeLimit,
                              Long enforcedKeepDroppedTargets,
                              Long enforcedLabelLimit,
                              Long enforcedLabelNameLengthLimit,
                              Long enforcedLabelValueLengthLimit,
                              String enforcedNamespaceLabel,
                              Long enforcedSampleLimit,
                              Long enforcedTargetLimit,
                              String evaluationInterval,
                              List<ObjectReference> excludedFromEnforcement,
                              Exemplars exemplars,
                              Map<String,​String> externalLabels,
                              String externalUrl,
                              List<HostAlias> hostAliases,
                              Boolean hostNetwork,
                              Boolean ignoreNamespaceSelectors,
                              String image,
                              String imagePullPolicy,
                              List<io.fabric8.kubernetes.api.model.LocalObjectReference> imagePullSecrets,
                              List<io.fabric8.kubernetes.api.model.Container> initContainers,
                              Long keepDroppedTargets,
                              Long labelLimit,
                              Long labelNameLengthLimit,
                              Long labelValueLengthLimit,
                              Boolean listenLocal,
                              String logFormat,
                              String logLevel,
                              Integer maximumStartupDurationSeconds,
                              Long minReadySeconds,
                              String nameValidationScheme,
                              Map<String,​String> nodeSelector,
                              OTLPConfig otlp,
                              Boolean overrideHonorLabels,
                              Boolean overrideHonorTimestamps,
                              Boolean paused,
                              io.fabric8.kubernetes.api.model.apps.StatefulSetPersistentVolumeClaimRetentionPolicy persistentVolumeClaimRetentionPolicy,
                              EmbeddedObjectMetadata podMetadata,
                              io.fabric8.kubernetes.api.model.LabelSelector podMonitorNamespaceSelector,
                              io.fabric8.kubernetes.api.model.LabelSelector podMonitorSelector,
                              List<String> podTargetLabels,
                              String portName,
                              String priorityClassName,
                              io.fabric8.kubernetes.api.model.LabelSelector probeNamespaceSelector,
                              io.fabric8.kubernetes.api.model.LabelSelector probeSelector,
                              String prometheusExternalLabelName,
                              List<PrometheusRuleExcludeConfig> prometheusRulesExcludedFromEnforce,
                              QuerySpec query,
                              String queryLogFile,
                              String reloadStrategy,
                              List<RemoteReadSpec> remoteRead,
                              List<RemoteWriteSpec> remoteWrite,
                              List<String> remoteWriteReceiverMessageVersions,
                              String replicaExternalLabelName,
                              Integer replicas,
                              io.fabric8.kubernetes.api.model.ResourceRequirements resources,
                              String retention,
                              String retentionSize,
                              String routePrefix,
                              io.fabric8.kubernetes.api.model.LabelSelector ruleNamespaceSelector,
                              String ruleQueryOffset,
                              io.fabric8.kubernetes.api.model.LabelSelector ruleSelector,
                              Rules rules,
                              RuntimeConfig runtime,
                              Long sampleLimit,
                              List<ScrapeClass> scrapeClasses,
                              io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigNamespaceSelector,
                              io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigSelector,
                              String scrapeInterval,
                              List<String> scrapeProtocols,
                              String scrapeTimeout,
                              List<String> secrets,
                              io.fabric8.kubernetes.api.model.PodSecurityContext securityContext,
                              String serviceAccountName,
                              String serviceDiscoveryRole,
                              io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorNamespaceSelector,
                              io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorSelector,
                              String sha,
                              Integer shards,
                              StorageSpec storage,
                              String tag,
                              Long targetLimit,
                              ThanosSpec thanos,
                              List<io.fabric8.kubernetes.api.model.Toleration> tolerations,
                              List<TopologySpreadConstraint> topologySpreadConstraints,
                              PrometheusTracingConfig tracingConfig,
                              TSDBSpec tsdb,
                              String version,
                              List<io.fabric8.kubernetes.api.model.VolumeMount> volumeMounts,
                              List<io.fabric8.kubernetes.api.model.Volume> volumes,
                              Boolean walCompression,
                              PrometheusWebSpec web)
    • Method Detail

      • getAdditionalAlertManagerConfigs

        public io.fabric8.kubernetes.api.model.SecretKeySelector getAdditionalAlertManagerConfigs()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setAdditionalAlertManagerConfigs

        public void setAdditionalAlertManagerConfigs​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertManagerConfigs)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAdditionalAlertRelabelConfigs

        public io.fabric8.kubernetes.api.model.SecretKeySelector getAdditionalAlertRelabelConfigs()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setAdditionalAlertRelabelConfigs

        public void setAdditionalAlertRelabelConfigs​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalAlertRelabelConfigs)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAdditionalArgs

        public List<Argument> getAdditionalArgs()
        AdditionalArgs allows setting additional arguments for the 'prometheus' container.


        It is intended for e.g. activating hidden flags which are not supported by the dedicated configuration options yet. The arguments are passed as-is to the Prometheus container which may cause issues if they are invalid or not supported by the given Prometheus version.


        In case of an argument conflict (e.g. an argument which is already set by the operator itself) or when providing an invalid argument, the reconciliation will fail and an error will be logged.

      • setAdditionalArgs

        public void setAdditionalArgs​(List<Argument> additionalArgs)
        AdditionalArgs allows setting additional arguments for the 'prometheus' container.


        It is intended for e.g. activating hidden flags which are not supported by the dedicated configuration options yet. The arguments are passed as-is to the Prometheus container which may cause issues if they are invalid or not supported by the given Prometheus version.


        In case of an argument conflict (e.g. an argument which is already set by the operator itself) or when providing an invalid argument, the reconciliation will fail and an error will be logged.

      • getAdditionalScrapeConfigs

        public io.fabric8.kubernetes.api.model.SecretKeySelector getAdditionalScrapeConfigs()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setAdditionalScrapeConfigs

        public void setAdditionalScrapeConfigs​(io.fabric8.kubernetes.api.model.SecretKeySelector additionalScrapeConfigs)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAffinity

        public io.fabric8.kubernetes.api.model.Affinity getAffinity()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setAffinity

        public void setAffinity​(io.fabric8.kubernetes.api.model.Affinity affinity)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAlerting

        public AlertingSpec getAlerting()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setAlerting

        public void setAlerting​(AlertingSpec alerting)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAllowOverlappingBlocks

        public Boolean getAllowOverlappingBlocks()
        AllowOverlappingBlocks enables vertical compaction and vertical query merge in Prometheus.


        Deprecated: this flag has no effect for Prometheus >= 2.39.0 where overlapping blocks are enabled by default.

      • setAllowOverlappingBlocks

        public void setAllowOverlappingBlocks​(Boolean allowOverlappingBlocks)
        AllowOverlappingBlocks enables vertical compaction and vertical query merge in Prometheus.


        Deprecated: this flag has no effect for Prometheus >= 2.39.0 where overlapping blocks are enabled by default.

      • getApiserverConfig

        public APIServerConfig getApiserverConfig()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setApiserverConfig

        public void setApiserverConfig​(APIServerConfig apiserverConfig)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getArbitraryFSAccessThroughSMs

        public ArbitraryFSAccessThroughSMsConfig getArbitraryFSAccessThroughSMs()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setArbitraryFSAccessThroughSMs

        public void setArbitraryFSAccessThroughSMs​(ArbitraryFSAccessThroughSMsConfig arbitraryFSAccessThroughSMs)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAutomountServiceAccountToken

        public Boolean getAutomountServiceAccountToken()
        AutomountServiceAccountToken indicates whether a service account token should be automatically mounted in the pod. If the field isn't set, the operator mounts the service account token by default.


        **Warning:** be aware that by default, Prometheus requires the service account token for Kubernetes service discovery. It is possible to use strategic merge patch to project the service account token into the 'prometheus' container.

      • setAutomountServiceAccountToken

        public void setAutomountServiceAccountToken​(Boolean automountServiceAccountToken)
        AutomountServiceAccountToken indicates whether a service account token should be automatically mounted in the pod. If the field isn't set, the operator mounts the service account token by default.


        **Warning:** be aware that by default, Prometheus requires the service account token for Kubernetes service discovery. It is possible to use strategic merge patch to project the service account token into the 'prometheus' container.

      • getBaseImage

        public String getBaseImage()
        Deprecated: use 'spec.image' instead.
      • setBaseImage

        public void setBaseImage​(String baseImage)
        Deprecated: use 'spec.image' instead.
      • getBodySizeLimit

        public String getBodySizeLimit()
        BodySizeLimit defines per-scrape on response body size. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedBodySizeLimit.

      • setBodySizeLimit

        public void setBodySizeLimit​(String bodySizeLimit)
        BodySizeLimit defines per-scrape on response body size. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedBodySizeLimit.

      • getConfigMaps

        public List<String> getConfigMaps()
        ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`. The ConfigMaps are mounted into /etc/prometheus/configmaps/<configmap-name> in the 'prometheus' container.
      • setConfigMaps

        public void setConfigMaps​(List<String> configMaps)
        ConfigMaps is a list of ConfigMaps in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each ConfigMap is added to the StatefulSet definition as a volume named `configmap-<configmap-name>`. The ConfigMaps are mounted into /etc/prometheus/configmaps/<configmap-name> in the 'prometheus' container.
      • getContainers

        public List<io.fabric8.kubernetes.api.model.Container> getContainers()
        Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to the Pods or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch.


        The names of containers managed by the operator are: * `prometheus` * `config-reloader` * `thanos-sidecar`


        Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.

      • setContainers

        public void setContainers​(List<io.fabric8.kubernetes.api.model.Container> containers)
        Containers allows injecting additional containers or modifying operator generated containers. This can be used to allow adding an authentication proxy to the Pods or to change the behavior of an operator generated container. Containers described here modify an operator generated container if they share the same name and modifications are done via a strategic merge patch.


        The names of containers managed by the operator are: * `prometheus` * `config-reloader` * `thanos-sidecar`


        Overriding containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.

      • getDisableCompaction

        public Boolean getDisableCompaction()
        When true, the Prometheus compaction is disabled. When `spec.thanos.objectStorageConfig` or `spec.objectStorageConfigFile` are defined, the operator automatically disables block compaction to avoid race conditions during block uploads (as the Thanos documentation recommends).
      • setDisableCompaction

        public void setDisableCompaction​(Boolean disableCompaction)
        When true, the Prometheus compaction is disabled. When `spec.thanos.objectStorageConfig` or `spec.objectStorageConfigFile` are defined, the operator automatically disables block compaction to avoid race conditions during block uploads (as the Thanos documentation recommends).
      • getDnsConfig

        public PodDNSConfig getDnsConfig()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setDnsConfig

        public void setDnsConfig​(PodDNSConfig dnsConfig)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getDnsPolicy

        public String getDnsPolicy()
        Defines the DNS policy for the pods.
      • setDnsPolicy

        public void setDnsPolicy​(String dnsPolicy)
        Defines the DNS policy for the pods.
      • getEnableAdminAPI

        public Boolean getEnableAdminAPI()
        Enables access to the Prometheus web admin API.


        WARNING: Enabling the admin APIs enables mutating endpoints, to delete data, shutdown Prometheus, and more. Enabling this should be done with care and the user is advised to add additional authentication authorization via a proxy to ensure only clients authorized to perform these actions can do so.


        For more information: https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis

      • setEnableAdminAPI

        public void setEnableAdminAPI​(Boolean enableAdminAPI)
        Enables access to the Prometheus web admin API.


        WARNING: Enabling the admin APIs enables mutating endpoints, to delete data, shutdown Prometheus, and more. Enabling this should be done with care and the user is advised to add additional authentication authorization via a proxy to ensure only clients authorized to perform these actions can do so.


        For more information: https://prometheus.io/docs/prometheus/latest/querying/api/#tsdb-admin-apis

      • getEnableFeatures

        public List<String> getEnableFeatures()
        Enable access to Prometheus feature flags. By default, no features are enabled.


        Enabling features which are disabled by default is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.


        For more information see https://prometheus.io/docs/prometheus/latest/feature_flags/

      • setEnableFeatures

        public void setEnableFeatures​(List<String> enableFeatures)
        Enable access to Prometheus feature flags. By default, no features are enabled.


        Enabling features which are disabled by default is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.


        For more information see https://prometheus.io/docs/prometheus/latest/feature_flags/

      • getEnableOTLPReceiver

        public Boolean getEnableOTLPReceiver()
        Enable Prometheus to be used as a receiver for the OTLP Metrics protocol.


        Note that the OTLP receiver endpoint is automatically enabled if `.spec.otlpConfig` is defined.


        It requires Prometheus >= v2.47.0.

      • setEnableOTLPReceiver

        public void setEnableOTLPReceiver​(Boolean enableOTLPReceiver)
        Enable Prometheus to be used as a receiver for the OTLP Metrics protocol.


        Note that the OTLP receiver endpoint is automatically enabled if `.spec.otlpConfig` is defined.


        It requires Prometheus >= v2.47.0.

      • getEnableRemoteWriteReceiver

        public Boolean getEnableRemoteWriteReceiver()
        Enable Prometheus to be used as a receiver for the Prometheus remote write protocol.


        WARNING: This is not considered an efficient way of ingesting samples. Use it with caution for specific low-volume use cases. It is not suitable for replacing the ingestion via scraping and turning Prometheus into a push-based metrics collection system. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver


        It requires Prometheus >= v2.33.0.

      • setEnableRemoteWriteReceiver

        public void setEnableRemoteWriteReceiver​(Boolean enableRemoteWriteReceiver)
        Enable Prometheus to be used as a receiver for the Prometheus remote write protocol.


        WARNING: This is not considered an efficient way of ingesting samples. Use it with caution for specific low-volume use cases. It is not suitable for replacing the ingestion via scraping and turning Prometheus into a push-based metrics collection system. For more information see https://prometheus.io/docs/prometheus/latest/querying/api/#remote-write-receiver


        It requires Prometheus >= v2.33.0.

      • getEnforcedBodySizeLimit

        public String getEnforcedBodySizeLimit()
        When defined, enforcedBodySizeLimit specifies a global limit on the size of uncompressed response body that will be accepted by Prometheus. Targets responding with a body larger than this many bytes will cause the scrape to fail.


        It requires Prometheus >= v2.28.0.


        When both `enforcedBodySizeLimit` and `bodySizeLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined bodySizeLimit value will inherit the global bodySizeLimit value (Prometheus >= 2.45.0) or the enforcedBodySizeLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedBodySizeLimit` is greater than the `bodySizeLimit`, the `bodySizeLimit` will be set to `enforcedBodySizeLimit`.

        * Scrape objects with a bodySizeLimit value less than or equal to enforcedBodySizeLimit keep their specific value. * Scrape objects with a bodySizeLimit value greater than enforcedBodySizeLimit are set to enforcedBodySizeLimit.

      • setEnforcedBodySizeLimit

        public void setEnforcedBodySizeLimit​(String enforcedBodySizeLimit)
        When defined, enforcedBodySizeLimit specifies a global limit on the size of uncompressed response body that will be accepted by Prometheus. Targets responding with a body larger than this many bytes will cause the scrape to fail.


        It requires Prometheus >= v2.28.0.


        When both `enforcedBodySizeLimit` and `bodySizeLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined bodySizeLimit value will inherit the global bodySizeLimit value (Prometheus >= 2.45.0) or the enforcedBodySizeLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedBodySizeLimit` is greater than the `bodySizeLimit`, the `bodySizeLimit` will be set to `enforcedBodySizeLimit`.

        * Scrape objects with a bodySizeLimit value less than or equal to enforcedBodySizeLimit keep their specific value. * Scrape objects with a bodySizeLimit value greater than enforcedBodySizeLimit are set to enforcedBodySizeLimit.

      • getEnforcedKeepDroppedTargets

        public Long getEnforcedKeepDroppedTargets()
        When defined, enforcedKeepDroppedTargets specifies a global limit on the number of targets dropped by relabeling that will be kept in memory. The value overrides any `spec.keepDroppedTargets` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.keepDroppedTargets` is greater than zero and less than `spec.enforcedKeepDroppedTargets`.


        It requires Prometheus >= v2.47.0.


        When both `enforcedKeepDroppedTargets` and `keepDroppedTargets` are defined and greater than zero, the following rules apply: * Scrape objects without a defined keepDroppedTargets value will inherit the global keepDroppedTargets value (Prometheus >= 2.45.0) or the enforcedKeepDroppedTargets value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedKeepDroppedTargets` is greater than the `keepDroppedTargets`, the `keepDroppedTargets` will be set to `enforcedKeepDroppedTargets`.

        * Scrape objects with a keepDroppedTargets value less than or equal to enforcedKeepDroppedTargets keep their specific value. * Scrape objects with a keepDroppedTargets value greater than enforcedKeepDroppedTargets are set to enforcedKeepDroppedTargets.

      • setEnforcedKeepDroppedTargets

        public void setEnforcedKeepDroppedTargets​(Long enforcedKeepDroppedTargets)
        When defined, enforcedKeepDroppedTargets specifies a global limit on the number of targets dropped by relabeling that will be kept in memory. The value overrides any `spec.keepDroppedTargets` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.keepDroppedTargets` is greater than zero and less than `spec.enforcedKeepDroppedTargets`.


        It requires Prometheus >= v2.47.0.


        When both `enforcedKeepDroppedTargets` and `keepDroppedTargets` are defined and greater than zero, the following rules apply: * Scrape objects without a defined keepDroppedTargets value will inherit the global keepDroppedTargets value (Prometheus >= 2.45.0) or the enforcedKeepDroppedTargets value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedKeepDroppedTargets` is greater than the `keepDroppedTargets`, the `keepDroppedTargets` will be set to `enforcedKeepDroppedTargets`.

        * Scrape objects with a keepDroppedTargets value less than or equal to enforcedKeepDroppedTargets keep their specific value. * Scrape objects with a keepDroppedTargets value greater than enforcedKeepDroppedTargets are set to enforcedKeepDroppedTargets.

      • getEnforcedLabelLimit

        public Long getEnforcedLabelLimit()
        When defined, enforcedLabelLimit specifies a global limit on the number of labels per sample. The value overrides any `spec.labelLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.labelLimit` is greater than zero and less than `spec.enforcedLabelLimit`.


        It requires Prometheus >= v2.27.0.


        When both `enforcedLabelLimit` and `labelLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined labelLimit value will inherit the global labelLimit value (Prometheus >= 2.45.0) or the enforcedLabelLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedLabelLimit` is greater than the `labelLimit`, the `labelLimit` will be set to `enforcedLabelLimit`.

        * Scrape objects with a labelLimit value less than or equal to enforcedLabelLimit keep their specific value. * Scrape objects with a labelLimit value greater than enforcedLabelLimit are set to enforcedLabelLimit.

      • setEnforcedLabelLimit

        public void setEnforcedLabelLimit​(Long enforcedLabelLimit)
        When defined, enforcedLabelLimit specifies a global limit on the number of labels per sample. The value overrides any `spec.labelLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.labelLimit` is greater than zero and less than `spec.enforcedLabelLimit`.


        It requires Prometheus >= v2.27.0.


        When both `enforcedLabelLimit` and `labelLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined labelLimit value will inherit the global labelLimit value (Prometheus >= 2.45.0) or the enforcedLabelLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedLabelLimit` is greater than the `labelLimit`, the `labelLimit` will be set to `enforcedLabelLimit`.

        * Scrape objects with a labelLimit value less than or equal to enforcedLabelLimit keep their specific value. * Scrape objects with a labelLimit value greater than enforcedLabelLimit are set to enforcedLabelLimit.

      • getEnforcedLabelNameLengthLimit

        public Long getEnforcedLabelNameLengthLimit()
        When defined, enforcedLabelNameLengthLimit specifies a global limit on the length of labels name per sample. The value overrides any `spec.labelNameLengthLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.labelNameLengthLimit` is greater than zero and less than `spec.enforcedLabelNameLengthLimit`.


        It requires Prometheus >= v2.27.0.


        When both `enforcedLabelNameLengthLimit` and `labelNameLengthLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined labelNameLengthLimit value will inherit the global labelNameLengthLimit value (Prometheus >= 2.45.0) or the enforcedLabelNameLengthLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedLabelNameLengthLimit` is greater than the `labelNameLengthLimit`, the `labelNameLengthLimit` will be set to `enforcedLabelNameLengthLimit`.

        * Scrape objects with a labelNameLengthLimit value less than or equal to enforcedLabelNameLengthLimit keep their specific value. * Scrape objects with a labelNameLengthLimit value greater than enforcedLabelNameLengthLimit are set to enforcedLabelNameLengthLimit.

      • setEnforcedLabelNameLengthLimit

        public void setEnforcedLabelNameLengthLimit​(Long enforcedLabelNameLengthLimit)
        When defined, enforcedLabelNameLengthLimit specifies a global limit on the length of labels name per sample. The value overrides any `spec.labelNameLengthLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.labelNameLengthLimit` is greater than zero and less than `spec.enforcedLabelNameLengthLimit`.


        It requires Prometheus >= v2.27.0.


        When both `enforcedLabelNameLengthLimit` and `labelNameLengthLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined labelNameLengthLimit value will inherit the global labelNameLengthLimit value (Prometheus >= 2.45.0) or the enforcedLabelNameLengthLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedLabelNameLengthLimit` is greater than the `labelNameLengthLimit`, the `labelNameLengthLimit` will be set to `enforcedLabelNameLengthLimit`.

        * Scrape objects with a labelNameLengthLimit value less than or equal to enforcedLabelNameLengthLimit keep their specific value. * Scrape objects with a labelNameLengthLimit value greater than enforcedLabelNameLengthLimit are set to enforcedLabelNameLengthLimit.

      • getEnforcedLabelValueLengthLimit

        public Long getEnforcedLabelValueLengthLimit()
        When not null, enforcedLabelValueLengthLimit defines a global limit on the length of labels value per sample. The value overrides any `spec.labelValueLengthLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.labelValueLengthLimit` is greater than zero and less than `spec.enforcedLabelValueLengthLimit`.


        It requires Prometheus >= v2.27.0.


        When both `enforcedLabelValueLengthLimit` and `labelValueLengthLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined labelValueLengthLimit value will inherit the global labelValueLengthLimit value (Prometheus >= 2.45.0) or the enforcedLabelValueLengthLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedLabelValueLengthLimit` is greater than the `labelValueLengthLimit`, the `labelValueLengthLimit` will be set to `enforcedLabelValueLengthLimit`.

        * Scrape objects with a labelValueLengthLimit value less than or equal to enforcedLabelValueLengthLimit keep their specific value. * Scrape objects with a labelValueLengthLimit value greater than enforcedLabelValueLengthLimit are set to enforcedLabelValueLengthLimit.

      • setEnforcedLabelValueLengthLimit

        public void setEnforcedLabelValueLengthLimit​(Long enforcedLabelValueLengthLimit)
        When not null, enforcedLabelValueLengthLimit defines a global limit on the length of labels value per sample. The value overrides any `spec.labelValueLengthLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.labelValueLengthLimit` is greater than zero and less than `spec.enforcedLabelValueLengthLimit`.


        It requires Prometheus >= v2.27.0.


        When both `enforcedLabelValueLengthLimit` and `labelValueLengthLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined labelValueLengthLimit value will inherit the global labelValueLengthLimit value (Prometheus >= 2.45.0) or the enforcedLabelValueLengthLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedLabelValueLengthLimit` is greater than the `labelValueLengthLimit`, the `labelValueLengthLimit` will be set to `enforcedLabelValueLengthLimit`.

        * Scrape objects with a labelValueLengthLimit value less than or equal to enforcedLabelValueLengthLimit keep their specific value. * Scrape objects with a labelValueLengthLimit value greater than enforcedLabelValueLengthLimit are set to enforcedLabelValueLengthLimit.

      • getEnforcedNamespaceLabel

        public String getEnforcedNamespaceLabel()
        When not empty, a label will be added to:


        1. All metrics scraped from `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` objects. 2. All metrics generated from recording rules defined in `PrometheusRule` objects. 3. All alerts generated from alerting rules defined in `PrometheusRule` objects. 4. All vector selectors of PromQL expressions defined in `PrometheusRule` objects.


        The label will not added for objects referenced in `spec.excludedFromEnforcement`.


        The label's name is this field's value. The label's value is the namespace of the `ServiceMonitor`, `PodMonitor`, `Probe`, `PrometheusRule` or `ScrapeConfig` object.

      • setEnforcedNamespaceLabel

        public void setEnforcedNamespaceLabel​(String enforcedNamespaceLabel)
        When not empty, a label will be added to:


        1. All metrics scraped from `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` objects. 2. All metrics generated from recording rules defined in `PrometheusRule` objects. 3. All alerts generated from alerting rules defined in `PrometheusRule` objects. 4. All vector selectors of PromQL expressions defined in `PrometheusRule` objects.


        The label will not added for objects referenced in `spec.excludedFromEnforcement`.


        The label's name is this field's value. The label's value is the namespace of the `ServiceMonitor`, `PodMonitor`, `Probe`, `PrometheusRule` or `ScrapeConfig` object.

      • getEnforcedSampleLimit

        public Long getEnforcedSampleLimit()
        When defined, enforcedSampleLimit specifies a global limit on the number of scraped samples that will be accepted. This overrides any `spec.sampleLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.sampleLimit` is greater than zero and less than `spec.enforcedSampleLimit`.


        It is meant to be used by admins to keep the overall number of samples/series under a desired limit.


        When both `enforcedSampleLimit` and `sampleLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined sampleLimit value will inherit the global sampleLimit value (Prometheus >= 2.45.0) or the enforcedSampleLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedSampleLimit` is greater than the `sampleLimit`, the `sampleLimit` will be set to `enforcedSampleLimit`.

        * Scrape objects with a sampleLimit value less than or equal to enforcedSampleLimit keep their specific value. * Scrape objects with a sampleLimit value greater than enforcedSampleLimit are set to enforcedSampleLimit.

      • setEnforcedSampleLimit

        public void setEnforcedSampleLimit​(Long enforcedSampleLimit)
        When defined, enforcedSampleLimit specifies a global limit on the number of scraped samples that will be accepted. This overrides any `spec.sampleLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.sampleLimit` is greater than zero and less than `spec.enforcedSampleLimit`.


        It is meant to be used by admins to keep the overall number of samples/series under a desired limit.


        When both `enforcedSampleLimit` and `sampleLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined sampleLimit value will inherit the global sampleLimit value (Prometheus >= 2.45.0) or the enforcedSampleLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedSampleLimit` is greater than the `sampleLimit`, the `sampleLimit` will be set to `enforcedSampleLimit`.

        * Scrape objects with a sampleLimit value less than or equal to enforcedSampleLimit keep their specific value. * Scrape objects with a sampleLimit value greater than enforcedSampleLimit are set to enforcedSampleLimit.

      • getEnforcedTargetLimit

        public Long getEnforcedTargetLimit()
        When defined, enforcedTargetLimit specifies a global limit on the number of scraped targets. The value overrides any `spec.targetLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.targetLimit` is greater than zero and less than `spec.enforcedTargetLimit`.


        It is meant to be used by admins to to keep the overall number of targets under a desired limit.


        When both `enforcedTargetLimit` and `targetLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined targetLimit value will inherit the global targetLimit value (Prometheus >= 2.45.0) or the enforcedTargetLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedTargetLimit` is greater than the `targetLimit`, the `targetLimit` will be set to `enforcedTargetLimit`.

        * Scrape objects with a targetLimit value less than or equal to enforcedTargetLimit keep their specific value. * Scrape objects with a targetLimit value greater than enforcedTargetLimit are set to enforcedTargetLimit.

      • setEnforcedTargetLimit

        public void setEnforcedTargetLimit​(Long enforcedTargetLimit)
        When defined, enforcedTargetLimit specifies a global limit on the number of scraped targets. The value overrides any `spec.targetLimit` set by ServiceMonitor, PodMonitor, Probe objects unless `spec.targetLimit` is greater than zero and less than `spec.enforcedTargetLimit`.


        It is meant to be used by admins to to keep the overall number of targets under a desired limit.


        When both `enforcedTargetLimit` and `targetLimit` are defined and greater than zero, the following rules apply: * Scrape objects without a defined targetLimit value will inherit the global targetLimit value (Prometheus >= 2.45.0) or the enforcedTargetLimit value (Prometheus < v2.45.0).

        If Prometheus version is >= 2.45.0 and the `enforcedTargetLimit` is greater than the `targetLimit`, the `targetLimit` will be set to `enforcedTargetLimit`.

        * Scrape objects with a targetLimit value less than or equal to enforcedTargetLimit keep their specific value. * Scrape objects with a targetLimit value greater than enforcedTargetLimit are set to enforcedTargetLimit.

      • getEvaluationInterval

        public String getEvaluationInterval()
        Interval between rule evaluations. Default: "30s"
      • setEvaluationInterval

        public void setEvaluationInterval​(String evaluationInterval)
        Interval between rule evaluations. Default: "30s"
      • getExcludedFromEnforcement

        public List<ObjectReference> getExcludedFromEnforcement()
        List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects to be excluded from enforcing a namespace label of origin.


        It is only applicable if `spec.enforcedNamespaceLabel` set to true.

      • setExcludedFromEnforcement

        public void setExcludedFromEnforcement​(List<ObjectReference> excludedFromEnforcement)
        List of references to PodMonitor, ServiceMonitor, Probe and PrometheusRule objects to be excluded from enforcing a namespace label of origin.


        It is only applicable if `spec.enforcedNamespaceLabel` set to true.

      • getExemplars

        public Exemplars getExemplars()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setExemplars

        public void setExemplars​(Exemplars exemplars)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getExternalLabels

        public Map<String,​String> getExternalLabels()
        The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager). Labels defined by `spec.replicaExternalLabelName` and `spec.prometheusExternalLabelName` take precedence over this list.
      • setExternalLabels

        public void setExternalLabels​(Map<String,​String> externalLabels)
        The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager). Labels defined by `spec.replicaExternalLabelName` and `spec.prometheusExternalLabelName` take precedence over this list.
      • getExternalUrl

        public String getExternalUrl()
        The external URL under which the Prometheus service is externally available. This is necessary to generate correct URLs (for instance if Prometheus is accessible behind an Ingress resource).
      • setExternalUrl

        public void setExternalUrl​(String externalUrl)
        The external URL under which the Prometheus service is externally available. This is necessary to generate correct URLs (for instance if Prometheus is accessible behind an Ingress resource).
      • getHostAliases

        public List<HostAlias> getHostAliases()
        Optional list of hosts and IPs that will be injected into the Pod's hosts file if specified.
      • setHostAliases

        public void setHostAliases​(List<HostAlias> hostAliases)
        Optional list of hosts and IPs that will be injected into the Pod's hosts file if specified.
      • getHostNetwork

        public Boolean getHostNetwork()
        Use the host's network namespace if true.


        Make sure to understand the security implications if you want to enable it (https://kubernetes.io/docs/concepts/configuration/overview/).


        When hostNetwork is enabled, this will set the DNS policy to `ClusterFirstWithHostNet` automatically (unless `.spec.DNSPolicy` is set to a different value).

      • setHostNetwork

        public void setHostNetwork​(Boolean hostNetwork)
        Use the host's network namespace if true.


        Make sure to understand the security implications if you want to enable it (https://kubernetes.io/docs/concepts/configuration/overview/).


        When hostNetwork is enabled, this will set the DNS policy to `ClusterFirstWithHostNet` automatically (unless `.spec.DNSPolicy` is set to a different value).

      • getIgnoreNamespaceSelectors

        public Boolean getIgnoreNamespaceSelectors()
        When true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor and Probe objects will be ignored. They will only discover targets within the namespace of the PodMonitor, ServiceMonitor and Probe object.
      • setIgnoreNamespaceSelectors

        public void setIgnoreNamespaceSelectors​(Boolean ignoreNamespaceSelectors)
        When true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor and Probe objects will be ignored. They will only discover targets within the namespace of the PodMonitor, ServiceMonitor and Probe object.
      • getImage

        public String getImage()
        Container image name for Prometheus. If specified, it takes precedence over the `spec.baseImage`, `spec.tag` and `spec.sha` fields.


        Specifying `spec.version` is still necessary to ensure the Prometheus Operator knows which version of Prometheus is being configured.


        If neither `spec.image` nor `spec.baseImage` are defined, the operator will use the latest upstream version of Prometheus available at the time when the operator was released.

      • setImage

        public void setImage​(String image)
        Container image name for Prometheus. If specified, it takes precedence over the `spec.baseImage`, `spec.tag` and `spec.sha` fields.


        Specifying `spec.version` is still necessary to ensure the Prometheus Operator knows which version of Prometheus is being configured.


        If neither `spec.image` nor `spec.baseImage` are defined, the operator will use the latest upstream version of Prometheus available at the time when the operator was released.

      • getImagePullPolicy

        public String getImagePullPolicy()
        Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details.


        Possible enum values:

        - `"Always"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.

        - `"IfNotPresent"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.

        - `"Never"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present

      • setImagePullPolicy

        public void setImagePullPolicy​(String imagePullPolicy)
        Image pull policy for the 'prometheus', 'init-config-reloader' and 'config-reloader' containers. See https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy for more details.


        Possible enum values:

        - `"Always"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.

        - `"IfNotPresent"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.

        - `"Never"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present

      • getImagePullSecrets

        public List<io.fabric8.kubernetes.api.model.LocalObjectReference> getImagePullSecrets()
        An optional list of references to Secrets in the same namespace to use for pulling images from registries. See http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
      • setImagePullSecrets

        public void setImagePullSecrets​(List<io.fabric8.kubernetes.api.model.LocalObjectReference> imagePullSecrets)
        An optional list of references to Secrets in the same namespace to use for pulling images from registries. See http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod
      • getInitContainers

        public List<io.fabric8.kubernetes.api.model.Container> getInitContainers()
        InitContainers allows injecting initContainers to the Pod definition. Those can be used to e.g. fetch secrets for injection into the Prometheus configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch.


        The names of init container name managed by the operator are: * `init-config-reloader`.


        Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.

      • setInitContainers

        public void setInitContainers​(List<io.fabric8.kubernetes.api.model.Container> initContainers)
        InitContainers allows injecting initContainers to the Pod definition. Those can be used to e.g. fetch secrets for injection into the Prometheus configuration from external sources. Any errors during the execution of an initContainer will lead to a restart of the Pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ InitContainers described here modify an operator generated init containers if they share the same name and modifications are done via a strategic merge patch.


        The names of init container name managed by the operator are: * `init-config-reloader`.


        Overriding init containers is entirely outside the scope of what the maintainers will support and by doing so, you accept that this behaviour may break at any time without notice.

      • getKeepDroppedTargets

        public Long getKeepDroppedTargets()
        Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit.


        It requires Prometheus >= v2.47.0.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedKeepDroppedTargets.

      • setKeepDroppedTargets

        public void setKeepDroppedTargets​(Long keepDroppedTargets)
        Per-scrape limit on the number of targets dropped by relabeling that will be kept in memory. 0 means no limit.


        It requires Prometheus >= v2.47.0.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedKeepDroppedTargets.

      • getLabelLimit

        public Long getLabelLimit()
        Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelLimit.

      • setLabelLimit

        public void setLabelLimit​(Long labelLimit)
        Per-scrape limit on number of labels that will be accepted for a sample. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelLimit.

      • getLabelNameLengthLimit

        public Long getLabelNameLengthLimit()
        Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelNameLengthLimit.

      • setLabelNameLengthLimit

        public void setLabelNameLengthLimit​(Long labelNameLengthLimit)
        Per-scrape limit on length of labels name that will be accepted for a sample. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelNameLengthLimit.

      • getLabelValueLengthLimit

        public Long getLabelValueLengthLimit()
        Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelValueLengthLimit.

      • setLabelValueLengthLimit

        public void setLabelValueLengthLimit​(Long labelValueLengthLimit)
        Per-scrape limit on length of labels value that will be accepted for a sample. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedLabelValueLengthLimit.

      • getListenLocal

        public Boolean getListenLocal()
        When true, the Prometheus server listens on the loopback address instead of the Pod IP's address.
      • setListenLocal

        public void setListenLocal​(Boolean listenLocal)
        When true, the Prometheus server listens on the loopback address instead of the Pod IP's address.
      • getLogFormat

        public String getLogFormat()
        Log format for Log level for Prometheus and the config-reloader sidecar.
      • setLogFormat

        public void setLogFormat​(String logFormat)
        Log format for Log level for Prometheus and the config-reloader sidecar.
      • getLogLevel

        public String getLogLevel()
        Log level for Prometheus and the config-reloader sidecar.
      • setLogLevel

        public void setLogLevel​(String logLevel)
        Log level for Prometheus and the config-reloader sidecar.
      • getMaximumStartupDurationSeconds

        public Integer getMaximumStartupDurationSeconds()
        Defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed. The startup probe will return success after the WAL replay is complete. If set, the value should be greater than 60 (seconds). Otherwise it will be equal to 600 seconds (15 minutes).
      • setMaximumStartupDurationSeconds

        public void setMaximumStartupDurationSeconds​(Integer maximumStartupDurationSeconds)
        Defines the maximum time that the `prometheus` container's startup probe will wait before being considered failed. The startup probe will return success after the WAL replay is complete. If set, the value should be greater than 60 (seconds). Otherwise it will be equal to 600 seconds (15 minutes).
      • getMinReadySeconds

        public Long getMinReadySeconds()
        Minimum number of seconds for which a newly created Pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)


        This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.

      • setMinReadySeconds

        public void setMinReadySeconds​(Long minReadySeconds)
        Minimum number of seconds for which a newly created Pod should be ready without any of its container crashing for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)


        This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.

      • getNameValidationScheme

        public String getNameValidationScheme()
        Specifies the validation scheme for metric and label names.
      • setNameValidationScheme

        public void setNameValidationScheme​(String nameValidationScheme)
        Specifies the validation scheme for metric and label names.
      • getNodeSelector

        public Map<String,​String> getNodeSelector()
        Defines on which Nodes the Pods are scheduled.
      • setNodeSelector

        public void setNodeSelector​(Map<String,​String> nodeSelector)
        Defines on which Nodes the Pods are scheduled.
      • getOtlp

        public OTLPConfig getOtlp()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setOtlp

        public void setOtlp​(OTLPConfig otlp)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getOverrideHonorLabels

        public Boolean getOverrideHonorLabels()
        When true, Prometheus resolves label conflicts by renaming the labels in the scraped data

        to "exported_" for all targets created from ServiceMonitor, PodMonitor and

        ScrapeConfig objects. Otherwise the HonorLabels field of the service or pod monitor applies. In practice,`overrideHonorLaels:true` enforces `honorLabels:false` for all ServiceMonitor, PodMonitor and ScrapeConfig objects.

      • setOverrideHonorLabels

        public void setOverrideHonorLabels​(Boolean overrideHonorLabels)
        When true, Prometheus resolves label conflicts by renaming the labels in the scraped data

        to "exported_" for all targets created from ServiceMonitor, PodMonitor and

        ScrapeConfig objects. Otherwise the HonorLabels field of the service or pod monitor applies. In practice,`overrideHonorLaels:true` enforces `honorLabels:false` for all ServiceMonitor, PodMonitor and ScrapeConfig objects.

      • getOverrideHonorTimestamps

        public Boolean getOverrideHonorTimestamps()
        When true, Prometheus ignores the timestamps for all the targets created from service and pod monitors. Otherwise the HonorTimestamps field of the service or pod monitor applies.
      • setOverrideHonorTimestamps

        public void setOverrideHonorTimestamps​(Boolean overrideHonorTimestamps)
        When true, Prometheus ignores the timestamps for all the targets created from service and pod monitors. Otherwise the HonorTimestamps field of the service or pod monitor applies.
      • getPaused

        public Boolean getPaused()
        When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects.
      • setPaused

        public void setPaused​(Boolean paused)
        When a Prometheus deployment is paused, no actions except for deletion will be performed on the underlying objects.
      • getPersistentVolumeClaimRetentionPolicy

        public io.fabric8.kubernetes.api.model.apps.StatefulSetPersistentVolumeClaimRetentionPolicy getPersistentVolumeClaimRetentionPolicy()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setPersistentVolumeClaimRetentionPolicy

        public void setPersistentVolumeClaimRetentionPolicy​(io.fabric8.kubernetes.api.model.apps.StatefulSetPersistentVolumeClaimRetentionPolicy persistentVolumeClaimRetentionPolicy)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getPodMetadata

        public EmbeddedObjectMetadata getPodMetadata()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setPodMetadata

        public void setPodMetadata​(EmbeddedObjectMetadata podMetadata)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getPodMonitorNamespaceSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getPodMonitorNamespaceSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setPodMonitorNamespaceSelector

        public void setPodMonitorNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector podMonitorNamespaceSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getPodMonitorSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getPodMonitorSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setPodMonitorSelector

        public void setPodMonitorSelector​(io.fabric8.kubernetes.api.model.LabelSelector podMonitorSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getPodTargetLabels

        public List<String> getPodTargetLabels()
        PodTargetLabels are appended to the `spec.podTargetLabels` field of all PodMonitor and ServiceMonitor objects.
      • setPodTargetLabels

        public void setPodTargetLabels​(List<String> podTargetLabels)
        PodTargetLabels are appended to the `spec.podTargetLabels` field of all PodMonitor and ServiceMonitor objects.
      • getPortName

        public String getPortName()
        Port name used for the pods and governing service. Default: "web"
      • setPortName

        public void setPortName​(String portName)
        Port name used for the pods and governing service. Default: "web"
      • getPriorityClassName

        public String getPriorityClassName()
        Priority class assigned to the Pods.
      • setPriorityClassName

        public void setPriorityClassName​(String priorityClassName)
        Priority class assigned to the Pods.
      • getProbeNamespaceSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getProbeNamespaceSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setProbeNamespaceSelector

        public void setProbeNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector probeNamespaceSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getProbeSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getProbeSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setProbeSelector

        public void setProbeSelector​(io.fabric8.kubernetes.api.model.LabelSelector probeSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getPrometheusExternalLabelName

        public String getPrometheusExternalLabelName()
        Name of Prometheus external label used to denote the Prometheus instance name. The external label will _not_ be added when the field is set to the empty string (`""`).


        Default: "prometheus"

      • setPrometheusExternalLabelName

        public void setPrometheusExternalLabelName​(String prometheusExternalLabelName)
        Name of Prometheus external label used to denote the Prometheus instance name. The external label will _not_ be added when the field is set to the empty string (`""`).


        Default: "prometheus"

      • getPrometheusRulesExcludedFromEnforce

        public List<PrometheusRuleExcludeConfig> getPrometheusRulesExcludedFromEnforce()
        Defines the list of PrometheusRule objects to which the namespace label enforcement doesn't apply. This is only relevant when `spec.enforcedNamespaceLabel` is set to true. Deprecated: use `spec.excludedFromEnforcement` instead.
      • setPrometheusRulesExcludedFromEnforce

        public void setPrometheusRulesExcludedFromEnforce​(List<PrometheusRuleExcludeConfig> prometheusRulesExcludedFromEnforce)
        Defines the list of PrometheusRule objects to which the namespace label enforcement doesn't apply. This is only relevant when `spec.enforcedNamespaceLabel` is set to true. Deprecated: use `spec.excludedFromEnforcement` instead.
      • getQuery

        public QuerySpec getQuery()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setQuery

        public void setQuery​(QuerySpec query)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getQueryLogFile

        public String getQueryLogFile()
        queryLogFile specifies where the file to which PromQL queries are logged.


        If the filename has an empty path, e.g. 'query.log', The Prometheus Pods will mount the file into an emptyDir volume at `/var/log/prometheus`. If a full path is provided, e.g. '/var/log/prometheus/query.log', you must mount a volume in the specified directory and it must be writable. This is because the prometheus container runs with a read-only root filesystem for security reasons. Alternatively, the location can be set to a standard I/O stream, e.g. `/dev/stdout`, to log query information to the default Prometheus log stream.

      • setQueryLogFile

        public void setQueryLogFile​(String queryLogFile)
        queryLogFile specifies where the file to which PromQL queries are logged.


        If the filename has an empty path, e.g. 'query.log', The Prometheus Pods will mount the file into an emptyDir volume at `/var/log/prometheus`. If a full path is provided, e.g. '/var/log/prometheus/query.log', you must mount a volume in the specified directory and it must be writable. This is because the prometheus container runs with a read-only root filesystem for security reasons. Alternatively, the location can be set to a standard I/O stream, e.g. `/dev/stdout`, to log query information to the default Prometheus log stream.

      • getReloadStrategy

        public String getReloadStrategy()
        Defines the strategy used to reload the Prometheus configuration. If not specified, the configuration is reloaded using the /-/reload HTTP endpoint.
      • setReloadStrategy

        public void setReloadStrategy​(String reloadStrategy)
        Defines the strategy used to reload the Prometheus configuration. If not specified, the configuration is reloaded using the /-/reload HTTP endpoint.
      • getRemoteRead

        public List<RemoteReadSpec> getRemoteRead()
        Defines the list of remote read configurations.
      • setRemoteRead

        public void setRemoteRead​(List<RemoteReadSpec> remoteRead)
        Defines the list of remote read configurations.
      • getRemoteWrite

        public List<RemoteWriteSpec> getRemoteWrite()
        Defines the list of remote write configurations.
      • setRemoteWrite

        public void setRemoteWrite​(List<RemoteWriteSpec> remoteWrite)
        Defines the list of remote write configurations.
      • getRemoteWriteReceiverMessageVersions

        public List<String> getRemoteWriteReceiverMessageVersions()
        List of the protobuf message versions to accept when receiving the remote writes.


        It requires Prometheus >= v2.54.0.

      • setRemoteWriteReceiverMessageVersions

        public void setRemoteWriteReceiverMessageVersions​(List<String> remoteWriteReceiverMessageVersions)
        List of the protobuf message versions to accept when receiving the remote writes.


        It requires Prometheus >= v2.54.0.

      • getReplicaExternalLabelName

        public String getReplicaExternalLabelName()
        Name of Prometheus external label used to denote the replica name. The external label will _not_ be added when the field is set to the empty string (`""`).


        Default: "prometheus_replica"

      • setReplicaExternalLabelName

        public void setReplicaExternalLabelName​(String replicaExternalLabelName)
        Name of Prometheus external label used to denote the replica name. The external label will _not_ be added when the field is set to the empty string (`""`).


        Default: "prometheus_replica"

      • getReplicas

        public Integer getReplicas()
        Number of replicas of each shard to deploy for a Prometheus deployment. `spec.replicas` multiplied by `spec.shards` is the total number of Pods created.


        Default: 1

      • setReplicas

        public void setReplicas​(Integer replicas)
        Number of replicas of each shard to deploy for a Prometheus deployment. `spec.replicas` multiplied by `spec.shards` is the total number of Pods created.


        Default: 1

      • getResources

        public io.fabric8.kubernetes.api.model.ResourceRequirements getResources()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setResources

        public void setResources​(io.fabric8.kubernetes.api.model.ResourceRequirements resources)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getRetention

        public String getRetention()
        How long to retain the Prometheus data.


        Default: "24h" if `spec.retention` and `spec.retentionSize` are empty.

      • setRetention

        public void setRetention​(String retention)
        How long to retain the Prometheus data.


        Default: "24h" if `spec.retention` and `spec.retentionSize` are empty.

      • getRetentionSize

        public String getRetentionSize()
        Maximum number of bytes used by the Prometheus data.
      • setRetentionSize

        public void setRetentionSize​(String retentionSize)
        Maximum number of bytes used by the Prometheus data.
      • getRoutePrefix

        public String getRoutePrefix()
        The route prefix Prometheus registers HTTP handlers for.


        This is useful when using `spec.externalURL`, and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`.

      • setRoutePrefix

        public void setRoutePrefix​(String routePrefix)
        The route prefix Prometheus registers HTTP handlers for.


        This is useful when using `spec.externalURL`, and a proxy is rewriting HTTP routes of a request, and the actual ExternalURL is still true, but the server serves requests under a different route prefix. For example for use with `kubectl proxy`.

      • getRuleNamespaceSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getRuleNamespaceSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setRuleNamespaceSelector

        public void setRuleNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector ruleNamespaceSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getRuleQueryOffset

        public String getRuleQueryOffset()
        Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past. It requires Prometheus >= v2.53.0.
      • setRuleQueryOffset

        public void setRuleQueryOffset​(String ruleQueryOffset)
        Defines the offset the rule evaluation timestamp of this particular group by the specified duration into the past. It requires Prometheus >= v2.53.0.
      • getRuleSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getRuleSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setRuleSelector

        public void setRuleSelector​(io.fabric8.kubernetes.api.model.LabelSelector ruleSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getRules

        public Rules getRules()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setRules

        public void setRules​(Rules rules)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getRuntime

        public RuntimeConfig getRuntime()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setRuntime

        public void setRuntime​(RuntimeConfig runtime)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getSampleLimit

        public Long getSampleLimit()
        SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedSampleLimit.

      • setSampleLimit

        public void setSampleLimit​(Long sampleLimit)
        SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedSampleLimit.

      • getScrapeClasses

        public List<ScrapeClass> getScrapeClasses()
        List of scrape classes to expose to scraping objects such as PodMonitors, ServiceMonitors, Probes and ScrapeConfigs.


        This is an *experimental feature*, it may change in any upcoming release in a breaking way.

      • setScrapeClasses

        public void setScrapeClasses​(List<ScrapeClass> scrapeClasses)
        List of scrape classes to expose to scraping objects such as PodMonitors, ServiceMonitors, Probes and ScrapeConfigs.


        This is an *experimental feature*, it may change in any upcoming release in a breaking way.

      • getScrapeConfigNamespaceSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getScrapeConfigNamespaceSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setScrapeConfigNamespaceSelector

        public void setScrapeConfigNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigNamespaceSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getScrapeConfigSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getScrapeConfigSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setScrapeConfigSelector

        public void setScrapeConfigSelector​(io.fabric8.kubernetes.api.model.LabelSelector scrapeConfigSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getScrapeInterval

        public String getScrapeInterval()
        Interval between consecutive scrapes.


        Default: "30s"

      • setScrapeInterval

        public void setScrapeInterval​(String scrapeInterval)
        Interval between consecutive scrapes.


        Default: "30s"

      • getScrapeProtocols

        public List<String> getScrapeProtocols()
        The protocols to negotiate during a scrape. It tells clients the protocols supported by Prometheus in order of preference (from most to least preferred).


        If unset, Prometheus uses its default value.


        It requires Prometheus >= v2.49.0.


        `PrometheusText1.0.0` requires Prometheus >= v3.0.0.

      • setScrapeProtocols

        public void setScrapeProtocols​(List<String> scrapeProtocols)
        The protocols to negotiate during a scrape. It tells clients the protocols supported by Prometheus in order of preference (from most to least preferred).


        If unset, Prometheus uses its default value.


        It requires Prometheus >= v2.49.0.


        `PrometheusText1.0.0` requires Prometheus >= v3.0.0.

      • getScrapeTimeout

        public String getScrapeTimeout()
        Number of seconds to wait until a scrape request times out.
      • setScrapeTimeout

        public void setScrapeTimeout​(String scrapeTimeout)
        Number of seconds to wait until a scrape request times out.
      • getSecrets

        public List<String> getSecrets()
        Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`. The Secrets are mounted into /etc/prometheus/secrets/<secret-name> in the 'prometheus' container.
      • setSecrets

        public void setSecrets​(List<String> secrets)
        Secrets is a list of Secrets in the same namespace as the Prometheus object, which shall be mounted into the Prometheus Pods. Each Secret is added to the StatefulSet definition as a volume named `secret-<secret-name>`. The Secrets are mounted into /etc/prometheus/secrets/<secret-name> in the 'prometheus' container.
      • getSecurityContext

        public io.fabric8.kubernetes.api.model.PodSecurityContext getSecurityContext()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setSecurityContext

        public void setSecurityContext​(io.fabric8.kubernetes.api.model.PodSecurityContext securityContext)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getServiceAccountName

        public String getServiceAccountName()
        ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods.
      • setServiceAccountName

        public void setServiceAccountName​(String serviceAccountName)
        ServiceAccountName is the name of the ServiceAccount to use to run the Prometheus Pods.
      • getServiceDiscoveryRole

        public String getServiceDiscoveryRole()
        Defines the service discovery role used to discover targets from `ServiceMonitor` objects and Alertmanager endpoints.


        If set, the value should be either "Endpoints" or "EndpointSlice". If unset, the operator assumes the "Endpoints" role.

      • setServiceDiscoveryRole

        public void setServiceDiscoveryRole​(String serviceDiscoveryRole)
        Defines the service discovery role used to discover targets from `ServiceMonitor` objects and Alertmanager endpoints.


        If set, the value should be either "Endpoints" or "EndpointSlice". If unset, the operator assumes the "Endpoints" role.

      • getServiceMonitorNamespaceSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getServiceMonitorNamespaceSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setServiceMonitorNamespaceSelector

        public void setServiceMonitorNamespaceSelector​(io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorNamespaceSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getServiceMonitorSelector

        public io.fabric8.kubernetes.api.model.LabelSelector getServiceMonitorSelector()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setServiceMonitorSelector

        public void setServiceMonitorSelector​(io.fabric8.kubernetes.api.model.LabelSelector serviceMonitorSelector)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getSha

        public String getSha()
        Deprecated: use 'spec.image' instead. The image's digest can be specified as part of the image name.
      • setSha

        public void setSha​(String sha)
        Deprecated: use 'spec.image' instead. The image's digest can be specified as part of the image name.
      • getShards

        public Integer getShards()
        Number of shards to distribute scraped targets onto.


        `spec.replicas` multiplied by `spec.shards` is the total number of Pods being created.


        When not defined, the operator assumes only one shard.


        Note that scaling down shards will not reshard data onto the remaining instances, it must be manually moved. Increasing shards will not reshard data either but it will continue to be available from the same instances. To query globally, use Thanos sidecar and Thanos querier or remote write data to a central location. Alerting and recording rules


        By default, the sharding is performed on: * The `__address__` target's metadata label for PodMonitor, ServiceMonitor and ScrapeConfig resources. * The `__param_target__` label for Probe resources.


        Users can define their own sharding implementation by setting the `__tmp_hash` label during the target discovery with relabeling configuration (either in the monitoring resources or via scrape class).

      • setShards

        public void setShards​(Integer shards)
        Number of shards to distribute scraped targets onto.


        `spec.replicas` multiplied by `spec.shards` is the total number of Pods being created.


        When not defined, the operator assumes only one shard.


        Note that scaling down shards will not reshard data onto the remaining instances, it must be manually moved. Increasing shards will not reshard data either but it will continue to be available from the same instances. To query globally, use Thanos sidecar and Thanos querier or remote write data to a central location. Alerting and recording rules


        By default, the sharding is performed on: * The `__address__` target's metadata label for PodMonitor, ServiceMonitor and ScrapeConfig resources. * The `__param_target__` label for Probe resources.


        Users can define their own sharding implementation by setting the `__tmp_hash` label during the target discovery with relabeling configuration (either in the monitoring resources or via scrape class).

      • getStorage

        public StorageSpec getStorage()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setStorage

        public void setStorage​(StorageSpec storage)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getTag

        public String getTag()
        Deprecated: use 'spec.image' instead. The image's tag can be specified as part of the image name.
      • setTag

        public void setTag​(String tag)
        Deprecated: use 'spec.image' instead. The image's tag can be specified as part of the image name.
      • getTargetLimit

        public Long getTargetLimit()
        TargetLimit defines a limit on the number of scraped targets that will be accepted. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedTargetLimit.

      • setTargetLimit

        public void setTargetLimit​(Long targetLimit)
        TargetLimit defines a limit on the number of scraped targets that will be accepted. Only valid in Prometheus versions 2.45.0 and newer.


        Note that the global limit only applies to scrape objects that don't specify an explicit limit value. If you want to enforce a maximum limit for all scrape objects, refer to enforcedTargetLimit.

      • getThanos

        public ThanosSpec getThanos()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setThanos

        public void setThanos​(ThanosSpec thanos)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getTolerations

        public List<io.fabric8.kubernetes.api.model.Toleration> getTolerations()
        Defines the Pods' tolerations if specified.
      • setTolerations

        public void setTolerations​(List<io.fabric8.kubernetes.api.model.Toleration> tolerations)
        Defines the Pods' tolerations if specified.
      • getTopologySpreadConstraints

        public List<TopologySpreadConstraint> getTopologySpreadConstraints()
        Defines the pod's topology spread constraints if specified.
      • setTopologySpreadConstraints

        public void setTopologySpreadConstraints​(List<TopologySpreadConstraint> topologySpreadConstraints)
        Defines the pod's topology spread constraints if specified.
      • getTracingConfig

        public PrometheusTracingConfig getTracingConfig()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setTracingConfig

        public void setTracingConfig​(PrometheusTracingConfig tracingConfig)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getTsdb

        public TSDBSpec getTsdb()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setTsdb

        public void setTsdb​(TSDBSpec tsdb)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getVersion

        public String getVersion()
        Version of Prometheus being deployed. The operator uses this information to generate the Prometheus StatefulSet + configuration files.


        If not specified, the operator assumes the latest upstream version of Prometheus available at the time when the version of the operator was released.

      • setVersion

        public void setVersion​(String version)
        Version of Prometheus being deployed. The operator uses this information to generate the Prometheus StatefulSet + configuration files.


        If not specified, the operator assumes the latest upstream version of Prometheus available at the time when the version of the operator was released.

      • getVolumeMounts

        public List<io.fabric8.kubernetes.api.model.VolumeMount> getVolumeMounts()
        VolumeMounts allows the configuration of additional VolumeMounts.


        VolumeMounts will be appended to other VolumeMounts in the 'prometheus' container, that are generated as a result of StorageSpec objects.

      • setVolumeMounts

        public void setVolumeMounts​(List<io.fabric8.kubernetes.api.model.VolumeMount> volumeMounts)
        VolumeMounts allows the configuration of additional VolumeMounts.


        VolumeMounts will be appended to other VolumeMounts in the 'prometheus' container, that are generated as a result of StorageSpec objects.

      • getVolumes

        public List<io.fabric8.kubernetes.api.model.Volume> getVolumes()
        Volumes allows the configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects.
      • setVolumes

        public void setVolumes​(List<io.fabric8.kubernetes.api.model.Volume> volumes)
        Volumes allows the configuration of additional volumes on the output StatefulSet definition. Volumes specified will be appended to other volumes that are generated as a result of StorageSpec objects.
      • getWalCompression

        public Boolean getWalCompression()
        Configures compression of the write-ahead log (WAL) using Snappy.


        WAL compression is enabled by default for Prometheus >= 2.20.0


        Requires Prometheus v2.11.0 and above.

      • setWalCompression

        public void setWalCompression​(Boolean walCompression)
        Configures compression of the write-ahead log (WAL) using Snappy.


        WAL compression is enabled by default for Prometheus >= 2.20.0


        Requires Prometheus v2.11.0 and above.

      • getWeb

        public PrometheusWebSpec getWeb()
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • setWeb

        public void setWeb​(PrometheusWebSpec web)
        PrometheusSpec is a specification of the desired behavior of the Prometheus cluster. More info: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
      • getAdditionalProperties

        public Map<String,​Object> getAdditionalProperties()
      • setAdditionalProperty

        public void setAdditionalProperty​(String name,
                                          Object value)
      • setAdditionalProperties

        public void setAdditionalProperties​(Map<String,​Object> additionalProperties)