diff --git a/Makefile b/Makefile index 5f7ff3d..cd969a5 100644 --- a/Makefile +++ b/Makefile @@ -381,15 +381,20 @@ watcher: export CATALOG_IMG=${CATALOG_IMAGE} watcher: ## Install watcher operator via olm bash ci/olm.sh oc apply -f ci/olm.yaml + 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" 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" .PHONY: watcher_deploy watcher_deploy: ## Deploy watcher service + oc apply -f config/samples/watcher_requirements.yaml oc apply -f config/samples/watcher_v1beta1_watcher.yaml + oc wait watcher watcher --for condition=Ready --timeout=600s .PHONY: watcher_deploy_cleanup watcher_deploy_cleanup: ## Undeploy watcher service oc delete -f config/samples/watcher_v1beta1_watcher.yaml + oc delete -f config/samples/watcher_requirements.yaml + timeout 300s bash -c "while (oc get watcher watcher); do sleep 10; done" .PHONY: watcher_cleanup watcher_cleanup: export CATALOG_IMG=${CATALOG_IMAGE} diff --git a/api/bases/watcher.openstack.org_watcherapis.yaml b/api/bases/watcher.openstack.org_watcherapis.yaml index 1c25bb1..27c8fbc 100644 --- a/api/bases/watcher.openstack.org_watcherapis.yaml +++ b/api/bases/watcher.openstack.org_watcherapis.yaml @@ -123,6 +123,10 @@ spec: description: PreserveJobs - do not delete jobs after they finished e.g. to check logs type: boolean + prometheusSecret: + default: metric-storage-prometheus-config + description: Secret containing prometheus connection parameters + type: string replicas: default: 1 description: Replicas of Watcher service to run diff --git a/api/bases/watcher.openstack.org_watcherappliers.yaml b/api/bases/watcher.openstack.org_watcherappliers.yaml index f55ce34..611cdbb 100644 --- a/api/bases/watcher.openstack.org_watcherappliers.yaml +++ b/api/bases/watcher.openstack.org_watcherappliers.yaml @@ -78,6 +78,10 @@ spec: description: PreserveJobs - do not delete jobs after they finished e.g. to check logs type: boolean + prometheusSecret: + default: metric-storage-prometheus-config + description: Secret containing prometheus connection parameters + type: string replicas: default: 1 description: Replicas of Watcher service to run diff --git a/api/bases/watcher.openstack.org_watcherdecisionengines.yaml b/api/bases/watcher.openstack.org_watcherdecisionengines.yaml index 782ceec..1bb18bf 100644 --- a/api/bases/watcher.openstack.org_watcherdecisionengines.yaml +++ b/api/bases/watcher.openstack.org_watcherdecisionengines.yaml @@ -79,6 +79,10 @@ spec: description: PreserveJobs - do not delete jobs after they finished e.g. to check logs type: boolean + prometheusSecret: + default: metric-storage-prometheus-config + description: Secret containing prometheus connection parameters + type: string replicas: default: 1 description: Replicas of Watcher service to run diff --git a/api/bases/watcher.openstack.org_watchers.yaml b/api/bases/watcher.openstack.org_watchers.yaml index 0cf1cb3..2ab4939 100644 --- a/api/bases/watcher.openstack.org_watchers.yaml +++ b/api/bases/watcher.openstack.org_watchers.yaml @@ -221,6 +221,10 @@ spec: description: PreserveJobs - do not delete jobs after they finished e.g. to check logs type: boolean + prometheusSecret: + default: metric-storage-prometheus-config + description: Secret containing prometheus connection parameters + type: string rabbitMqClusterName: default: rabbitmq description: |- diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index c760c30..e59cbb7 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -64,6 +64,11 @@ type WatcherCommon struct { // to /etc//.conf.d directory as a custom config file. CustomServiceConfig string `json:"customServiceConfig,omitempty"` + // +kubebuilder:validation:Optional + // +kubebuilder:default=metric-storage-prometheus-config + // Secret containing prometheus connection parameters + PrometheusSecret string `json:"prometheusSecret"` + // +kubebuilder:validation:Optional // +operator-sdk:csv:customresourcedefinitions:type=spec // TLS - Parameters related to the TLS diff --git a/api/v1beta1/conditions.go b/api/v1beta1/conditions.go index 3beed3f..6f8e9fb 100644 --- a/api/v1beta1/conditions.go +++ b/api/v1beta1/conditions.go @@ -24,4 +24,6 @@ const ( WatcherAPIReadyMessage = "WatcherAPI successfully created" // WatcherAPIReadyErrorMessage - WatcherAPIReadyErrorMessage = "WatcherAPI error occured %s" + // WatcherPrometheusSecretErrorMessage - + WatcherPrometheusSecretErrorMessage = "Error with prometheus config secret" ) diff --git a/ci/olm.sh b/ci/olm.sh index 2c71c2e..77cd8a8 100644 --- a/ci/olm.sh +++ b/ci/olm.sh @@ -1,5 +1,17 @@ cat > ci/olm.yaml <