Skip to content

Commit

Permalink
feat: update prometheus-operator dependency in go.mod (#140)
Browse files Browse the repository at this point in the history
* feat: update prometheus-operator dependency in go.mod

This updates the prometheus-operator go dependency to v0.55.0. This
allows specifiying additional auth options in remote_write sections.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* fix: adjust usage of PrometheusSpec type

Problem: Embedded structs can as of yet not be directly referenced in struct
literals.

Solution: Explicitly use the embedded structs.

Issues: golang/go#9859,
prometheus-operator/prometheus-operator#4539

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* refactor: generate dependencies from prometheus-operator repo

There is no need to track the prometheus-operator dependencies, they can
just be generated from the upstream artifacts.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* feat: bump prometheus-operator dependency to v0.55.1

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* refactor: generate monitoring related CRD manifests

This adds a Makefile target to generate the prometheus-operator related
CRD manifests with controller-gen. For this controller-gen will respect
the prometheus-operator version specified in go.mod.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
  • Loading branch information
jan--f committed May 30, 2022
1 parent b505369 commit fd6b78c
Show file tree
Hide file tree
Showing 30 changed files with 27,384 additions and 25,018 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,18 @@ docs: $(CRDOC)
mkdir -p docs
$(CRDOC) --resources deploy/crds/common --output docs/api.md

# This generates the prometheus-operator CRD manifests from the
# prometheus-operator dependency defined in go.mod. This ensures we carry the
# correct version of the CRD manifests.
.PHONY: generate-prom-op-crds
generate-prom-operator-crds: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) crd \
paths=github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/... \
output:dir=. \
output:crd:dir=./deploy/crds/kubernetes

.PHONY: generate-crds
generate-crds: $(CONTROLLER_GEN)
generate-crds: $(CONTROLLER_GEN) generate-prom-op-crds
$(CONTROLLER_GEN) crd \
paths=./pkg/apis/... \
paths=./pkg/controllers/... \
Expand Down
226 changes: 215 additions & 11 deletions deploy/crds/common/monitoring.rhobs_monitoringstacks.yaml

Large diffs are not rendered by default.

2,844 changes: 0 additions & 2,844 deletions deploy/crds/kubernetes/alertmanagerconfigs.yaml

This file was deleted.

5,872 changes: 0 additions & 5,872 deletions deploy/crds/kubernetes/alertmanagers.yaml

This file was deleted.

18 changes: 9 additions & 9 deletions deploy/crds/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
resources:
- ../common
- alertmanagerconfigs.yaml
- alertmanagers.yaml
- podmonitors.yaml
- probes.yaml
- prometheuses.yaml
- prometheusrules.yaml
- servicemonitors.yaml
- thanosrulers.yaml
- ../common
- monitoring.coreos.com_alertmanagerconfigs.yaml
- monitoring.coreos.com_alertmanagers.yaml
- monitoring.coreos.com_podmonitors.yaml
- monitoring.coreos.com_probes.yaml
- monitoring.coreos.com_prometheuses.yaml
- monitoring.coreos.com_prometheusrules.yaml
- monitoring.coreos.com_servicemonitors.yaml
- monitoring.coreos.com_thanosrulers.yaml
3,966 changes: 3,966 additions & 0 deletions deploy/crds/kubernetes/monitoring.coreos.com_alertmanagerconfigs.yaml

Large diffs are not rendered by default.

6,059 changes: 6,059 additions & 0 deletions deploy/crds/kubernetes/monitoring.coreos.com_alertmanagers.yaml

Large diffs are not rendered by default.

613 changes: 613 additions & 0 deletions deploy/crds/kubernetes/monitoring.coreos.com_podmonitors.yaml

Large diffs are not rendered by default.

655 changes: 655 additions & 0 deletions deploy/crds/kubernetes/monitoring.coreos.com_probes.yaml

Large diffs are not rendered by default.

8,324 changes: 8,324 additions & 0 deletions deploy/crds/kubernetes/monitoring.coreos.com_prometheuses.yaml

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions deploy/crds/kubernetes/monitoring.coreos.com_prometheusrules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: prometheusrules.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
categories:
- prometheus-operator
kind: PrometheusRule
listKind: PrometheusRuleList
plural: prometheusrules
singular: prometheusrule
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: PrometheusRule defines recording and alerting rules for a Prometheus
instance
properties:
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'
type: string
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'
type: string
metadata:
type: object
spec:
description: Specification of desired alerting rule definitions for Prometheus.
properties:
groups:
description: Content of Prometheus rule file
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/main/docs/components/rule.md#partial-response'
properties:
interval:
type: string
name:
type: string
partial_response_strategy:
type: string
rules:
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'
properties:
alert:
type: string
annotations:
additionalProperties:
type: string
type: object
expr:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
for:
type: string
labels:
additionalProperties:
type: string
type: object
record:
type: string
required:
- expr
type: object
type: array
required:
- name
- rules
type: object
type: array
type: object
required:
- spec
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit fd6b78c

Please sign in to comment.