1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 09:16:38 +00:00

Bump golangci-lint and switch to the revive (#4089)

* Bump golag-ci lint version to 1.40.1

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Bump linter on CI

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Fix promlinter and examples

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
Maksim Nabokikh 2021-06-09 15:32:23 +04:00 committed by GitHub
parent fa3edac84f
commit 9fcdff92e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 19031 additions and 5956 deletions

View file

@ -45,7 +45,7 @@ jobs:
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v2 uses: golangci/golangci-lint-action@v2
with: with:
version: v1.33 version: v1.40.1
args: --timeout 10m0s args: --timeout 10m0s
check-metrics: check-metrics:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -3,13 +3,17 @@ run:
linters: linters:
enable: enable:
- golint - revive
issues: issues:
exclude-rules: exclude-rules:
- path: _test.go - path: _test.go
linters: linters:
- errcheck - errcheck
# TODO: fix linter errors before enabling it for the framework
- path: test/framework
linters:
- revive
linters-settings: linters-settings:
errcheck: errcheck:

View file

@ -240,7 +240,7 @@ shellcheck: $(SHELLCHECK_BINARY)
.PHONY: check-metrics .PHONY: check-metrics
check-metrics: $(PROMLINTER_BINARY) check-metrics: $(PROMLINTER_BINARY)
$(PROMLINTER_BINARY) . $(PROMLINTER_BINARY) lint .
.PHONY: check-golang .PHONY: check-golang
check-golang: $(GOLANGCILINTER_BINARY) check-golang: $(GOLANGCILINTER_BINARY)

12149
bundle.yaml

File diff suppressed because it is too large Load diff

View file

@ -366,7 +366,7 @@ func Main() int {
return 1 return 1
} }
var tlsConfig *tls.Config = nil var tlsConfig *tls.Config
if serverTLS { if serverTLS {
if rawTLSCipherSuites != "" { if rawTLSCipherSuites != "" {
cfg.ServerTLSConfig.CipherSuites = strings.Split(rawTLSCipherSuites, ",") cfg.ServerTLSConfig.CipherSuites = strings.Split(rawTLSCipherSuites, ",")

View file

@ -3,7 +3,8 @@ groups:
rules: rules:
- alert: PrometheusOperatorListErrors - alert: PrometheusOperatorListErrors
annotations: annotations:
description: Errors while performing List operations in controller {{$labels.controller}} in {{$labels.namespace}} namespace. description: Errors while performing List operations in controller {{$labels.controller}}
in {{$labels.namespace}} namespace.
summary: Errors while performing list operations in controller. summary: Errors while performing list operations in controller.
expr: | expr: |
(sum by (controller,namespace) (rate(prometheus_operator_list_operations_failed_total{job="prometheus-operator"}[10m])) / sum by (controller,namespace) (rate(prometheus_operator_list_operations_total{job="prometheus-operator"}[10m]))) > 0.4 (sum by (controller,namespace) (rate(prometheus_operator_list_operations_failed_total{job="prometheus-operator"}[10m])) / sum by (controller,namespace) (rate(prometheus_operator_list_operations_total{job="prometheus-operator"}[10m]))) > 0.4
@ -12,7 +13,8 @@ groups:
severity: warning severity: warning
- alert: PrometheusOperatorWatchErrors - alert: PrometheusOperatorWatchErrors
annotations: annotations:
description: Errors while performing watch operations in controller {{$labels.controller}} in {{$labels.namespace}} namespace. description: Errors while performing watch operations in controller {{$labels.controller}}
in {{$labels.namespace}} namespace.
summary: Errors while performing watch operations in controller. summary: Errors while performing watch operations in controller.
expr: | expr: |
(sum by (controller,namespace) (rate(prometheus_operator_watch_operations_failed_total{job="prometheus-operator"}[10m])) / sum by (controller,namespace) (rate(prometheus_operator_watch_operations_total{job="prometheus-operator"}[10m]))) > 0.4 (sum by (controller,namespace) (rate(prometheus_operator_watch_operations_failed_total{job="prometheus-operator"}[10m])) / sum by (controller,namespace) (rate(prometheus_operator_watch_operations_total{job="prometheus-operator"}[10m]))) > 0.4
@ -21,7 +23,8 @@ groups:
severity: warning severity: warning
- alert: PrometheusOperatorSyncFailed - alert: PrometheusOperatorSyncFailed
annotations: annotations:
description: Controller {{ $labels.controller }} in {{ $labels.namespace }} namespace fails to reconcile {{ $value }} objects. description: Controller {{ $labels.controller }} in {{ $labels.namespace }}
namespace fails to reconcile {{ $value }} objects.
summary: Last controller reconciliation failed summary: Last controller reconciliation failed
expr: | expr: |
min_over_time(prometheus_operator_syncs{status="failed",job="prometheus-operator"}[5m]) > 0 min_over_time(prometheus_operator_syncs{status="failed",job="prometheus-operator"}[5m]) > 0
@ -30,7 +33,8 @@ groups:
severity: warning severity: warning
- alert: PrometheusOperatorReconcileErrors - alert: PrometheusOperatorReconcileErrors
annotations: annotations:
description: '{{ $value | humanizePercentage }} of reconciling operations failed for {{ $labels.controller }} controller in {{ $labels.namespace }} namespace.' description: '{{ $value | humanizePercentage }} of reconciling operations failed
for {{ $labels.controller }} controller in {{ $labels.namespace }} namespace.'
summary: Errors while reconciling controller. summary: Errors while reconciling controller.
expr: | expr: |
(sum by (controller,namespace) (rate(prometheus_operator_reconcile_errors_total{job="prometheus-operator"}[5m]))) / (sum by (controller,namespace) (rate(prometheus_operator_reconcile_operations_total{job="prometheus-operator"}[5m]))) > 0.1 (sum by (controller,namespace) (rate(prometheus_operator_reconcile_errors_total{job="prometheus-operator"}[5m]))) / (sum by (controller,namespace) (rate(prometheus_operator_reconcile_operations_total{job="prometheus-operator"}[5m]))) > 0.1
@ -39,7 +43,8 @@ groups:
severity: warning severity: warning
- alert: PrometheusOperatorNodeLookupErrors - alert: PrometheusOperatorNodeLookupErrors
annotations: annotations:
description: Errors while reconciling Prometheus in {{ $labels.namespace }} Namespace. description: Errors while reconciling Prometheus in {{ $labels.namespace }}
Namespace.
summary: Errors while reconciling Prometheus. summary: Errors while reconciling Prometheus.
expr: | expr: |
rate(prometheus_operator_node_address_lookup_errors_total{job="prometheus-operator"}[5m]) > 0.1 rate(prometheus_operator_node_address_lookup_errors_total{job="prometheus-operator"}[5m]) > 0.1
@ -48,7 +53,8 @@ groups:
severity: warning severity: warning
- alert: PrometheusOperatorNotReady - alert: PrometheusOperatorNotReady
annotations: annotations:
description: Prometheus operator in {{ $labels.namespace }} namespace isn't ready to reconcile {{ $labels.controller }} resources. description: Prometheus operator in {{ $labels.namespace }} namespace isn't
ready to reconcile {{ $labels.controller }} resources.
summary: Prometheus operator not ready summary: Prometheus operator not ready
expr: | expr: |
min by(namespace, controller) (max_over_time(prometheus_operator_ready{job="prometheus-operator"}[5m]) == 0) min by(namespace, controller) (max_over_time(prometheus_operator_ready{job="prometheus-operator"}[5m]) == 0)
@ -57,7 +63,9 @@ groups:
severity: warning severity: warning
- alert: PrometheusOperatorRejectedResources - alert: PrometheusOperatorRejectedResources
annotations: annotations:
description: Prometheus operator in {{ $labels.namespace }} namespace rejected {{ printf "%0.0f" $value }} {{ $labels.controller }}/{{ $labels.resource }} resources. description: Prometheus operator in {{ $labels.namespace }} namespace rejected
{{ printf "%0.0f" $value }} {{ $labels.controller }}/{{ $labels.resource }}
resources.
summary: Resources rejected by Prometheus operator summary: Resources rejected by Prometheus operator
expr: | expr: |
min_over_time(prometheus_operator_managed_resources{state="rejected",job="prometheus-operator"}[5m]) > 0 min_over_time(prometheus_operator_managed_resources{state="rejected",job="prometheus-operator"}[5m]) > 0

View file

@ -24,24 +24,31 @@ spec:
description: PodMonitor defines monitoring for a set of pods. description: PodMonitor defines monitoring for a set of pods.
properties: properties:
apiVersion: apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string type: string
kind: kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string type: string
metadata: metadata:
type: object type: object
spec: spec:
description: Specification of desired Pod selection for target discovery by Prometheus. description: Specification of desired Pod selection for target discovery
by Prometheus.
properties: properties:
jobLabel: jobLabel:
description: The label to use to retrieve the job name from. description: The label to use to retrieve the job name from.
type: string type: string
namespaceSelector: namespaceSelector:
description: Selector to select which namespaces the Endpoints objects are discovered from. description: Selector to select which namespaces the Endpoints objects
are discovered from.
properties: properties:
any: any:
description: Boolean describing whether all namespaces are selected in contrast to a list restricting them. description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean type: boolean
matchNames: matchNames:
description: List of namespace names. description: List of namespace names.
@ -52,94 +59,126 @@ spec:
podMetricsEndpoints: podMetricsEndpoints:
description: A list of endpoints allowed as part of this PodMonitor. description: A list of endpoints allowed as part of this PodMonitor.
items: items:
description: PodMetricsEndpoint defines a scrapeable endpoint of a Kubernetes Pod serving Prometheus metrics. description: PodMetricsEndpoint defines a scrapeable endpoint of
a Kubernetes Pod serving Prometheus metrics.
properties: properties:
basicAuth: basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint' description: 'BasicAuth allow an endpoint to authenticate over
basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint'
properties: properties:
password: password:
description: The secret in the service monitor namespace that contains the password for authentication. description: The secret in the service monitor namespace
that contains the password for authentication.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
username: username:
description: The secret in the service monitor namespace that contains the username for authentication. description: The secret in the service monitor namespace
that contains the username for authentication.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
type: object type: object
bearerTokenSecret: bearerTokenSecret:
description: Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the pod monitor and accessible by the Prometheus Operator. description: Secret to mount to read bearer token for scraping
targets. The secret needs to be in the same namespace as the
pod monitor and accessible by the Prometheus Operator.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
honorLabels: honorLabels:
description: HonorLabels chooses the metric's labels on collisions with target labels. description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean type: boolean
honorTimestamps: honorTimestamps:
description: HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. description: HonorTimestamps controls whether Prometheus respects
the timestamps present in scraped data.
type: boolean type: boolean
interval: interval:
description: Interval at which metrics should be scraped description: Interval at which metrics should be scraped
type: string type: string
metricRelabelings: metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion. description: MetricRelabelConfigs to apply to samples before
ingestion.
items: items:
description: 'RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties: properties:
action: action:
description: Action to perform based on regex matching. Default is 'replace' description: Action to perform based on regex matching.
Default is 'replace'
type: string type: string
modulus: modulus:
description: Modulus to take of the hash of the source label values. description: Modulus to take of the hash of the source
label values.
format: int64 format: int64
type: integer type: integer
regex: regex:
description: Regular expression against which the extracted value is matched. Default is '(.*)' description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string type: string
replacement: replacement:
description: Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string type: string
separator: separator:
description: Separator placed between concatenated source label values. default is ';'. description: Separator placed between concatenated source
label values. default is ';'.
type: string type: string
sourceLabels: sourceLabels:
description: The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items: items:
type: string type: string
type: array type: array
targetLabel: targetLabel:
description: Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string type: string
type: object type: object
type: array type: array
@ -154,39 +193,58 @@ spec:
description: HTTP path to scrape for metrics. description: HTTP path to scrape for metrics.
type: string type: string
port: port:
description: Name of the pod port this endpoint refers to. Mutually exclusive with targetPort. description: Name of the pod port this endpoint refers to. Mutually
exclusive with targetPort.
type: string type: string
proxyUrl: proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint. description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string type: string
relabelings: relabelings:
description: 'RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields and replaces original scrape job name with __tmp_prometheus_job_name. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' description: 'RelabelConfigs to apply to samples before scraping.
Prometheus Operator automatically adds relabelings for a few
standard Kubernetes fields and replaces original scrape job
name with __tmp_prometheus_job_name. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items: items:
description: 'RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties: properties:
action: action:
description: Action to perform based on regex matching. Default is 'replace' description: Action to perform based on regex matching.
Default is 'replace'
type: string type: string
modulus: modulus:
description: Modulus to take of the hash of the source label values. description: Modulus to take of the hash of the source
label values.
format: int64 format: int64
type: integer type: integer
regex: regex:
description: Regular expression against which the extracted value is matched. Default is '(.*)' description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string type: string
replacement: replacement:
description: Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string type: string
separator: separator:
description: Separator placed between concatenated source label values. default is ';'. description: Separator placed between concatenated source
label values. default is ';'.
type: string type: string
sourceLabels: sourceLabels:
description: The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items: items:
type: string type: string
type: array type: array
targetLabel: targetLabel:
description: Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string type: string
type: object type: object
type: array type: array
@ -206,19 +264,24 @@ spec:
description: TLS configuration to use when scraping the endpoint. description: TLS configuration to use when scraping the endpoint.
properties: properties:
ca: ca:
description: Struct containing the CA cert to use for the targets. description: Struct containing the CA cert to use for the
targets.
properties: properties:
configMap: configMap:
description: ConfigMap containing data to use for the targets. description: ConfigMap containing data to use for the
targets.
properties: properties:
key: key:
description: The key to select. description: The key to select.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the ConfigMap or its key must be defined description: Specify whether the ConfigMap or its
key must be defined
type: boolean type: boolean
required: required:
- key - key
@ -227,32 +290,41 @@ spec:
description: Secret containing data to use for the targets. description: Secret containing data to use for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key
must be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
type: object type: object
cert: cert:
description: Struct containing the client cert file for the targets. description: Struct containing the client cert file for
the targets.
properties: properties:
configMap: configMap:
description: ConfigMap containing data to use for the targets. description: ConfigMap containing data to use for the
targets.
properties: properties:
key: key:
description: The key to select. description: The key to select.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the ConfigMap or its key must be defined description: Specify whether the ConfigMap or its
key must be defined
type: boolean type: boolean
required: required:
- key - key
@ -261,13 +333,17 @@ spec:
description: Secret containing data to use for the targets. description: Secret containing data to use for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key
must be defined
type: boolean type: boolean
required: required:
- key - key
@ -277,16 +353,20 @@ spec:
description: Disable target certificate validation. description: Disable target certificate validation.
type: boolean type: boolean
keySecret: keySecret:
description: Secret containing the client key file for the targets. description: Secret containing the client key file for the
targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
@ -298,30 +378,42 @@ spec:
type: object type: object
type: array type: array
podTargetLabels: podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes Pod onto the target. description: PodTargetLabels transfers labels on the Kubernetes Pod
onto the target.
items: items:
type: string type: string
type: array type: array
sampleLimit: sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
format: int64 format: int64
type: integer type: integer
selector: selector:
description: Selector to select Pod objects. description: Selector to select Pod objects.
properties: properties:
matchExpressions: matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed. description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items: items:
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties: properties:
key: key:
description: key is the label key that the selector applies to. description: key is the label key that the selector applies
to.
type: string type: string
operator: operator:
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string type: string
values: values:
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items: items:
type: string type: string
type: array type: array
@ -333,11 +425,16 @@ spec:
matchLabels: matchLabels:
additionalProperties: additionalProperties:
type: string type: string
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object type: object
type: object type: object
targetLimit: targetLimit:
description: TargetLimit defines a limit on the number of scraped targets that will be accepted. description: TargetLimit defines a limit on the number of scraped
targets that will be accepted.
format: int64 format: int64
type: integer type: integer
required: required:

View file

@ -24,58 +24,76 @@ spec:
description: Probe defines monitoring for a set of static targets or ingresses. description: Probe defines monitoring for a set of static targets or ingresses.
properties: properties:
apiVersion: apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string type: string
kind: kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string type: string
metadata: metadata:
type: object type: object
spec: spec:
description: Specification of desired Ingress selection for target discovery by Prometheus. description: Specification of desired Ingress selection for target discovery
by Prometheus.
properties: properties:
basicAuth: basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint' description: 'BasicAuth allow an endpoint to authenticate over basic
authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint'
properties: properties:
password: password:
description: The secret in the service monitor namespace that contains the password for authentication. description: The secret in the service monitor namespace that
contains the password for authentication.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must be
a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must be
defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
username: username:
description: The secret in the service monitor namespace that contains the username for authentication. description: The secret in the service monitor namespace that
contains the username for authentication.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must be
a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must be
defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
type: object type: object
bearerTokenSecret: bearerTokenSecret:
description: Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the probe and accessible by the Prometheus Operator. description: Secret to mount to read bearer token for scraping targets.
The secret needs to be in the same namespace as the probe and accessible
by the Prometheus Operator.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must be a
valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must be defined
@ -84,16 +102,21 @@ spec:
- key - key
type: object type: object
interval: interval:
description: Interval at which targets are probed using the configured prober. If not specified Prometheus' global scrape interval is used. description: Interval at which targets are probed using the configured
prober. If not specified Prometheus' global scrape interval is used.
type: string type: string
jobName: jobName:
description: The job name assigned to scraped metrics by default. description: The job name assigned to scraped metrics by default.
type: string type: string
module: module:
description: 'The module to use for probing specifying how to probe the target. Example module configuring in the blackbox exporter: https://github.com/prometheus/blackbox_exporter/blob/master/example.yml' description: 'The module to use for probing specifying how to probe
the target. Example module configuring in the blackbox exporter:
https://github.com/prometheus/blackbox_exporter/blob/master/example.yml'
type: string type: string
prober: prober:
description: Specification for the prober to use for probing targets. The prober.URL parameter is required. Targets cannot be probed if left empty. description: Specification for the prober to use for probing targets.
The prober.URL parameter is required. Targets cannot be probed if
left empty.
properties: properties:
path: path:
description: Path to collect metrics from. Defaults to `/probe`. description: Path to collect metrics from. Defaults to `/probe`.
@ -111,16 +134,19 @@ spec:
description: Timeout for scraping metrics from the Prometheus exporter. description: Timeout for scraping metrics from the Prometheus exporter.
type: string type: string
targets: targets:
description: Targets defines a set of static and/or dynamically discovered targets to be probed using the prober. description: Targets defines a set of static and/or dynamically discovered
targets to be probed using the prober.
properties: properties:
ingress: ingress:
description: Ingress defines the set of dynamically discovered ingress objects which hosts are considered for probing. description: Ingress defines the set of dynamically discovered
ingress objects which hosts are considered for probing.
properties: properties:
namespaceSelector: namespaceSelector:
description: Select Ingress objects by namespace. description: Select Ingress objects by namespace.
properties: properties:
any: any:
description: Boolean describing whether all namespaces are selected in contrast to a list restricting them. description: Boolean describing whether all namespaces
are selected in contrast to a list restricting them.
type: boolean type: boolean
matchNames: matchNames:
description: List of namespace names. description: List of namespace names.
@ -129,33 +155,48 @@ spec:
type: array type: array
type: object type: object
relabelingConfigs: relabelingConfigs:
description: 'RelabelConfigs to apply to samples before ingestion. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' description: 'RelabelConfigs to apply to samples before ingestion.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items: items:
description: 'RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' description: 'RelabelConfig allows dynamic rewriting of
the label set, being applied to samples before ingestion.
It defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties: properties:
action: action:
description: Action to perform based on regex matching. Default is 'replace' description: Action to perform based on regex matching.
Default is 'replace'
type: string type: string
modulus: modulus:
description: Modulus to take of the hash of the source label values. description: Modulus to take of the hash of the source
label values.
format: int64 format: int64
type: integer type: integer
regex: regex:
description: Regular expression against which the extracted value is matched. Default is '(.*)' description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string type: string
replacement: replacement:
description: Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' description: Replacement value against which a regex
replace is performed if the regular expression matches.
Regex capture groups are available. Default is '$1'
type: string type: string
separator: separator:
description: Separator placed between concatenated source label values. default is ';'. description: Separator placed between concatenated source
label values. default is ';'.
type: string type: string
sourceLabels: sourceLabels:
description: The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items: items:
type: string type: string
type: array type: array
targetLabel: targetLabel:
description: Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string type: string
type: object type: object
type: array type: array
@ -163,18 +204,29 @@ spec:
description: Select Ingress objects by labels. description: Select Ingress objects by labels.
properties: properties:
matchExpressions: matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed. description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items: items:
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties: properties:
key: key:
description: key is the label key that the selector applies to. description: key is the label key that the selector
applies to.
type: string type: string
operator: operator:
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string type: string
values: values:
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items: items:
type: string type: string
type: array type: array
@ -186,51 +238,73 @@ spec:
matchLabels: matchLabels:
additionalProperties: additionalProperties:
type: string type: string
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
type: object type: object
type: object type: object
type: object type: object
staticConfig: staticConfig:
description: 'StaticConfig defines static targets which are considers for probing. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.' description: 'StaticConfig defines static targets which are considers
for probing. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.'
properties: properties:
labels: labels:
additionalProperties: additionalProperties:
type: string type: string
description: Labels assigned to all metrics scraped from the targets. description: Labels assigned to all metrics scraped from the
targets.
type: object type: object
relabelingConfigs: relabelingConfigs:
description: 'RelabelConfigs to apply to samples before ingestion. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' description: 'RelabelConfigs to apply to samples before ingestion.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items: items:
description: 'RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' description: 'RelabelConfig allows dynamic rewriting of
the label set, being applied to samples before ingestion.
It defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties: properties:
action: action:
description: Action to perform based on regex matching. Default is 'replace' description: Action to perform based on regex matching.
Default is 'replace'
type: string type: string
modulus: modulus:
description: Modulus to take of the hash of the source label values. description: Modulus to take of the hash of the source
label values.
format: int64 format: int64
type: integer type: integer
regex: regex:
description: Regular expression against which the extracted value is matched. Default is '(.*)' description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string type: string
replacement: replacement:
description: Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' description: Replacement value against which a regex
replace is performed if the regular expression matches.
Regex capture groups are available. Default is '$1'
type: string type: string
separator: separator:
description: Separator placed between concatenated source label values. default is ';'. description: Separator placed between concatenated source
label values. default is ';'.
type: string type: string
sourceLabels: sourceLabels:
description: The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items: items:
type: string type: string
type: array type: array
targetLabel: targetLabel:
description: Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string type: string
type: object type: object
type: array type: array
static: static:
description: Targets is a list of URLs to probe using the configured prober. description: Targets is a list of URLs to probe using the
configured prober.
items: items:
type: string type: string
type: array type: array
@ -249,10 +323,12 @@ spec:
description: The key to select. description: The key to select.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the ConfigMap or its key must be defined description: Specify whether the ConfigMap or its key
must be defined
type: boolean type: boolean
required: required:
- key - key
@ -261,13 +337,16 @@ spec:
description: Secret containing data to use for the targets. description: Secret containing data to use for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
@ -283,10 +362,12 @@ spec:
description: The key to select. description: The key to select.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the ConfigMap or its key must be defined description: Specify whether the ConfigMap or its key
must be defined
type: boolean type: boolean
required: required:
- key - key
@ -295,13 +376,16 @@ spec:
description: Secret containing data to use for the targets. description: Secret containing data to use for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
@ -314,13 +398,16 @@ spec:
description: Secret containing the client key file for the targets. description: Secret containing the client key file for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must be
a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must be
defined
type: boolean type: boolean
required: required:
- key - key

View file

@ -19,13 +19,18 @@ spec:
- name: v1 - name: v1
schema: schema:
openAPIV3Schema: openAPIV3Schema:
description: PrometheusRule defines recording and alerting rules for a Prometheus instance description: PrometheusRule defines recording and alerting rules for a Prometheus
instance
properties: properties:
apiVersion: apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string type: string
kind: kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string type: string
metadata: metadata:
type: object type: object
@ -35,7 +40,10 @@ spec:
groups: groups:
description: Content of Prometheus rule file description: Content of Prometheus rule file
items: items:
description: 'RuleGroup is a list of sequentially evaluated recording and alerting rules. Note: PartialResponseStrategy is only used by ThanosRuler and will be ignored by Prometheus instances. Valid values for this field are ''warn'' or ''abort''. More info: https://github.com/thanos-io/thanos/blob/master/docs/components/rule.md#partial-response' description: 'RuleGroup is a list of sequentially evaluated recording
and alerting rules. Note: PartialResponseStrategy is only used
by ThanosRuler and will be ignored by Prometheus instances. Valid
values for this field are ''warn'' or ''abort''. More info: https://github.com/thanos-io/thanos/blob/master/docs/components/rule.md#partial-response'
properties: properties:
interval: interval:
type: string type: string
@ -45,7 +53,10 @@ spec:
type: string type: string
rules: rules:
items: items:
description: 'Rule describes an alerting or recording rule See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/) or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules) rule' description: 'Rule describes an alerting or recording rule
See Prometheus documentation: [alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)
or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules)
rule'
properties: properties:
alert: alert:
type: string type: string

View file

@ -24,50 +24,65 @@ spec:
description: ServiceMonitor defines monitoring for a set of services. description: ServiceMonitor defines monitoring for a set of services.
properties: properties:
apiVersion: apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string type: string
kind: kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string type: string
metadata: metadata:
type: object type: object
spec: spec:
description: Specification of desired Service selection for target discovery by Prometheus. description: Specification of desired Service selection for target discovery
by Prometheus.
properties: properties:
endpoints: endpoints:
description: A list of endpoints allowed as part of this ServiceMonitor. description: A list of endpoints allowed as part of this ServiceMonitor.
items: items:
description: Endpoint defines a scrapeable endpoint serving Prometheus metrics. description: Endpoint defines a scrapeable endpoint serving Prometheus
metrics.
properties: properties:
basicAuth: basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints' description: 'BasicAuth allow an endpoint to authenticate over
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
properties: properties:
password: password:
description: The secret in the service monitor namespace that contains the password for authentication. description: The secret in the service monitor namespace
that contains the password for authentication.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
username: username:
description: The secret in the service monitor namespace that contains the username for authentication. description: The secret in the service monitor namespace
that contains the username for authentication.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
@ -77,57 +92,79 @@ spec:
description: File to read bearer token for scraping targets. description: File to read bearer token for scraping targets.
type: string type: string
bearerTokenSecret: bearerTokenSecret:
description: Secret to mount to read bearer token for scraping targets. The secret needs to be in the same namespace as the service monitor and accessible by the Prometheus Operator. description: Secret to mount to read bearer token for scraping
targets. The secret needs to be in the same namespace as the
service monitor and accessible by the Prometheus Operator.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
honorLabels: honorLabels:
description: HonorLabels chooses the metric's labels on collisions with target labels. description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean type: boolean
honorTimestamps: honorTimestamps:
description: HonorTimestamps controls whether Prometheus respects the timestamps present in scraped data. description: HonorTimestamps controls whether Prometheus respects
the timestamps present in scraped data.
type: boolean type: boolean
interval: interval:
description: Interval at which metrics should be scraped description: Interval at which metrics should be scraped
type: string type: string
metricRelabelings: metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion. description: MetricRelabelConfigs to apply to samples before
ingestion.
items: items:
description: 'RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties: properties:
action: action:
description: Action to perform based on regex matching. Default is 'replace' description: Action to perform based on regex matching.
Default is 'replace'
type: string type: string
modulus: modulus:
description: Modulus to take of the hash of the source label values. description: Modulus to take of the hash of the source
label values.
format: int64 format: int64
type: integer type: integer
regex: regex:
description: Regular expression against which the extracted value is matched. Default is '(.*)' description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string type: string
replacement: replacement:
description: Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string type: string
separator: separator:
description: Separator placed between concatenated source label values. default is ';'. description: Separator placed between concatenated source
label values. default is ';'.
type: string type: string
sourceLabels: sourceLabels:
description: The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items: items:
type: string type: string
type: array type: array
targetLabel: targetLabel:
description: Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string type: string
type: object type: object
type: array type: array
@ -142,39 +179,58 @@ spec:
description: HTTP path to scrape for metrics. description: HTTP path to scrape for metrics.
type: string type: string
port: port:
description: Name of the service port this endpoint refers to. Mutually exclusive with targetPort. description: Name of the service port this endpoint refers to.
Mutually exclusive with targetPort.
type: string type: string
proxyUrl: proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes to proxy through this endpoint. description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string type: string
relabelings: relabelings:
description: 'RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields and replaces original scrape job name with __tmp_prometheus_job_name. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config' description: 'RelabelConfigs to apply to samples before scraping.
Prometheus Operator automatically adds relabelings for a few
standard Kubernetes fields and replaces original scrape job
name with __tmp_prometheus_job_name. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
items: items:
description: 'RelabelConfig allows dynamic rewriting of the label set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs' description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It
defines `<metric_relabel_configs>`-section of Prometheus
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties: properties:
action: action:
description: Action to perform based on regex matching. Default is 'replace' description: Action to perform based on regex matching.
Default is 'replace'
type: string type: string
modulus: modulus:
description: Modulus to take of the hash of the source label values. description: Modulus to take of the hash of the source
label values.
format: int64 format: int64
type: integer type: integer
regex: regex:
description: Regular expression against which the extracted value is matched. Default is '(.*)' description: Regular expression against which the extracted
value is matched. Default is '(.*)'
type: string type: string
replacement: replacement:
description: Replacement value against which a regex replace is performed if the regular expression matches. Regex capture groups are available. Default is '$1' description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string type: string
separator: separator:
description: Separator placed between concatenated source label values. default is ';'. description: Separator placed between concatenated source
label values. default is ';'.
type: string type: string
sourceLabels: sourceLabels:
description: The source labels select values from existing labels. Their content is concatenated using the configured separator and matched against the configured regular expression for the replace, keep, and drop actions. description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular
expression for the replace, keep, and drop actions.
items: items:
type: string type: string
type: array type: array
targetLabel: targetLabel:
description: Label to which the resulting value is written in a replace action. It is mandatory for replace actions. Regex capture groups are available. description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string type: string
type: object type: object
type: array type: array
@ -188,25 +244,32 @@ spec:
anyOf: anyOf:
- type: integer - type: integer
- type: string - type: string
description: Name or number of the target port of the Pod behind the Service, the port must be specified with container port property. Mutually exclusive with port. description: Name or number of the target port of the Pod behind
the Service, the port must be specified with container port
property. Mutually exclusive with port.
x-kubernetes-int-or-string: true x-kubernetes-int-or-string: true
tlsConfig: tlsConfig:
description: TLS configuration to use when scraping the endpoint description: TLS configuration to use when scraping the endpoint
properties: properties:
ca: ca:
description: Struct containing the CA cert to use for the targets. description: Struct containing the CA cert to use for the
targets.
properties: properties:
configMap: configMap:
description: ConfigMap containing data to use for the targets. description: ConfigMap containing data to use for the
targets.
properties: properties:
key: key:
description: The key to select. description: The key to select.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the ConfigMap or its key must be defined description: Specify whether the ConfigMap or its
key must be defined
type: boolean type: boolean
required: required:
- key - key
@ -215,35 +278,45 @@ spec:
description: Secret containing data to use for the targets. description: Secret containing data to use for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key
must be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
type: object type: object
caFile: caFile:
description: Path to the CA cert in the Prometheus container to use for the targets. description: Path to the CA cert in the Prometheus container
to use for the targets.
type: string type: string
cert: cert:
description: Struct containing the client cert file for the targets. description: Struct containing the client cert file for
the targets.
properties: properties:
configMap: configMap:
description: ConfigMap containing data to use for the targets. description: ConfigMap containing data to use for the
targets.
properties: properties:
key: key:
description: The key to select. description: The key to select.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the ConfigMap or its key must be defined description: Specify whether the ConfigMap or its
key must be defined
type: boolean type: boolean
required: required:
- key - key
@ -252,38 +325,48 @@ spec:
description: Secret containing data to use for the targets. description: Secret containing data to use for the targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key
must be defined
type: boolean type: boolean
required: required:
- key - key
type: object type: object
type: object type: object
certFile: certFile:
description: Path to the client cert file in the Prometheus container for the targets. description: Path to the client cert file in the Prometheus
container for the targets.
type: string type: string
insecureSkipVerify: insecureSkipVerify:
description: Disable target certificate validation. description: Disable target certificate validation.
type: boolean type: boolean
keyFile: keyFile:
description: Path to the client key file in the Prometheus container for the targets. description: Path to the client key file in the Prometheus
container for the targets.
type: string type: string
keySecret: keySecret:
description: Secret containing the client key file for the targets. description: Secret containing the client key file for the
targets.
properties: properties:
key: key:
description: The key of the secret to select from. Must be a valid secret key. description: The key of the secret to select from. Must
be a valid secret key.
type: string type: string
name: name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string type: string
optional: optional:
description: Specify whether the Secret or its key must be defined description: Specify whether the Secret or its key must
be defined
type: boolean type: boolean
required: required:
- key - key
@ -295,13 +378,18 @@ spec:
type: object type: object
type: array type: array
jobLabel: jobLabel:
description: "Chooses the label of the Kubernetes `Endpoints`. Its value will be used for the `job`-label's value of the created metrics. \n Default & fallback value: the name of the respective Kubernetes `Endpoint`." description: "Chooses the label of the Kubernetes `Endpoints`. Its
value will be used for the `job`-label's value of the created metrics.
\n Default & fallback value: the name of the respective Kubernetes
`Endpoint`."
type: string type: string
namespaceSelector: namespaceSelector:
description: Selector to select which namespaces the Kubernetes Endpoints objects are discovered from. description: Selector to select which namespaces the Kubernetes Endpoints
objects are discovered from.
properties: properties:
any: any:
description: Boolean describing whether all namespaces are selected in contrast to a list restricting them. description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean type: boolean
matchNames: matchNames:
description: List of namespace names. description: List of namespace names.
@ -310,30 +398,42 @@ spec:
type: array type: array
type: object type: object
podTargetLabels: podTargetLabels:
description: PodTargetLabels transfers labels on the Kubernetes `Pod` onto the created metrics. description: PodTargetLabels transfers labels on the Kubernetes `Pod`
onto the created metrics.
items: items:
type: string type: string
type: array type: array
sampleLimit: sampleLimit:
description: SampleLimit defines per-scrape limit on number of scraped samples that will be accepted. description: SampleLimit defines per-scrape limit on number of scraped
samples that will be accepted.
format: int64 format: int64
type: integer type: integer
selector: selector:
description: Selector to select Endpoints objects. description: Selector to select Endpoints objects.
properties: properties:
matchExpressions: matchExpressions:
description: matchExpressions is a list of label selector requirements. The requirements are ANDed. description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items: items:
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. description: A label selector requirement is a selector that
contains values, a key, and an operator that relates the key
and values.
properties: properties:
key: key:
description: key is the label key that the selector applies to. description: key is the label key that the selector applies
to.
type: string type: string
operator: operator:
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. description: operator represents a key's relationship to
a set of values. Valid operators are In, NotIn, Exists
and DoesNotExist.
type: string type: string
values: values:
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. description: values is an array of string values. If the
operator is In or NotIn, the values array must be non-empty.
If the operator is Exists or DoesNotExist, the values
array must be empty. This array is replaced during a strategic
merge patch.
items: items:
type: string type: string
type: array type: array
@ -345,16 +445,23 @@ spec:
matchLabels: matchLabels:
additionalProperties: additionalProperties:
type: string type: string
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator
is "In", and the values array contains only "value". The requirements
are ANDed.
type: object type: object
type: object type: object
targetLabels: targetLabels:
description: TargetLabels transfers labels from the Kubernetes `Service` onto the created metrics. All labels set in `selector.matchLabels` are automatically transferred. description: TargetLabels transfers labels from the Kubernetes `Service`
onto the created metrics. All labels set in `selector.matchLabels`
are automatically transferred.
items: items:
type: string type: string
type: array type: array
targetLimit: targetLimit:
description: TargetLimit defines a limit on the number of scraped targets that will be accepted. description: TargetLimit defines a limit on the number of scraped
targets that will be accepted.
format: int64 format: int64
type: integer type: integer
required: required:

View file

@ -1369,10 +1369,7 @@ func configureHTTPConfigInStore(ctx context.Context, httpConfig *monitoringv1alp
return err return err
} }
if err = store.AddSafeTLSConfig(ctx, namespace, httpConfig.TLSConfig); err != nil { return store.AddSafeTLSConfig(ctx, namespace, httpConfig.TLSConfig)
return err
}
return nil
} }
func (c *Operator) createOrUpdateTLSAssetSecret(ctx context.Context, am *monitoringv1.Alertmanager, store *assets.Store) error { func (c *Operator) createOrUpdateTLSAssetSecret(ctx context.Context, am *monitoringv1.Alertmanager, store *assets.Store) error {

View file

@ -24,7 +24,7 @@ import (
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
) )
// NewKubeInformerFactories creates factories for monitoring resources // NewMonitoringInformerFactories creates factories for monitoring resources
// for the given allowed, and denied namespaces these parameters being mutually exclusive. // for the given allowed, and denied namespaces these parameters being mutually exclusive.
// monitoringClient, defaultResync, and tweakListOptions are being passed to the underlying informer factory. // monitoringClient, defaultResync, and tweakListOptions are being passed to the underlying informer factory.
func NewMonitoringInformerFactories( func NewMonitoringInformerFactories(

View file

@ -17,17 +17,35 @@ package operator
import "github.com/prometheus/common/version" import "github.com/prometheus/common/version"
const ( const (
DefaultAlertmanagerVersion = "v0.21.0" // DefaultAlertmanagerVersion is a default image tag for the prometheus alertmanager
DefaultAlertmanagerVersion = "v0.21.0"
// DefaultAlertmanagerBaseImage is a base container registry address for the prometheus alertmanager
DefaultAlertmanagerBaseImage = "quay.io/prometheus/alertmanager" DefaultAlertmanagerBaseImage = "quay.io/prometheus/alertmanager"
DefaultAlertmanagerImage = DefaultAlertmanagerBaseImage + ":" + DefaultAlertmanagerVersion // DefaultAlertmanagerImage is a default image pulling address for the prometheus alertmanager
DefaultThanosVersion = "v0.19.0" DefaultAlertmanagerImage = DefaultAlertmanagerBaseImage + ":" + DefaultAlertmanagerVersion
DefaultThanosBaseImage = "quay.io/thanos/thanos"
DefaultThanosImage = DefaultThanosBaseImage + ":" + DefaultThanosVersion // DefaultThanosVersion is a default image tag for the Thanos long-term prometheus storage collector
DefaultThanosVersion = "v0.19.0"
// DefaultThanosBaseImage is a base container registry address for the Thanos long-term prometheus
// storage collector
DefaultThanosBaseImage = "quay.io/thanos/thanos"
// DefaultThanosImage is a default image pulling address for the Thanos long-term prometheus storage collector
DefaultThanosImage = DefaultThanosBaseImage + ":" + DefaultThanosVersion
) )
var ( var (
// DefaultPrometheusVersion is a default image tag for the prometheus
DefaultPrometheusVersion = PrometheusCompatibilityMatrix[len(PrometheusCompatibilityMatrix)-1]
// DefaultPrometheusBaseImage is a base container registry address for the prometheus
DefaultPrometheusBaseImage = "quay.io/prometheus/prometheus"
// DefaultPrometheusImage is a default image pulling address for the prometheus
DefaultPrometheusImage = DefaultPrometheusBaseImage + ":" + DefaultPrometheusVersion
// DefaultPrometheusConfigReloaderImage is an image that will be used as a sidecar to provide dynamic prometheus
// configuration reloading
DefaultPrometheusConfigReloaderImage = "quay.io/prometheus-operator/prometheus-config-reloader:v" + version.Version DefaultPrometheusConfigReloaderImage = "quay.io/prometheus-operator/prometheus-config-reloader:v" + version.Version
// PrometheusCompatibilityMatrix is a list of supported prometheus version
PrometheusCompatibilityMatrix = []string{ PrometheusCompatibilityMatrix = []string{
"v2.0.0", "v2.0.0",
"v2.2.1", "v2.2.1",
@ -75,7 +93,4 @@ var (
"v2.27.0", "v2.27.0",
"v2.27.1", "v2.27.1",
} }
DefaultPrometheusVersion = PrometheusCompatibilityMatrix[len(PrometheusCompatibilityMatrix)-1]
DefaultPrometheusBaseImage = "quay.io/prometheus/prometheus"
DefaultPrometheusImage = DefaultPrometheusBaseImage + ":" + DefaultPrometheusVersion
) )

View file

@ -325,7 +325,7 @@ func SanitizeSTS(sts *appsv1.StatefulSet) {
} }
} }
// WaitForCacheSync synchronizes the informer's cache and will log a warning // WaitForNamedCacheSync synchronizes the informer's cache and will log a warning
// every minute if the operation hasn't completed yet. // every minute if the operation hasn't completed yet.
// Under normal circumstances, the cache sync should be fast. If it takes more // Under normal circumstances, the cache sync should be fast. If it takes more
// than 1 minute, it means that something is stuck and the message will // than 1 minute, it means that something is stuck and the message will

View file

@ -1729,7 +1729,7 @@ func TestEnableFeaturesWithMultipleFeature(t *testing.T) {
} }
func TestWebPageTitle(t *testing.T) { func TestWebPageTitle(t *testing.T) {
var pageTitle string = "my-page-title" pageTitle := "my-page-title"
sset, err := makeStatefulSet("test", monitoringv1.Prometheus{ sset, err := makeStatefulSet("test", monitoringv1.Prometheus{
Spec: monitoringv1.PrometheusSpec{ Spec: monitoringv1.PrometheusSpec{
Web: &monitoringv1.WebSpec{ Web: &monitoringv1.WebSpec{

View file

@ -6,11 +6,11 @@ require (
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/brancz/gojsontoyaml v0.0.0-20191212081931-bf2969bbd742 github.com/brancz/gojsontoyaml v0.0.0-20191212081931-bf2969bbd742
github.com/campoy/embedmd v1.0.0 github.com/campoy/embedmd v1.0.0
github.com/golangci/golangci-lint v1.33.0 github.com/golangci/golangci-lint v1.40.1
github.com/google/go-jsonnet v0.17.0 github.com/google/go-jsonnet v0.17.0
github.com/jsonnet-bundler/jsonnet-bundler v0.3.1 github.com/jsonnet-bundler/jsonnet-bundler v0.3.1
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/yeya24/promlinter v0.0.0-20201120174540-eec9e2ee3b40 github.com/yeya24/promlinter v0.1.0
k8s.io/code-generator v0.18.2 k8s.io/code-generator v0.18.2
sigs.k8s.io/controller-tools v0.4.1 sigs.k8s.io/controller-tools v0.4.1
) )

File diff suppressed because it is too large Load diff

View file

@ -62,11 +62,7 @@ func deleteReplicationControllerViaYml(kubeClient kubernetes.Interface, namespac
return err return err
} }
if err := kubeClient.CoreV1().ReplicationControllers(namespace).Delete(context.TODO(), rC.Name, metav1.DeleteOptions{}); err != nil { return kubeClient.CoreV1().ReplicationControllers(namespace).Delete(context.TODO(), rC.Name, metav1.DeleteOptions{})
return err
}
return nil
} }
func scaleDownReplicationController(kubeClient kubernetes.Interface, namespace string, rC v1.ReplicationController) error { func scaleDownReplicationController(kubeClient kubernetes.Interface, namespace string, rC v1.ReplicationController) error {