Skip to content

Commit b75f814

Browse files
committed
Add kuttl tests for prometheus configuration
This patch adds some required prometheus secret for kuttl jobs to run and adds validation checks. Also, it modifies the watcher_deploy make target to create a secret so that the watcher can be deployed until the secret is created by the telemetry operator.
1 parent e061732 commit b75f814

File tree

13 files changed

+134
-1
lines changed

13 files changed

+134
-1
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,20 @@ watcher: export CATALOG_IMG=${CATALOG_IMAGE}
381381
watcher: ## Install watcher operator via olm
382382
bash ci/olm.sh
383383
oc apply -f ci/olm.yaml
384+
timeout 300s bash -c "while ! (oc get csv -n openshift-operators -l operators.coreos.com/cluster-observability-operator.openshift-operators -o jsonpath='{.items[*].status.phase}' | grep Succeeded); do sleep 10; done"
384385
timeout 300s bash -c "while ! (oc get csv -n openstack-operators -l operators.coreos.com/watcher-operator.openstack-operators -o jsonpath='{.items[*].status.phase}' | grep Succeeded); do sleep 1; done"
385386

386387
.PHONY: watcher_deploy
387388
watcher_deploy: ## Deploy watcher service
389+
oc apply -f config/samples/watcher_requirements.yaml
388390
oc apply -f config/samples/watcher_v1beta1_watcher.yaml
391+
oc wait watcher watcher --for condition=Ready --timeout=600s
389392

390393
.PHONY: watcher_deploy_cleanup
391394
watcher_deploy_cleanup: ## Undeploy watcher service
392395
oc delete -f config/samples/watcher_v1beta1_watcher.yaml
396+
oc delete -f config/samples/watcher_requirements.yaml
397+
timeout 300s bash -c "while (oc get watcher watcher); do sleep 10; done"
393398

394399
.PHONY: watcher_cleanup
395400
watcher_cleanup: export CATALOG_IMG=${CATALOG_IMAGE}

ci/olm.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
cat > ci/olm.yaml <<EOF_CAT
22
---
3+
apiVersion: operators.coreos.com/v1alpha1
4+
kind: Subscription
5+
metadata:
6+
name: cluster-observability-operator
7+
namespace: openshift-operators
8+
spec:
9+
channel: development
10+
installPlanApproval: Automatic
11+
name: cluster-observability-operator
12+
source: redhat-operators
13+
sourceNamespace: openshift-marketplace
14+
---
315
apiVersion: v1
416
kind: Namespace
517
metadata:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: metric-storage-prometheus-config
5+
namespace: openstack
6+
stringData:
7+
host: metric-storage-prometheus.openstack.svc
8+
port: "9090"
9+
ca_secret: "combined-ca-bundle"
10+
ca_key: "internal-ca-bundle.pem"

tests/kuttl/test-suites/default/common/cleanup-errors.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,13 @@ metadata:
110110
finalizers:
111111
- openstack.org/watcherdecisionengine
112112
name: watcherdecisionengine-kuttl
113+
---
114+
apiVersion: v1
115+
kind: Secret
116+
metadata:
117+
name: metric-storage-prometheus-config
118+
---
119+
apiVersion: v1
120+
kind: Secret
121+
metadata:
122+
name: custom-prometheus-config

tests/kuttl/test-suites/default/common/cleanup-watcher.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,9 @@ delete:
44
- apiVersion: watcher.openstack.org/v1beta1
55
kind: Watcher
66
name: watcher-kuttl
7+
- apiVersion: v1
8+
kind: Secret
9+
name: metric-storage-prometheus-config
10+
- apiVersion: v1
11+
kind: Secret
12+
name: custom-prometheus-config

tests/kuttl/test-suites/default/common/deploy-with-defaults.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: metric-storage-prometheus-config
5+
namespace: watcher-kuttl-default
6+
stringData:
7+
host: metric-storage-prometheus.watcher-kuttl-default.svc
8+
port: "9090"
9+
ca_secret: "combined-ca-bundle"
10+
ca_key: "internal-ca-bundle.pem"
11+
---
112
apiVersion: watcher.openstack.org/v1beta1
213
kind: Watcher
314
metadata:

tests/kuttl/test-suites/default/deps/infra.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ spec:
3131
cinder:
3232
enabled: false
3333
telemetry:
34-
enabled: false
34+
enabled: true

tests/kuttl/test-suites/default/deps/kustomization.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ namespace: watcher-kuttl-default
55
secretGenerator:
66
- literals:
77
- AdminPassword=password
8+
- AodhPassword=password
9+
- CeilometerPassword=password
810
- DbRootPassword=password
911
- DatabasePassword=password
1012
- WatcherPassword=password
@@ -40,3 +42,4 @@ patches:
4042
secret: osp-secret
4143
- path: infra.yaml
4244
- path: keystone.yaml
45+
- path: telemetry.yaml
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: core.openstack.org/v1beta1
2+
kind: OpenStackControlPlane
3+
metadata:
4+
name: openstack
5+
spec:
6+
telemetry:
7+
template:
8+
metricStorage:
9+
enabled: true
10+
dashboardsEnabled: true
11+
monitoringStack:
12+
alertingEnabled: true
13+
scrapeInterval: 30s
14+
storage:
15+
strategy: persistent
16+
retention: 24h
17+
persistent:
18+
pvcStorageRequest: 1G
19+
autoscaling:
20+
enabled: false
21+
aodh:
22+
passwordSelectors:
23+
databaseAccount: aodh
24+
databaseInstance: openstack
25+
secret: osp-secret
26+
heatInstance: heat
27+
ceilometer:
28+
enabled: true
29+
secret: osp-secret
30+
passwordSelector:
31+
aodhService: AodhPassword
32+
ceilometerService: CeilometerPassword
33+
serviceUser: ceilometer
34+
logging:
35+
enabled: false

tests/kuttl/test-suites/default/watcher-api-service-override/01-deploy-with-defaults.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: metric-storage-prometheus-config
5+
namespace: watcher-kuttl-default
6+
stringData:
7+
host: metric-storage-prometheus.watcher-kuttl-default.svc
8+
port: "9090"
9+
ca_secret: "combined-ca-bundle"
10+
ca_key: "internal-ca-bundle.pem"
11+
---
112
apiVersion: watcher.openstack.org/v1beta1
213
kind: Watcher
314
metadata:

0 commit comments

Comments
 (0)