Skip to content

Commit 087371e

Browse files
Commit prometheus-operator CRDs (#286)
Co-authored-by: ArthurSens <[email protected]>
1 parent 689ad69 commit 087371e

15 files changed

+19340
-26
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ diff
1212
!monitoring-satellite/manifests/kubescape/*
1313
!monitoring-satellite/manifests/probers/*
1414
!monitoring-satellite/manifests/kube-prometheus-rules/*
15+
!monitoring-satellite/manifests/crds/*

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ repos:
4444
language: golang
4545
pass_filenames: false
4646

47-
exclude: (^vendor|^hack\/deploy-.*)
47+
exclude: (^vendor|^hack\/deploy-.*|^monitoring-satellite\/manifests\/)

hack/deploy-crds.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ if [[ $KUBECONFIG != "" ]]; then
2323
KUBECONFIG_FLAG="--kubeconfig ${KUBECONFIG}"
2424
fi
2525

26-
# shellcheck disable=SC2044
27-
for CRD in $(find monitoring-satellite/manifests/prometheusOperator/ -type f -name "*CustomResourceDefinition.yaml");
28-
do
29-
kubectl $KUBECONFIG_FLAG replace -f $CRD || kubectl $KUBECONFIG_FLAG create -f $CRD
30-
done
26+
kubectl $KUBECONFIG_FLAG apply -f monitoring-satellite/manifests/crds/ --server-side
3127

3228
until kubectl $KUBECONFIG_FLAG get servicemonitors.monitoring.coreos.com --all-namespaces ; do date; sleep 1; echo ""; done
3329
until kubectl $KUBECONFIG_FLAG get prometheusrules.monitoring.coreos.com --all-namespaces ; do date; sleep 1; echo ""; done
34-
35-
kubectl $KUBECONFIG_FLAG apply -f monitoring-satellite/manifests/pyrra/crd.yaml

hack/prepare-kind.sh

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#!/bin/bash
22

33
# shellcheck disable=SC2230
4-
if [[ $(which kind) != 0 ]]; then
5-
# shellcheck disable=SC2016
6-
echo 'kind not available in $PATH, installing latest kind'
7-
# Install latest kind
8-
curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest \
9-
| grep "browser_download_url.*kind-linux-amd64" \
10-
| cut -d : -f 2,3 \
11-
| tr -d \" \
12-
| wget -qi -
13-
sudo mv kind-linux-amd64 /usr/bin/kind && sudo chmod +x /usr/bin/kind
14-
rm -f kind-linux-amd64*
4+
if ! command -v kind; then
5+
# shellcheck disable=SC2016
6+
echo 'kind not available in $PATH, installing latest kind'
7+
# Install latest kind
8+
curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest |
9+
grep "browser_download_url.*kind-linux-amd64" |
10+
cut -d : -f 2,3 |
11+
tr -d \" |
12+
wget -qi -
13+
sudo mv kind-linux-amd64 /usr/bin/kind && sudo chmod +x /usr/bin/kind
14+
rm -f kind-linux-amd64*
1515
fi
1616

1717
cluster_created=$(kind get clusters 2>&1)
1818
if [[ "$cluster_created" == "No kind clusters found." ]]; then
19-
kind create cluster --config "${PWD}"/.github/workflows/kind/config.yml
19+
kind create cluster --config "${PWD}"/.github/workflows/kind/config.yml
2020
else
21-
echo "Cluster ${cluster_created} already present"
21+
echo "Cluster ${cluster_created} already present"
2222
fi

installer/pkg/config/config.go

-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ func Defaults(in interface{}) error {
2929
Install: false,
3030
}
3131

32-
cfg.Prometheus = &Prometheus{
33-
RemoteWrite: []*RemoteWrite{},
34-
}
35-
3632
cfg.Pyrra = &Pyrra{
3733
Install: false,
3834
}

monitoring-satellite/manifests/crds/prometheusOperator-0alertmanagerConfigCustomResourceDefinition.yaml

+3,397
Large diffs are not rendered by default.

monitoring-satellite/manifests/crds/prometheusOperator-0alertmanagerCustomResourceDefinition.yaml

+4,257
Large diffs are not rendered by default.

monitoring-satellite/manifests/crds/prometheusOperator-0podmonitorCustomResourceDefinition.yaml

+529
Large diffs are not rendered by default.

monitoring-satellite/manifests/crds/prometheusOperator-0probeCustomResourceDefinition.yaml

+567
Large diffs are not rendered by default.

monitoring-satellite/manifests/crds/prometheusOperator-0prometheusCustomResourceDefinition.yaml

+5,782
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
argocd.argoproj.io/sync-options: Replace=true
6+
controller-gen.kubebuilder.io/version: v0.9.2
7+
creationTimestamp: null
8+
name: prometheusrules.monitoring.coreos.com
9+
spec:
10+
group: monitoring.coreos.com
11+
names:
12+
categories:
13+
- prometheus-operator
14+
kind: PrometheusRule
15+
listKind: PrometheusRuleList
16+
plural: prometheusrules
17+
shortNames:
18+
- promrule
19+
singular: prometheusrule
20+
scope: Namespaced
21+
versions:
22+
- name: v1
23+
schema:
24+
openAPIV3Schema:
25+
description: PrometheusRule defines recording and alerting rules for a Prometheus instance
26+
properties:
27+
apiVersion:
28+
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'
29+
type: string
30+
kind:
31+
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'
32+
type: string
33+
metadata:
34+
type: object
35+
spec:
36+
description: Specification of desired alerting rule definitions for Prometheus.
37+
properties:
38+
groups:
39+
description: Content of Prometheus rule file
40+
items:
41+
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'
42+
properties:
43+
interval:
44+
type: string
45+
name:
46+
type: string
47+
partial_response_strategy:
48+
type: string
49+
rules:
50+
items:
51+
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'
52+
properties:
53+
alert:
54+
type: string
55+
annotations:
56+
additionalProperties:
57+
type: string
58+
type: object
59+
expr:
60+
anyOf:
61+
- type: integer
62+
- type: string
63+
x-kubernetes-int-or-string: true
64+
for:
65+
type: string
66+
labels:
67+
additionalProperties:
68+
type: string
69+
type: object
70+
record:
71+
type: string
72+
required:
73+
- expr
74+
type: object
75+
type: array
76+
required:
77+
- name
78+
- rules
79+
type: object
80+
type: array
81+
type: object
82+
required:
83+
- spec
84+
type: object
85+
served: true
86+
storage: true

0 commit comments

Comments
 (0)