Skip to content

Commit 1ad32f9

Browse files
committed
cluster/sync: Deploy prometheus object if CRDs are deployed
Signed-off-by: Ram Lavi <ralavi@redhat.com>
1 parent ee26b7a commit 1ad32f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cluster/sync.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ set -ex
1919
source ./cluster/cluster.sh
2020
cluster::install
2121

22+
monitoring_enabled() {
23+
./cluster/kubectl.sh get crd servicemonitors.monitoring.coreos.com >/dev/null 2>&1 &&
24+
./cluster/kubectl.sh get crd prometheusrules.monitoring.coreos.com >/dev/null 2>&1
25+
}
26+
2227
if [[ "$KUBEVIRT_PROVIDER" == external ]]; then
2328
if [[ ! -v DEV_REGISTRY ]]; then
2429
echo "Missing DEV_REGISTRY variable"
@@ -49,6 +54,10 @@ done
4954

5055
./cluster/kubectl.sh apply -f $config_dir/kubemacpool.yaml
5156

57+
if monitoring_enabled; then
58+
./cluster/kubectl.sh apply -f "$config_dir/kubemacpool-monitoring.yaml"
59+
fi
60+
5261
pods_ready_wait() {
5362
if [[ "$KUBEVIRT_PROVIDER" != external ]]; then
5463
echo "Waiting for non-kubemacpool containers to be ready ..."

0 commit comments

Comments
 (0)