From 6a9845722a56b261b21a39cbf21e9c10c93f5fda Mon Sep 17 00:00:00 2001 From: Lars Kellogg-Stedman Date: Thu, 23 Jun 2022 12:20:46 -0400 Subject: [PATCH] Fake metrics endpoint to make ODF happy While the "monitoring-endpoint" configuration in OCS 4.8 was optional, it appears to be required in 4.10, and ODF refuses to deploy if it can't reach the endpoint. This commit provides a fake metrics endpoint to make the ODF operator happy. --- fake-metrics-server/base/deploy.yaml | 13 +++++++++++++ fake-metrics-server/base/kustomization.yaml | 8 ++++++++ fake-metrics-server/base/service.yaml | 8 ++++++++ .../overlays/nerc-ocp-infra/deploy_patch.yaml | 17 +++++++++++++++++ .../overlays/nerc-ocp-infra/kustomization.yaml | 13 +++++++++++++ .../overlays/nerc-ocp-infra/metrics.json | 16 ++++++++++++++++ 6 files changed, 75 insertions(+) create mode 100644 fake-metrics-server/base/deploy.yaml create mode 100644 fake-metrics-server/base/kustomization.yaml create mode 100644 fake-metrics-server/base/service.yaml create mode 100644 fake-metrics-server/overlays/nerc-ocp-infra/deploy_patch.yaml create mode 100644 fake-metrics-server/overlays/nerc-ocp-infra/kustomization.yaml create mode 100644 fake-metrics-server/overlays/nerc-ocp-infra/metrics.json diff --git a/fake-metrics-server/base/deploy.yaml b/fake-metrics-server/base/deploy.yaml new file mode 100644 index 00000000..604f5dd1 --- /dev/null +++ b/fake-metrics-server/base/deploy.yaml @@ -0,0 +1,13 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fake-metrics-exporter +spec: + template: + spec: + containers: + - name: fake-metrics-exporter + image: quay.io/larsks/fake-metrics-exporter:v0.1.0 + ports: + - name: metrics + containerPort: 9283 diff --git a/fake-metrics-server/base/kustomization.yaml b/fake-metrics-server/base/kustomization.yaml new file mode 100644 index 00000000..126a8eca --- /dev/null +++ b/fake-metrics-server/base/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-storage +commonLabels: + app: fake-metrics-server +resources: +- deploy.yaml +- service.yaml diff --git a/fake-metrics-server/base/service.yaml b/fake-metrics-server/base/service.yaml new file mode 100644 index 00000000..a9e64585 --- /dev/null +++ b/fake-metrics-server/base/service.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Service +metadata: + name: fake-metrics-exporter +spec: + ports: + - port: 9283 + targetPort: metrics diff --git a/fake-metrics-server/overlays/nerc-ocp-infra/deploy_patch.yaml b/fake-metrics-server/overlays/nerc-ocp-infra/deploy_patch.yaml new file mode 100644 index 00000000..24718b85 --- /dev/null +++ b/fake-metrics-server/overlays/nerc-ocp-infra/deploy_patch.yaml @@ -0,0 +1,17 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fake-metrics-exporter +spec: + template: + spec: + volumes: + - name: fake-metrics + configMap: + name: fake-metrics + containers: + - name: fake-metrics-exporter + volumeMounts: + - name: fake-metrics + mountPath: /metrics.json + subPath: metrics.json diff --git a/fake-metrics-server/overlays/nerc-ocp-infra/kustomization.yaml b/fake-metrics-server/overlays/nerc-ocp-infra/kustomization.yaml new file mode 100644 index 00000000..56ec87ff --- /dev/null +++ b/fake-metrics-server/overlays/nerc-ocp-infra/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: openshift-storage +resources: +- ../../base/ + +patches: + - path: deploy_patch.yaml + +configMapGenerator: + - name: fake-metrics + files: + - metrics.json diff --git a/fake-metrics-server/overlays/nerc-ocp-infra/metrics.json b/fake-metrics-server/overlays/nerc-ocp-infra/metrics.json new file mode 100644 index 00000000..5ef9270e --- /dev/null +++ b/fake-metrics-server/overlays/nerc-ocp-infra/metrics.json @@ -0,0 +1,16 @@ +{ + "ceph_health_status": 0.0, + "ceph_osd_flag_noup": 0.0, + "ceph_osd_flag_nodown": 0.0, + "ceph_osd_flag_noout": 0.0, + "ceph_osd_flag_noin": 0.0, + "ceph_osd_flag_nobackfill": 0.0, + "ceph_osd_flag_norebalance": 0.0, + "ceph_osd_flag_norecover": 0.0, + "ceph_osd_flag_noscrub": 0.0, + "ceph_osd_flag_nodeep_scrub": 0.0, + "ceph_num_objects_degraded": 0.0, + "ceph_num_objects_misplaced": 0.0, + "ceph_num_objects_unfound": 0.0, + "ceph_healthcheck_slow_ops": 0.0 +}