From b13cc1f30b82e4ec1e2896d8770f1369a59e4ef2 Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Mon, 23 Aug 2021 14:03:41 -0700 Subject: [PATCH 01/42] Keycloack over ODF test app --- keycloak-odf/keycloak-app.yaml | 49 +++++++++++++++++++ keycloak-odf/keycloak-postgres.yaml | 34 +++++++++++++ keycloak-odf/keycloak-route.yaml | 10 ++++ keycloak-odf/keycloak-service.yaml | 14 ++++++ keycloak-odf/kustomization.yaml | 5 ++ subscriptions/channel/channel.yaml | 2 +- subscriptions/helloworld/channel.yaml | 2 +- subscriptions/helloworld/subscription.yaml | 9 ++-- subscriptions/keycloack-odf/application.yaml | 15 ++++++ subscriptions/keycloack-odf/channel.yaml | 8 +++ .../keycloack-odf/kustomization.yaml | 6 +++ subscriptions/keycloack-odf/namespace.yaml | 9 ++++ subscriptions/keycloack-odf/placement.yaml | 12 +++++ subscriptions/keycloack-odf/subscription.yaml | 18 +++++++ 14 files changed, 187 insertions(+), 6 deletions(-) create mode 100644 keycloak-odf/keycloak-app.yaml create mode 100644 keycloak-odf/keycloak-postgres.yaml create mode 100644 keycloak-odf/keycloak-route.yaml create mode 100644 keycloak-odf/keycloak-service.yaml create mode 100644 keycloak-odf/kustomization.yaml create mode 100755 subscriptions/keycloack-odf/application.yaml create mode 100755 subscriptions/keycloack-odf/channel.yaml create mode 100644 subscriptions/keycloack-odf/kustomization.yaml create mode 100644 subscriptions/keycloack-odf/namespace.yaml create mode 100755 subscriptions/keycloack-odf/placement.yaml create mode 100755 subscriptions/keycloack-odf/subscription.yaml diff --git a/keycloak-odf/keycloak-app.yaml b/keycloak-odf/keycloak-app.yaml new file mode 100644 index 0000000..8912d41 --- /dev/null +++ b/keycloak-odf/keycloak-app.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: keycloak-odf-app +# namespace: postgres-operator + namespace: keycloak-odf + labels: + app.kubernetes.io/name: keycloak-odf-app +spec: + selector: + matchLabels: + app.kubernetes.io/name: keycloak-odf-app + template: + metadata: + labels: + app.kubernetes.io/name: keycloak-odf-app + spec: + containers: + - image: quay.io/keycloak/keycloak:latest + name: keycloak + env: + - name: DB_VENDOR + value: "postgres" + - name: DB_ADDR + valueFrom: { secretKeyRef: { name: keycloak-odf-db-pguser-keycloak-odf-db, key: host } } + - name: DB_PORT + valueFrom: { secretKeyRef: { name: keycloak-odf-db-pguser-keycloak-odf-db, key: port } } + - name: DB_DATABASE + valueFrom: { secretKeyRef: { name: keycloak-odf-db-pguser-keycloak-odf-db, key: dbname } } + - name: DB_USER + valueFrom: { secretKeyRef: { name: keycloak-odf-db-pguser-keycloak-odf-db, key: user } } + - name: DB_PASSWORD + valueFrom: { secretKeyRef: { name: keycloak-odf-db-pguser-keycloak-odf-db, key: password } } + - name: KEYCLOAK_USER + value: "admin" + - name: KEYCLOAK_PASSWORD + value: "admin" + - name: PROXY_ADDRESS_FORWARDING + value: "true" + ports: + - name: http + containerPort: 8080 + - name: https + containerPort: 8443 + readinessProbe: + httpGet: + path: /auth/realms/master + port: 8080 + restartPolicy: Always diff --git a/keycloak-odf/keycloak-postgres.yaml b/keycloak-odf/keycloak-postgres.yaml new file mode 100644 index 0000000..a00182d --- /dev/null +++ b/keycloak-odf/keycloak-postgres.yaml @@ -0,0 +1,34 @@ +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: keycloak-odf-db + namespace: keycloak-odf +spec: + image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-ha:centos8-13.3-1 + postgresVersion: 13 + instances: + - replicas: 1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 10Gi +# storageClassName: ocs-storagecluster-ceph-rbd + storageClassName: gp2 + backups: + pgbackrest: + image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.33-1 + repoHost: + dedicated: {} + repos: + - name: repo1 + volume: + volumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 10Gi +# storageClassName: ocs-storagecluster-ceph-rbd + storageClassName: gp2 diff --git a/keycloak-odf/keycloak-route.yaml b/keycloak-odf/keycloak-route.yaml new file mode 100644 index 0000000..caa8f72 --- /dev/null +++ b/keycloak-odf/keycloak-route.yaml @@ -0,0 +1,10 @@ +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + name: keycloak-odf +spec: +# host: keycloak-odf.apps.ocpacm.ocstraining.com + tls: + termination: passthrough + to: + name: keycloak-odf diff --git a/keycloak-odf/keycloak-service.yaml b/keycloak-odf/keycloak-service.yaml new file mode 100644 index 0000000..271d7d3 --- /dev/null +++ b/keycloak-odf/keycloak-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: keycloak-odf + labels: + name: keycloak-odf +spec: + type: ClusterIP + ports: + - port: 8443 + targetPort: 8443 + protocol: TCP + selector: + app.kubernetes.io/name: keycloak-odf-app diff --git a/keycloak-odf/kustomization.yaml b/keycloak-odf/kustomization.yaml new file mode 100644 index 0000000..e006161 --- /dev/null +++ b/keycloak-odf/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- keycloak-postgres.yaml +- keycloak-app.yaml +- keycloak-service.yaml +- keycloak-route.yaml diff --git a/subscriptions/channel/channel.yaml b/subscriptions/channel/channel.yaml index 21e9c3f..f8c12c8 100644 --- a/subscriptions/channel/channel.yaml +++ b/subscriptions/channel/channel.yaml @@ -6,4 +6,4 @@ metadata: namespace: application-samples spec: type: GitHub - pathname: https://github.com/open-cluster-management/application-samples.git + pathname: https://github.com/jeanchlopez/application-samples.git diff --git a/subscriptions/helloworld/channel.yaml b/subscriptions/helloworld/channel.yaml index 10e9a35..60c515a 100755 --- a/subscriptions/helloworld/channel.yaml +++ b/subscriptions/helloworld/channel.yaml @@ -5,4 +5,4 @@ metadata: namespace: helloworld-ch spec: type: GitHub - pathname: https://github.com/open-cluster-management/application-samples.git + pathname: https://github.com/jeanchlopez/application-samples.git diff --git a/subscriptions/helloworld/subscription.yaml b/subscriptions/helloworld/subscription.yaml index dc7a2f6..548d08c 100755 --- a/subscriptions/helloworld/subscription.yaml +++ b/subscriptions/helloworld/subscription.yaml @@ -11,7 +11,8 @@ metadata: spec: channel: helloworld-ch/helloworld-channel placement: - placementRef: - name: helloworld-app-placement - kind: PlacementRule - group: apps.open-cluster-management.io + local: true +# placementRef: +# name: helloworld-app-placement +# kind: PlacementRule +# group: apps.open-cluster-management.io diff --git a/subscriptions/keycloack-odf/application.yaml b/subscriptions/keycloack-odf/application.yaml new file mode 100755 index 0000000..104f36b --- /dev/null +++ b/subscriptions/keycloack-odf/application.yaml @@ -0,0 +1,15 @@ +apiVersion: app.k8s.io/v1beta1 +kind: Application +metadata: + name: keycloak-odf-app + namespace: keycloak-odf +spec: + componentKinds: + - group: apps.open-cluster-management.io + kind: Subscription + selector: + matchExpressions: + - key: app + operator: In + values: + - keycloak-odf-app diff --git a/subscriptions/keycloack-odf/channel.yaml b/subscriptions/keycloack-odf/channel.yaml new file mode 100755 index 0000000..e9b33f0 --- /dev/null +++ b/subscriptions/keycloack-odf/channel.yaml @@ -0,0 +1,8 @@ +apiVersion: apps.open-cluster-management.io/v1 +kind: Channel +metadata: + name: keycloak-odf-channel + namespace: keycloak-odf-ch +spec: + type: GitHub + pathname: https://github.com/jeanchlopez/application-samples.git diff --git a/subscriptions/keycloack-odf/kustomization.yaml b/subscriptions/keycloack-odf/kustomization.yaml new file mode 100644 index 0000000..6741f81 --- /dev/null +++ b/subscriptions/keycloack-odf/kustomization.yaml @@ -0,0 +1,6 @@ +resources: +- namespace.yaml +- channel.yaml +- placement.yaml +- subscription.yaml +- application.yaml diff --git a/subscriptions/keycloack-odf/namespace.yaml b/subscriptions/keycloack-odf/namespace.yaml new file mode 100644 index 0000000..6d11d0a --- /dev/null +++ b/subscriptions/keycloack-odf/namespace.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: keycloak-odf-ch +--- +apiVersion: v1 +kind: Namespace +metadata: + name: keycloak-odf diff --git a/subscriptions/keycloack-odf/placement.yaml b/subscriptions/keycloack-odf/placement.yaml new file mode 100755 index 0000000..a55371f --- /dev/null +++ b/subscriptions/keycloack-odf/placement.yaml @@ -0,0 +1,12 @@ +apiVersion: apps.open-cluster-management.io/v1 +kind: PlacementRule +metadata: + name: keycloak-odf-app-placement + namespace: keycloak-odf + labels: + app: keycloak-odf-app +spec: + clusterReplicas: 1 + clusterSelector: + matchLabels: + usage: development diff --git a/subscriptions/keycloack-odf/subscription.yaml b/subscriptions/keycloack-odf/subscription.yaml new file mode 100755 index 0000000..af2465d --- /dev/null +++ b/subscriptions/keycloack-odf/subscription.yaml @@ -0,0 +1,18 @@ +apiVersion: apps.open-cluster-management.io/v1 +kind: Subscription +metadata: + name: keycloak-odf-app-subscription + namespace: keycloak-odf + labels: + app: keycloak-odf-app + annotations: + apps.open-cluster-management.io/github-path: keycloak-odf + apps.open-cluster-management.io/github-branch: keycload-over-odf +spec: + channel: keycloak-odf-ch/keycloak-odf-channel + placement: + local: true +# placementRef: +# name: helloworld-app-placement +# kind: PlacementRule +# group: apps.open-cluster-management.io From b17257dbf7045295e8aeb7b9050a487a7d83a28f Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Mon, 23 Aug 2021 14:24:44 -0700 Subject: [PATCH 02/42] Switch test yaml to ODF storage class for postgres --- keycloak-odf/keycloak-postgres.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keycloak-odf/keycloak-postgres.yaml b/keycloak-odf/keycloak-postgres.yaml index a00182d..d297c1b 100644 --- a/keycloak-odf/keycloak-postgres.yaml +++ b/keycloak-odf/keycloak-postgres.yaml @@ -14,8 +14,8 @@ spec: resources: requests: storage: 10Gi -# storageClassName: ocs-storagecluster-ceph-rbd - storageClassName: gp2 + storageClassName: ocs-storagecluster-ceph-rbd +# storageClassName: gp2 backups: pgbackrest: image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.33-1 @@ -30,5 +30,5 @@ spec: resources: requests: storage: 10Gi -# storageClassName: ocs-storagecluster-ceph-rbd - storageClassName: gp2 + storageClassName: ocs-storagecluster-ceph-rbd +# storageClassName: gp2 From 9bb333b50ac4050213a846b802cbec4489b305df Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Mon, 23 Aug 2021 14:57:28 -0700 Subject: [PATCH 03/42] Add README.md --- keycloak-odf/README.md | 53 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 keycloak-odf/README.md diff --git a/keycloak-odf/README.md b/keycloak-odf/README.md new file mode 100644 index 0000000..cb13af3 --- /dev/null +++ b/keycloak-odf/README.md @@ -0,0 +1,53 @@ +# Demonstrate a sample keycloak application +## Tool Requirements +- OpenShift CLI Version >= 4.3.0
_Needed for kustomize_ + +```bash +oc version +``` + +- OpenShift Data Foundation Version >= 4.4.0
_For general use case_ +- OpenShift Data Foundation Version >= 4.7.0
_For Disaster Recovery use case_ + +```bash +oc get csv pn openshift-storage +NAME DISPLAY VERSION REPLACES PHASE +ocs-operator.v4.8.0 OpenShift Container Storage 4.8.0 Succeeded +``` + +## Summary +Demonstrate a keycloak application (frontend+backend) leveraging Red Hat OpenShift Data Foundation block device capabilites when deployed using ACM. This application offers a WEB UI while using a PostgreSQL database to store its information. + +## Prerequisite + +- 1+ managed-clusters total +- Those `Managed-Cluster` to target, must have a label with `metadata.labels.usage: development` +- Target clusters must have the PostgreSQL Operator Deployed +- Target clusters must have the Red Hat OpenShift Data Foundation or the Rook-Ceph Operator deployed and an operational Ceph cluster deployed + +## Application Console: Create a new application +Using the application console, you can easily create an Application to run this demo. + +#### Console +1. Open the Red Hat Advanced Cluster Management for Kubernetes console +2. Navigate on the left navigation menu to `Managed applications` +3. Click the `Create application` button +4. Enter the following values: + * **Name:** `keycloak-odf` + * **Namespace:** `keycloak-odf` + * **Repository types:** `Git` + * **URL:** `https://github.com/open-cluster-management/application-samples.git` + * **Branch:** `main` + * **Path:** `keycloak-odf` + * Select `Deploy application resources only on clusters matching specified labels` + * **Label name:** `usage` + * **Label value:** `development` +5. Click `Save` + +### Viewing +1. Navigate on the left navigation menu to `Managed applications` +2. Click the `keycloak-odf` Application name. +3. View the Topology +4. Click the `Route` node to obtain the application URL +5. Click the URL to see the keycloak sample application + From 0631fbb990956a7c49728ad236e80341cc41b89d Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Mon, 23 Aug 2021 17:35:56 -0700 Subject: [PATCH 04/42] Simplify route naming --- keycloak-odf/keycloak-route.yaml | 4 ++-- keycloak-odf/keycloak-service.yaml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/keycloak-odf/keycloak-route.yaml b/keycloak-odf/keycloak-route.yaml index caa8f72..fa6a12c 100644 --- a/keycloak-odf/keycloak-route.yaml +++ b/keycloak-odf/keycloak-route.yaml @@ -1,10 +1,10 @@ apiVersion: route.openshift.io/v1 kind: Route metadata: - name: keycloak-odf + name: frontend spec: # host: keycloak-odf.apps.ocpacm.ocstraining.com tls: termination: passthrough to: - name: keycloak-odf + name: frontend diff --git a/keycloak-odf/keycloak-service.yaml b/keycloak-odf/keycloak-service.yaml index 271d7d3..7276eb0 100644 --- a/keycloak-odf/keycloak-service.yaml +++ b/keycloak-odf/keycloak-service.yaml @@ -1,9 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: keycloak-odf +# name: keycloak-odf + name: frontend labels: - name: keycloak-odf + name: frontend spec: type: ClusterIP ports: From dfaf715e7ab2b1a7e9b17f8108408dc01a31c9cf Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Tue, 24 Aug 2021 07:59:49 -0700 Subject: [PATCH 05/42] Final touch to README --- keycloak-odf/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keycloak-odf/README.md b/keycloak-odf/README.md index cb13af3..46f0e95 100644 --- a/keycloak-odf/README.md +++ b/keycloak-odf/README.md @@ -7,7 +7,6 @@ oc version ``` - OpenShift Data Foundation Version >= 4.4.0
_For general use case_ -- OpenShift Data Foundation Version >= 4.7.0
_For Disaster Recovery use case_ ```bash oc get csv pn openshift-storage @@ -23,7 +22,7 @@ Demonstrate a keycloak application (frontend+backend) leveraging Red Hat OpenShi - 1+ managed-clusters total - Those `Managed-Cluster` to target, must have a label with `metadata.labels.usage: development` - Target clusters must have the PostgreSQL Operator Deployed -- Target clusters must have the Red Hat OpenShift Data Foundation or the Rook-Ceph Operator deployed and an operational Ceph cluster deployed +- Target clusters must have the Red Hat OpenShift Data Foundation and an operational Ceph cluster deployed ## Application Console: Create a new application Using the application console, you can easily create an Application to run this demo. From 60a1bf9958d103a280bc2930c768ddff327c8e80 Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Tue, 24 Aug 2021 15:25:33 -0700 Subject: [PATCH 06/42] Change SC name for Annette --- keycloak-odf/keycloak-postgres.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keycloak-odf/keycloak-postgres.yaml b/keycloak-odf/keycloak-postgres.yaml index d297c1b..7e23f26 100644 --- a/keycloak-odf/keycloak-postgres.yaml +++ b/keycloak-odf/keycloak-postgres.yaml @@ -14,7 +14,7 @@ spec: resources: requests: storage: 10Gi - storageClassName: ocs-storagecluster-ceph-rbd + storageClassName: ocs-storagecluster-ceph-mirror # storageClassName: gp2 backups: pgbackrest: @@ -30,5 +30,5 @@ spec: resources: requests: storage: 10Gi - storageClassName: ocs-storagecluster-ceph-rbd + storageClassName: ocs-storagecluster-ceph-mirror # storageClassName: gp2 From 1fec153b7fd282d7d1b05e861141b9ef219ee81d Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Wed, 25 Aug 2021 15:47:01 -0700 Subject: [PATCH 07/42] Label change added to RBD mirroring branch --- keycloak-odf/keycloak-postgres.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/keycloak-odf/keycloak-postgres.yaml b/keycloak-odf/keycloak-postgres.yaml index 7e23f26..a4a695f 100644 --- a/keycloak-odf/keycloak-postgres.yaml +++ b/keycloak-odf/keycloak-postgres.yaml @@ -15,7 +15,9 @@ spec: requests: storage: 10Gi storageClassName: ocs-storagecluster-ceph-mirror -# storageClassName: gp2 + metadata: + labels: + "appname": "keycloak-odf-app" backups: pgbackrest: image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.33-1 @@ -29,6 +31,8 @@ spec: - "ReadWriteOnce" resources: requests: - storage: 10Gi + storage: 100Gi storageClassName: ocs-storagecluster-ceph-mirror -# storageClassName: gp2 + metadata: + labels: + "appname": "keycloak-odf-app" From 755b07e51d29b944bb268b4dbf334ca593dadaed Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Thu, 2 Sep 2021 13:18:18 -0700 Subject: [PATCH 08/42] Add a simple RBD loop application --- rbdloop-odf/cephrbd-loop-stamp-4k.yaml | 43 ++++++++++++++++++++++++++ rbdloop-odf/cephrbd-loop-stamp-4m.yaml | 43 ++++++++++++++++++++++++++ rbdloop-odf/kustomization.yaml | 6 ++++ 3 files changed, 92 insertions(+) create mode 100644 rbdloop-odf/cephrbd-loop-stamp-4k.yaml create mode 100644 rbdloop-odf/cephrbd-loop-stamp-4m.yaml create mode 100644 rbdloop-odf/kustomization.yaml diff --git a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml new file mode 100644 index 0000000..24cc3bc --- /dev/null +++ b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml @@ -0,0 +1,43 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: pvc-cephrbd-4k + namespace: rbdloop +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi + storageClassName: ocs-storagecluster-ceph-rbd +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: batch-4k + namespace: rbdloop + labels: + app: batch-4k +spec: + template: + metadata: + labels: + app: batch-4k + spec: + restartPolicy: OnFailure + containers: + - name: batch-4k + image: amazon/aws-cli:latest + command: ["sh"] + args: + - '-c' + - 'while true; do echo "Creating time-stamped file 40MB urandom based"; export mystamp=$(echo $(cat /proc/sys/kernel/random/uuid)_$(date +%Y%m%d_%H%M%S)); dd if=/dev/urandom of=/tmp/file_${mystamp} bs=4K count=10000 &>/dev/null; echo "------------"; echo "Listing last 20 time-stamped archive"; ls -l /tmp/file_* | tail -20; echo "------------"; echo "Total number of time-stamped files is $(ls /tmp/file_* | wc -l)"; echo "==================================================="; done' + volumeMounts: + - name: tmp-store + mountPath: /tmp + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: pvc-cephrbd-4k + readOnly: false diff --git a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml new file mode 100644 index 0000000..9ac9972 --- /dev/null +++ b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml @@ -0,0 +1,43 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: pvc-cephrbd-4m + namespace: rbdloop +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi + storageClassName: ocs-storagecluster-ceph-rbd +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: batch-4m + namespace: rbdloop + labels: + app: batch-4m +spec: + template: + metadata: + labels: + app: batch-4m + spec: + restartPolicy: OnFailure + containers: + - name: batch-4m + image: amazon/aws-cli:latest + command: ["sh"] + args: + - '-c' + - 'while true; do echo "Creating time-stamped file 40MB urandom based"; export mystamp=$(echo $(cat /proc/sys/kernel/random/uuid)_$(date +%Y%m%d_%H%M%S)); dd if=/dev/urandom of=/tmp/file_${mystamp} bs=4M count=10 &>/dev/null; echo "------------"; echo "Listing last 20 time-stamped archive"; ls -l /tmp/file_* | tail -20; echo "------------"; echo "Total number of time-stamped files is $(ls /tmp/file_* | wc -l)"; echo "==================================================="; done' + volumeMounts: + - name: tmp-store + mountPath: /tmp + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: pvc-cephrbd-4m + readOnly: false diff --git a/rbdloop-odf/kustomization.yaml b/rbdloop-odf/kustomization.yaml new file mode 100644 index 0000000..d9c43f3 --- /dev/null +++ b/rbdloop-odf/kustomization.yaml @@ -0,0 +1,6 @@ +namespace: rbdloop + +resources: +- cephrbd-loop-stamp-4k.yaml +- cephrbd-loop-stamp-4m.yaml + From 394ba059120189572694371573ec7ca47035790f Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Thu, 2 Sep 2021 13:20:46 -0700 Subject: [PATCH 09/42] Make it NS free float --- rbdloop-odf/cephrbd-loop-stamp-4k.yaml | 4 ++-- rbdloop-odf/cephrbd-loop-stamp-4m.yaml | 4 ++-- rbdloop-odf/kustomization.yaml | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml index 24cc3bc..6408153 100644 --- a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml +++ b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml @@ -3,7 +3,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-cephrbd-4k - namespace: rbdloop +# namespace: rbdloop spec: accessModes: - ReadWriteOnce @@ -16,7 +16,7 @@ apiVersion: batch/v1 kind: Job metadata: name: batch-4k - namespace: rbdloop +# namespace: rbdloop labels: app: batch-4k spec: diff --git a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml index 9ac9972..1e922b0 100644 --- a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml +++ b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml @@ -3,7 +3,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-cephrbd-4m - namespace: rbdloop +# namespace: rbdloop spec: accessModes: - ReadWriteOnce @@ -16,7 +16,7 @@ apiVersion: batch/v1 kind: Job metadata: name: batch-4m - namespace: rbdloop +# namespace: rbdloop labels: app: batch-4m spec: diff --git a/rbdloop-odf/kustomization.yaml b/rbdloop-odf/kustomization.yaml index d9c43f3..3303664 100644 --- a/rbdloop-odf/kustomization.yaml +++ b/rbdloop-odf/kustomization.yaml @@ -1,5 +1,3 @@ -namespace: rbdloop - resources: - cephrbd-loop-stamp-4k.yaml - cephrbd-loop-stamp-4m.yaml From 4d2a5a36059b3c9242e090d21fa656250bea79f6 Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Wed, 22 Sep 2021 16:58:52 -0700 Subject: [PATCH 10/42] Add labels to PVCs --- rbdloop-odf/cephrbd-loop-stamp-4k.yaml | 2 ++ rbdloop-odf/cephrbd-loop-stamp-4m.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml index 6408153..12c57d0 100644 --- a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml +++ b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml @@ -3,6 +3,8 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-cephrbd-4k + labels: + appname: rbdloop # namespace: rbdloop spec: accessModes: diff --git a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml index 1e922b0..dadb9e6 100644 --- a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml +++ b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml @@ -3,6 +3,8 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-cephrbd-4m + labels: + appname: rbdloop # namespace: rbdloop spec: accessModes: From 02c1626d5af1ae78fed78044b1fb213013a4f218 Mon Sep 17 00:00:00 2001 From: Jean-Charles Lopez Date: Wed, 24 Nov 2021 10:07:44 -0800 Subject: [PATCH 11/42] Change application from jobs to pods --- rbdloop-odf/cephrbd-loop-stamp-4k.yaml | 45 ---------------------- rbdloop-odf/cephrbd-loop-stamp-4m.yaml | 45 ---------------------- rbdloop-odf/kustomization.yaml | 4 +- rbdloop-odf/pod-cephrbd-loop-stamp-4k.yaml | 35 +++++++++++++++++ rbdloop-odf/pod-cephrbd-loop-stamp-4m.yaml | 35 +++++++++++++++++ 5 files changed, 72 insertions(+), 92 deletions(-) delete mode 100644 rbdloop-odf/cephrbd-loop-stamp-4k.yaml delete mode 100644 rbdloop-odf/cephrbd-loop-stamp-4m.yaml create mode 100644 rbdloop-odf/pod-cephrbd-loop-stamp-4k.yaml create mode 100644 rbdloop-odf/pod-cephrbd-loop-stamp-4m.yaml diff --git a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml b/rbdloop-odf/cephrbd-loop-stamp-4k.yaml deleted file mode 100644 index 12c57d0..0000000 --- a/rbdloop-odf/cephrbd-loop-stamp-4k.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvc-cephrbd-4k - labels: - appname: rbdloop -# namespace: rbdloop -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - storageClassName: ocs-storagecluster-ceph-rbd ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: batch-4k -# namespace: rbdloop - labels: - app: batch-4k -spec: - template: - metadata: - labels: - app: batch-4k - spec: - restartPolicy: OnFailure - containers: - - name: batch-4k - image: amazon/aws-cli:latest - command: ["sh"] - args: - - '-c' - - 'while true; do echo "Creating time-stamped file 40MB urandom based"; export mystamp=$(echo $(cat /proc/sys/kernel/random/uuid)_$(date +%Y%m%d_%H%M%S)); dd if=/dev/urandom of=/tmp/file_${mystamp} bs=4K count=10000 &>/dev/null; echo "------------"; echo "Listing last 20 time-stamped archive"; ls -l /tmp/file_* | tail -20; echo "------------"; echo "Total number of time-stamped files is $(ls /tmp/file_* | wc -l)"; echo "==================================================="; done' - volumeMounts: - - name: tmp-store - mountPath: /tmp - volumes: - - name: tmp-store - persistentVolumeClaim: - claimName: pvc-cephrbd-4k - readOnly: false diff --git a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml b/rbdloop-odf/cephrbd-loop-stamp-4m.yaml deleted file mode 100644 index dadb9e6..0000000 --- a/rbdloop-odf/cephrbd-loop-stamp-4m.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvc-cephrbd-4m - labels: - appname: rbdloop -# namespace: rbdloop -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - storageClassName: ocs-storagecluster-ceph-rbd ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: batch-4m -# namespace: rbdloop - labels: - app: batch-4m -spec: - template: - metadata: - labels: - app: batch-4m - spec: - restartPolicy: OnFailure - containers: - - name: batch-4m - image: amazon/aws-cli:latest - command: ["sh"] - args: - - '-c' - - 'while true; do echo "Creating time-stamped file 40MB urandom based"; export mystamp=$(echo $(cat /proc/sys/kernel/random/uuid)_$(date +%Y%m%d_%H%M%S)); dd if=/dev/urandom of=/tmp/file_${mystamp} bs=4M count=10 &>/dev/null; echo "------------"; echo "Listing last 20 time-stamped archive"; ls -l /tmp/file_* | tail -20; echo "------------"; echo "Total number of time-stamped files is $(ls /tmp/file_* | wc -l)"; echo "==================================================="; done' - volumeMounts: - - name: tmp-store - mountPath: /tmp - volumes: - - name: tmp-store - persistentVolumeClaim: - claimName: pvc-cephrbd-4m - readOnly: false diff --git a/rbdloop-odf/kustomization.yaml b/rbdloop-odf/kustomization.yaml index 3303664..963c2ab 100644 --- a/rbdloop-odf/kustomization.yaml +++ b/rbdloop-odf/kustomization.yaml @@ -1,4 +1,4 @@ resources: -- cephrbd-loop-stamp-4k.yaml -- cephrbd-loop-stamp-4m.yaml +- pod-cephrbd-loop-stamp-4k.yaml +- pod-cephrbd-loop-stamp-4m.yaml diff --git a/rbdloop-odf/pod-cephrbd-loop-stamp-4k.yaml b/rbdloop-odf/pod-cephrbd-loop-stamp-4k.yaml new file mode 100644 index 0000000..b443b90 --- /dev/null +++ b/rbdloop-odf/pod-cephrbd-loop-stamp-4k.yaml @@ -0,0 +1,35 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: pvc-cephrbd-4k + labels: + appname: rbdloop +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi + storageClassName: ocs-storagecluster-ceph-rbd +--- +apiVersion: v1 +kind: Pod +metadata: + name: batch-4k + labels: + app: batch-4k +spec: + containers: + - name: batch-4k + image: quay.io/vcppds7878/busybox:latest + imagePullPolicy: IfNotPresent + command: ['sh', '-c', 'export myuniqueid=$(cat /proc/sys/kernel/random/uuid);while true; do echo "Creating time-stamped file 4KB urandom based"; export mystamp=$(echo "${myuniqueid}_$(date +%Y%m%d_%H%M%S)"); dd if=/dev/urandom of=/mnt/test/file_${mystamp} bs=4K count=1 oflag=direct &>/dev/null; echo "------------"; echo "Listing last 20 time-stamped archive"; ls -l /mnt/test/file_* | tail -20; echo "------------"; echo "Total number of time-stamped files is $(ls /mnt/test/file_* | wc -l)"; echo "==================================================="; done'] + volumeMounts: + - name: tmp-store + mountPath: /mnt/test + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: pvc-cephrbd-4k + readOnly: false diff --git a/rbdloop-odf/pod-cephrbd-loop-stamp-4m.yaml b/rbdloop-odf/pod-cephrbd-loop-stamp-4m.yaml new file mode 100644 index 0000000..98bbbdb --- /dev/null +++ b/rbdloop-odf/pod-cephrbd-loop-stamp-4m.yaml @@ -0,0 +1,35 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: pvc-cephrbd-4m + labels: + appname: rbdloop +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi + storageClassName: ocs-storagecluster-ceph-rbd +--- +apiVersion: v1 +kind: Pod +metadata: + name: batch-4m + labels: + app: batch-4m +spec: + containers: + - name: batch-4m + image: quay.io/vcppds7878/busybox:latest + imagePullPolicy: IfNotPresent + command: ['sh', '-c', 'export myuniqueid=$(cat /proc/sys/kernel/random/uuid);while true; do echo "Creating time-stamped file 4MB urandom based"; export mystamp=$(echo "${myuniqueid}_$(date +%Y%m%d_%H%M%S)"); dd if=/dev/urandom of=/mnt/test/file_${mystamp} oflag=direct bs=4M count=1 &>/dev/null; echo "------------"; echo "Listing last 20 time-stamped archive"; ls -l /mnt/test/file_* | tail -20; echo "------------"; echo "Total number of time-stamped files is $(ls /mnt/test/file_* | wc -l)"; echo "==================================================="; done'] + volumeMounts: + - name: tmp-store + mountPath: /mnt/test + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: pvc-cephrbd-4m + readOnly: false From 2da361c37dd7ab9e96550c4ca7b2e1245aac0bbb Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 16:14:48 -0800 Subject: [PATCH 12/42] New test apop with dashboard --- ramendemo/Dockerfile | 22 + ramendemo/app/kustomization.yaml | 3 + ramendemo/app/rbdloop.yaml | 52 + ramendemo/grafana/cm-monitoring.yaml | 8 + ramendemo/grafana/dashboard-bar-new.json | 1028 +++++++++++++++ ramendemo/grafana/dashboard-bar.json | 1028 +++++++++++++++ .../dashboard-guillaume-qui-marche.json | 644 +++++++++ ramendemo/grafana/dashboard-new-final.json | 1145 +++++++++++++++++ ramendemo/grafana/dashboard.json | 451 +++++++ ramendemo/grafana/dashboard.yaml | 652 ++++++++++ ramendemo/grafana/datasource.yaml | 14 + ramendemo/grafana/grafana.yaml | 86 ++ ramendemo/grafana/kustomization.yaml | 4 + ramendemo/mysql/kustomization.yaml | 3 + ramendemo/mysql/mysql.yaml | 104 ++ ramendemo/rbdloop-new.yaml | 53 + ramendemo/runloop.py | 189 +++ 17 files changed, 5486 insertions(+) create mode 100644 ramendemo/Dockerfile create mode 100644 ramendemo/app/kustomization.yaml create mode 100644 ramendemo/app/rbdloop.yaml create mode 100644 ramendemo/grafana/cm-monitoring.yaml create mode 100644 ramendemo/grafana/dashboard-bar-new.json create mode 100644 ramendemo/grafana/dashboard-bar.json create mode 100644 ramendemo/grafana/dashboard-guillaume-qui-marche.json create mode 100644 ramendemo/grafana/dashboard-new-final.json create mode 100644 ramendemo/grafana/dashboard.json create mode 100644 ramendemo/grafana/dashboard.yaml create mode 100644 ramendemo/grafana/datasource.yaml create mode 100644 ramendemo/grafana/grafana.yaml create mode 100644 ramendemo/grafana/kustomization.yaml create mode 100644 ramendemo/mysql/kustomization.yaml create mode 100644 ramendemo/mysql/mysql.yaml create mode 100644 ramendemo/rbdloop-new.yaml create mode 100755 ramendemo/runloop.py diff --git a/ramendemo/Dockerfile b/ramendemo/Dockerfile new file mode 100644 index 0000000..fc3855a --- /dev/null +++ b/ramendemo/Dockerfile @@ -0,0 +1,22 @@ +FROM registry.access.redhat.com/ubi8/python-38 +#FROM docker.io/centos:centos7 +ENV ENABLE_MICROPIPENV="1" \ + UPGRADE_PIP_TO_LATEST="1" +USER root + +RUN yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y +RUN wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm +RUN yum localinstall mysql80-community-release-el8-1.noarch.rpm -y +RUN yum install python3-mysqlclient mysql-connector-odbc gcc unixODBC-devel -y + +RUN python -m pip install --upgrade pip +RUN pip3 install shortuuid mysqlclient mysql-connector mysql-connector-python pyodbc + +#RUN yum install gcc unixODBC-devel python3-mysqlclient mysql-connector-odbc -y +#RUN python -m pip install --upgrade pip +#RUN pip3 install shortuuid mysqlclient mysql-connector mysql-connector-python pyodbc + +WORKDIR /tmp +ADD *.py . + +ENTRYPOINT [ "python3", "/tmp/runloop.py --size --server" ] diff --git a/ramendemo/app/kustomization.yaml b/ramendemo/app/kustomization.yaml new file mode 100644 index 0000000..e014edc --- /dev/null +++ b/ramendemo/app/kustomization.yaml @@ -0,0 +1,3 @@ +resources: +- rbdloop.yaml + diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml new file mode 100644 index 0000000..6f7517c --- /dev/null +++ b/ramendemo/app/rbdloop.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ramendemo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: ocs-storagecluster-ceph-rbdmirror +--- +apiVersion: v1 +kind: Pod +metadata: + name: batch-4k + labels: + app: batch-4k +spec: + containers: + - name: batch-4k + image: quay.io/vcppds7878/busybox:rbdloop + imagePullPolicy: Always +# command: ["sh"] +# args: +# - '-c' +# - 'sleep 3600' + command: ["python3"] + args: + - '/tmp/runloop.py' + - '--size' + - '--server' + - '--port' + env: + - name: BLOCKSIZE + value: "4K" + - name: SQL_SERVER + value: "ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja" + - name: SQL_PORT + value: "30036" + - name: SQL_URL + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver + volumeMounts: + - name: tmp-store + mountPath: /mnt/test + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: ramendemo + readOnly: false + restartPolicy: Never diff --git a/ramendemo/grafana/cm-monitoring.yaml b/ramendemo/grafana/cm-monitoring.yaml new file mode 100644 index 0000000..0d76888 --- /dev/null +++ b/ramendemo/grafana/cm-monitoring.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: cluster-monitoring-config + namespace: openshift-monitoring +data: + config.yaml: | + enableUserWorkload: true diff --git a/ramendemo/grafana/dashboard-bar-new.json b/ramendemo/grafana/dashboard-bar-new.json new file mode 100644 index 0000000..a20c47a --- /dev/null +++ b/ramendemo/grafana/dashboard-bar-new.json @@ -0,0 +1,1028 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Visualize the failover and failback of a test application", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 750 + }, + { + "color": "red", + "value": 900 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster - IOs During Grafana Interval", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 750 + }, + { + "color": "red", + "value": 900 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 7, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster - IOs During Grafana Interval", + "transformations": [], + "type": "gauge" + }, + { + "datasource": null, + "description": "Track which cluster is active", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "green", + "value": 10 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster1" + }, + "properties": [ + { + "id": "displayName", + "value": "Preferred Cluster" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster2" + }, + "properties": [ + { + "id": "displayName", + "value": "Failover Cluster" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 9, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "titleSize": 0, + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "Preferred Cluster", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ], + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Cluster State", + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 8 + }, + "id": 13, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevdate", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Date Of Data From Cluster 2", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 8 + }, + "id": 14, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": true + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "hide": false, + "metricColumn": "prevtime", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Time Of Data From Cluster 2", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 8 + }, + "id": 17, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": true + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "cluster1" + ], + "type": "alias" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Gap", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 12 + }, + "id": 15, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevdate", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Date Of Data From Cluster 1", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 12 + }, + "id": 16, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevtime", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Time Of Data From Cluster 1", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 12 + }, + "id": 18, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": true + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "cluster1" + ], + "type": "alias" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Gap", + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Ramen Demo", + "uid": "EgUfN127k", + "version": 24 +} diff --git a/ramendemo/grafana/dashboard-bar.json b/ramendemo/grafana/dashboard-bar.json new file mode 100644 index 0000000..76efa97 --- /dev/null +++ b/ramendemo/grafana/dashboard-bar.json @@ -0,0 +1,1028 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Visualize the failover and failback of a test application", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 750 + }, + { + "color": "red", + "value": 900 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Cluster 1 - 4K IOs During Grafana Interval", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 750 + }, + { + "color": "red", + "value": 900 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 7, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Cluster 2 - 4K IOs During Grafana Interval", + "transformations": [], + "type": "gauge" + }, + { + "datasource": null, + "description": "Track which cluster is active", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "green", + "value": 10 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster1" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster 1" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster2" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster 2" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 9, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "titleSize": 0, + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "Cluster 1", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ], + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Cluster State", + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 12, + "y": 8 + }, + "id": 13, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevdate", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Date Of Data From Cluster 2", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 16, + "y": 8 + }, + "id": 14, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": true + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "hide": false, + "metricColumn": "prevtime", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Time Of Data From Cluster 2", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 20, + "y": 8 + }, + "id": 17, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": true + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "cluster1" + ], + "type": "alias" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Gap", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 12, + "y": 12 + }, + "id": 15, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevdate", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Date Of Data From Cluster 1", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 12 + }, + "id": 16, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevtime", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Last Time Of Data From Cluster 1", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 12 + }, + "id": 18, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": true + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "cluster1" + ], + "type": "alias" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Gap", + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Ramen Demo", + "uid": "EgUfN127k", + "version": 24 +} diff --git a/ramendemo/grafana/dashboard-guillaume-qui-marche.json b/ramendemo/grafana/dashboard-guillaume-qui-marche.json new file mode 100644 index 0000000..d6e24e0 --- /dev/null +++ b/ramendemo/grafana/dashboard-guillaume-qui-marche.json @@ -0,0 +1,644 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "RamenDemo", + "uid": "FoE9HChnz", + "version": 15 +} diff --git a/ramendemo/grafana/dashboard-new-final.json b/ramendemo/grafana/dashboard-new-final.json new file mode 100644 index 0000000..b5b1bbf --- /dev/null +++ b/ramendemo/grafana/dashboard-new-final.json @@ -0,0 +1,1145 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Visualize the failover and failback of a test application", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 750 + }, + { + "color": "red", + "value": 900 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster - IOs During Grafana Interval", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 750 + }, + { + "color": "red", + "value": 900 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 7, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failovber Cluster - IOs During Grafana Interval", + "transformations": [], + "type": "gauge" + }, + { + "datasource": null, + "description": "Track which cluster is active", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "green", + "value": 10 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster1" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster 1" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster2" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster 2" + } + ] + } + ] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 9, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "titleSize": 0, + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "Cluster 1", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ], + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Cluster", + "type": "bargauge" + }, + { + "datasource": null, + "description": "Track which cluster is active", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "green", + "value": 10 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "cluster1" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster 1" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster2" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster 2" + } + ] + } + ] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 19, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "titleSize": 0, + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "Cluster 1", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ], + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Cluster", + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 11 + }, + "id": 17, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "cluster1" + ], + "type": "alias" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Gap", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 11 + }, + "id": 18, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + }, + { + "params": [ + "avg" + ], + "type": "aggregate" + }, + { + "params": [ + "cluster1" + ], + "type": "alias" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Gap", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 0, + "y": 14 + }, + "id": 13, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevdate", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Data Datestamp", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 4, + "y": 14 + }, + "id": 14, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "hide": false, + "metricColumn": "prevtime", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Data Timestamp", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 14 + }, + "id": 15, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevdate", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Data Datestamp", + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 14 + }, + "id": 16, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "center", + "orientation": "vertical", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": { + "titleSize": 1, + "valueSize": 30 + }, + "textMode": "value" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "prevtime", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Data Timestamp", + "type": "stat" + } + ], + "refresh": "5s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Ramen Demo", + "uid": "EgUfN127k", + "version": 30 +} diff --git a/ramendemo/grafana/dashboard.json b/ramendemo/grafana/dashboard.json new file mode 100644 index 0000000..8f0cd84 --- /dev/null +++ b/ramendemo/grafana/dashboard.json @@ -0,0 +1,451 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Visualize the failover and failback of a test application", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "iteration": 1639092313850, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 50, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 20 + }, + { + "color": "red", + "value": 30 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 6, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "none" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Cluster 1", + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 50, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 20 + }, + { + "color": "red", + "value": 30 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 7, + "options": { + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "none" + ], + "type": "time" + } + ], + "hide": false, + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "Cluster 2", + "transformations": [], + "type": "gauge" + }, + { + "aliasColors": { + "cluster2": "red" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "description": "Track which cluster is active", + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 0, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 8 + }, + "hiddenSeries": false, + "id": 9, + "legend": { + "alignAsTable": true, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 2, + "nullPointMode": "null", + "options": { + "alertThreshold": false + }, + "percentage": false, + "pluginVersion": "7.5.2", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": true, + "steppedLine": true, + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "Cluster 1", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ], + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Cluster State", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "$$hashKey": "object:181", + "decimals": 0, + "format": "short", + "label": null, + "logBase": 1, + "max": "1", + "min": "0", + "show": true + }, + { + "$$hashKey": "object:182", + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": false, + "text": "60", + "value": "60" + }, + "datasource": null, + "definition": "select count(*) from ramendemo.ramendemo where fsid=(select fsid from ramendemo.ramenfsid limit 1);", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "rowcount1", + "options": [ + { + "selected": true, + "text": "60", + "value": "60" + } + ], + "query": "select count(*) from ramendemo.ramendemo where fsid=(select fsid from ramendemo.ramenfsid limit 1);", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "selected": false, + "text": "301", + "value": "301" + }, + "datasource": null, + "definition": "SELECT COUNT(*) FROM ramendemo WHERE fsid=(SELECT fsid FROM ramenfsid WHERE id=(SELECT MAX(id) FROM ramenfsid) )", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "rowcount2", + "options": [ + { + "selected": true, + "text": "301", + "value": "301" + } + ], + "query": "SELECT COUNT(*) FROM ramendemo WHERE fsid=(SELECT fsid FROM ramenfsid WHERE id=(SELECT MAX(id) FROM ramenfsid) )", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Ramen Demo", + "uid": "EgUfN127k", + "version": 7 +} diff --git a/ramendemo/grafana/dashboard.yaml b/ramendemo/grafana/dashboard.yaml new file mode 100644 index 0000000..b1fbf44 --- /dev/null +++ b/ramendemo/grafana/dashboard.yaml @@ -0,0 +1,652 @@ +apiVersion: integreatly.org/v1alpha1 +kind: GrafanaDashboard +metadata: + labels: + app: grafana + name: ramendeno-nodes-dashboard +spec: + json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "links": [], + "panels": [ + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timezone": "", + "title": "RamenDemo", + "uid": "FoE9HChnz", + "version": 15 + } + name: ramendemo-dashboard.json diff --git a/ramendemo/grafana/datasource.yaml b/ramendemo/grafana/datasource.yaml new file mode 100644 index 0000000..f6a3083 --- /dev/null +++ b/ramendemo/grafana/datasource.yaml @@ -0,0 +1,14 @@ +apiVersion: integreatly.org/v1alpha1 +kind: GrafanaDataSource +metadata: +name: mysql-grafana-datasource +spec: +datasources: + - type: mysql +name: MySQL +access: proxy +url: ramendemo-mysql +database: ramendemo +user: ramendemo +password: ramendemo +name: grafana-mysql-datasource.yaml diff --git a/ramendemo/grafana/grafana.yaml b/ramendemo/grafana/grafana.yaml new file mode 100644 index 0000000..5334b80 --- /dev/null +++ b/ramendemo/grafana/grafana.yaml @@ -0,0 +1,86 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: grafana-pvc + namespace: grafana +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: grafana + name: grafana + namespace: grafana +spec: + selector: + matchLabels: + app: grafana + template: + metadata: + labels: + app: grafana + namespace: grafana + spec: + securityContext: + fsGroup: 472 + supplementalGroups: + - 0 + containers: + - name: grafana + image: grafana/grafana:7.5.2 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + name: http-grafana + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /robots.txt + port: 3000 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 2 + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 30 + periodSeconds: 10 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + resources: + requests: + cpu: 250m + memory: 750Mi + volumeMounts: + - mountPath: /var/lib/grafana + name: grafana-pv + volumes: + - name: grafana-pv + persistentVolumeClaim: + claimName: grafana-pvc +--- +apiVersion: v1 +kind: Service +metadata: + name: grafana + namespace: grafana +spec: + ports: + - port: 3000 + protocol: TCP + targetPort: http-grafana + selector: + app: grafana + sessionAffinity: None + type: LoadBalancer diff --git a/ramendemo/grafana/kustomization.yaml b/ramendemo/grafana/kustomization.yaml new file mode 100644 index 0000000..963c2ab --- /dev/null +++ b/ramendemo/grafana/kustomization.yaml @@ -0,0 +1,4 @@ +resources: +- pod-cephrbd-loop-stamp-4k.yaml +- pod-cephrbd-loop-stamp-4m.yaml + diff --git a/ramendemo/mysql/kustomization.yaml b/ramendemo/mysql/kustomization.yaml new file mode 100644 index 0000000..7a6c5a4 --- /dev/null +++ b/ramendemo/mysql/kustomization.yaml @@ -0,0 +1,3 @@ +resources: +- mysql.yaml + diff --git a/ramendemo/mysql/mysql.yaml b/ramendemo/mysql/mysql.yaml new file mode 100644 index 0000000..cbdd638 --- /dev/null +++ b/ramendemo/mysql/mysql.yaml @@ -0,0 +1,104 @@ +#--- +#apiVersion: v1 +#data: +# password: cmVkaGF0Cg== +#kind: Secret +#metadata: +# name: mysql-pass +# namespace: testjc +#type: Opaque +--- +apiVersion: v1 +kind: Service +metadata: + name: ramendemo-mysql + labels: + app: ramendemo +spec: + type: NodePort + ports: + - port: 3306 + nodePort: 30036 + selector: + app: ramendemo + tier: mysql +# clusterIP: None +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ramendemo-mysql-pv-claim + labels: + app: ramendemo +spec: + accessModes: + - ReadWriteOnce + storageClassName: ocs-storagecluster-ceph-rbd + resources: + requests: + storage: 1Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ramendemo-mysql + labels: + app: ramendemo +spec: + selector: + matchLabels: + app: ramendemo + tier: mysql + strategy: + type: Recreate + template: + metadata: + labels: + app: ramendemo + tier: mysql + spec: + containers: + - image: mysql:5.6 + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + value: "redhat" +# valueFrom: +# secretKeyRef: +# name: mysql-pass +# key: password + - name: MYSQL_DATABASE + value: "ramendemo" + - name: MYSQL_USER + value: "ramendemo" + - name: MYSQL_PASSWORD + value: "ramendemo" + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: mysql-persistent-storage + mountPath: /var/lib/mysql + volumes: + - name: mysql-persistent-storage + persistentVolumeClaim: + claimName: ramendemo-mysql-pv-claim +--- +apiVersion: route.openshift.io/v1 +kind: Route +metadata: + annotations: + openshift.io/host.generated: "true" + labels: + app: ramendemo + name: ramendemo-mysql + namespace: testjc +spec: + host: ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja + port: + targetPort: 3306 + to: + kind: Service + name: ramendemo-mysql + weight: 100 + wildcardPolicy: None diff --git a/ramendemo/rbdloop-new.yaml b/ramendemo/rbdloop-new.yaml new file mode 100644 index 0000000..8ee8504 --- /dev/null +++ b/ramendemo/rbdloop-new.yaml @@ -0,0 +1,53 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ramendemo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: ocs-storagecluster-ceph-rbd + #storageClassName: thin +--- +apiVersion: v1 +kind: Pod +metadata: + name: batch-4k + labels: + app: batch-4k +spec: + containers: + - name: batch-4k + image: quay.io/vcppds7878/busybox:rbdloop + imagePullPolicy: Always + command: ["sh"] + args: + - '-c' + - 'sleep 3600' +# command: ["python3"] +# args: +# - '/tmp/runloop.py' +# - '--size' +# - '--server' +# - '--port' + env: + - name: BLOCKSIZE + value: "4096" + - name: SQL_SERVER + value: "ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja" + - name: SQL_PORT + value: "99999" + - name: SQL_URL + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver.url" + volumeMounts: + - name: tmp-store + mountPath: /mnt/test + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: ramendemo + readOnly: false + restartPolicy: Never diff --git a/ramendemo/runloop.py b/ramendemo/runloop.py new file mode 100755 index 0000000..2cea4f1 --- /dev/null +++ b/ramendemo/runloop.py @@ -0,0 +1,189 @@ +#!/usr/bin/python +import json,sys,os,time,io,pyodbc,shortuuid +from subprocess import Popen, PIPE +from optparse import OptionParser +from random import seed +from random import randint +from time import sleep +from datetime import datetime + +usage = "Usage: %prog -n jobname [-s sqlserver_address] [-f output_file]" +parser = OptionParser() +parser.add_option("-z", "--size", action="store_true",dest="blocksize",help="Block size to use for IOs",default=False) +parser.add_option("-s", "--server", action="store_true",dest="sqlserver",help="SQL server address is in SQL_SERVER environment variable",default=False) +parser.add_option("-p", "--port", action="store_true",dest="sqlport",help="SQL server port exposed through nodePort",default=False) +parser.add_option("-g", "--debug", action="store_true",dest="debugflag",help="Display debugging info",default=False) +parser.add_option("-f", "--file", action="store",dest="writetofile",help="Write output to file",default="/tmp/outfile") + +global writetofile +global sqlserveraddress +global sqlport +global blocksize +global lastuuid +global last1 +global last2 +global sqlurl +global isprimarycluster +global issecondarycluster + +(options, args) = parser.parse_args() + +writetofile = options.writetofile +sqlurl="" +sqlport = "" +lastuuid = "" +last1 = 0 +last2 = 0 +isprimarycluster = 0 +issecondarycluster = 0 + +if (options.blocksize == ""): + printf("%s\n", usage) + exit(1) + +blocksize = options.blocksize + +if (options.blocksize == True): + blocksize = os.getenv('BLOCKSIZE') + +if (options.sqlserver == True): + sqlserveraddress = os.getenv('SQL_SERVER') + +if (options.sqlport == True): + sqlport = os.getenv('SQL_PORT') + sqlserveraddress += ":" + sqlserveraddress += sqlport +# +# See if for automation we are overriding the yaml environment variable +# +sqlurl = os.getenv('SQL_URL', 'ramendemo') +if sqlurl != "": + print ("Overriding environment variable from URL content at "+sqlurl) + tmpval = os.popen("curl "+sqlurl+" 2>/dev/null").read() + if tmpval != "404: Not Found": + sqlserveraddress = tmpval.strip() + +print ("SQL Server Address = "+sqlserveraddress) + +db = os.getenv('DB', 'ramendemo') +user = os.getenv('USER', 'root') +password = os.getenv('PASS', 'redhat') +myname = os.getenv('MYNAME', 'UNKNOWN') + +conn = pyodbc.connect('Driver={MySQL ODBC 8.0 ANSI Driver};' + 'Server='+sqlserveraddress+';' + 'Database='+db+';' + 'uid='+user+';' + 'pwd='+password+';' + 'Trusted_Connection=yes;') + +conn.setdecoding(pyodbc.SQL_CHAR, encoding='utf-8') +conn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8') +conn.setencoding(encoding='utf-8') + +cursor = conn.cursor() +#sqlcmd = ("DROP TABLE IF EXISTS ramendemo;") +#cursor.execute(sqlcmd) +# +# Create the table to track the data we write +# +sqlcmd = ("CREATE TABLE IF NOT EXISTS ramendemo (id serial PRIMARY KEY, submit_time DATETIME, complete_time DATETIME, isprimary INT, issecondary INT, fsid VARCHAR(64), stampdate VARCHAR(8), stamptime VARCHAR(6), iosize VARCHAR(16));") +cursor.execute(sqlcmd) +conn.commit() +# +# Create the table to track the current fsid and the previous last stamp writtem +# +sqlcmd = ("CREATE TABLE IF NOT EXISTS ramenfsid (id serial PRIMARY KEY, submit_time DATETIME, cluster1 INT, cluster2 INT, fsid VARCHAR(64), prevdate VARCHAR(8), prevtime VARCHAR(6), gap VARCHAR(12));") +cursor.execute(sqlcmd) +# +# Retrieve the last fsid that was running prior to a failover or failback +# +#sqlcmd = ("SELECT * FROM ramendemo.ramenfsid WHERE id=(SELECT MAX(id) FROM ramendemo.ramenfsid);") +sqlcmd = ("SELECT * FROM ramendemo.ramenfsid;") +records = cursor.execute(sqlcmd).fetchall() +newramendemofsid = len(records) +# +# Check if table is empty (we are the first occurence of the pod) +# +if newramendemofsid != 0: + print ("Table ramenfsid is NOT empty "+str(newramendemofsid)) + for r in records: + print(str(r.id)+" "+str(r.fsid)) + lastuuid = str(r.fsid) + last1 = int(r.cluster1) + last2 = int(r.cluster2) + print ("Saving "+str(lastuuid)+" for later C1="+str(last1)+" C2="+str(last2)) +else: + print ("Table ramenfsid is empty") +# +# Generate uuid for this new occurence +# +tmyuuid = os.popen("cat /proc/sys/kernel/random/uuid").read() +myuuid = tmyuuid.strip() +# +# Now check on disk what is the latest file we have from previous run time +# +tprevious = os.popen("ls -1 -t /mnt/test/file_"+lastuuid+"_* | head -1").read() +lastprevious = tprevious.strip() +print ("Current="+myuuid+" Previous run last file="+lastprevious) +# +# Insert one more row for current fsid +# +if newramendemofsid == 0: + isprimarycluster = 1 + issecondarycluster = 0 + sqlcmd = ("INSERT INTO ramendemo.ramenfsid (id, submit_time, cluster1, cluster2, fsid, prevdate, prevtime, gap) VALUES (?, NOW(), 1, 0, ?, ?, ?, ?);") + values = [ str((int(newramendemofsid) + 1)), str(myuuid), "", "", "None" ] +else: +# +# If last1 is non zero we failed over from Cluster1 to Cluster2 +# + if last1 == 1: + isprimarycluster = 0 + issecondarycluster = 1 + sqlcmd = ("INSERT INTO ramendemo.ramenfsid (id, submit_time, cluster1, cluster2, fsid, prevdate, prevtime, gap) VALUES (?, NOW(), 0, 1, ?, ?, ?, ?);") + else: + isprimarycluster = 1 + issecondarycluster = 0 + sqlcmd = ("INSERT INTO ramendemo.ramenfsid (id, submit_time, cluster1, cluster2, fsid, prevdate, prevtime, gap) VALUES (?, NOW(), 1, 0, ?, ?, ?, ?);") + workstring=lastprevious[-15:-7]+" "+lastprevious[-6:] + previousrun=datetime.strptime(workstring, "%Y%m%d %H%M%S") + currentrun=datetime.now() + gap=currentrun - previousrun + seconds = gap.total_seconds() + hours = seconds // 3600 + minutes = (seconds % 3600) // 60 + seconds = seconds % 60 + formattedgap="{0:02.0f}:{1:02.0f}:{2:02.0f}".format(hours, minutes, seconds) + + values = [ str((int(newramendemofsid) + 1)), str(myuuid), lastprevious[-15:-7], lastprevious[-6:], formattedgap ] +cursor.execute(sqlcmd, values) +# +# Then loop until the pod if failed over or failed back +# +while True: + tdatestamp = os.popen("date +%Y%m%d_%H%M%S").read() + tfilenumber = os.popen("ls /mnt/test/file_* | wc -l").read() + + datestamp = tdatestamp.strip() + filenumber = tfilenumber.strip() + + sqlcmd = ("INSERT INTO ramendemo.ramendemo (submit_time, isprimary, issecondary, fsid, stampdate, stamptime, iosize) VALUES (NOW(), ?, ?, ?, ?, ?, ?);") + values = [ str(isprimarycluster), str(issecondarycluster), str(myuuid), datestamp[0:8], datestamp[-6:], str(blocksize) ] + cursor.execute(sqlcmd, values) + + conn.commit() + + #cmd = "while true; do dd if=/dev/urandom of=/mnt/test/file_"+myuuid+"_"+datestamp+" bs="+blocksize+" count=1 oflag=direct &>/dev/null; echo "+str(int(filenumber) + 1)+","+blocksize+",/mnt/test/file_+"+myuuid+"_"+datestamp+" | tee -a "+writetofile+"; done" + + cmd = "dd if=/dev/urandom of=/mnt/test/file_"+myuuid+"_"+datestamp+" bs="+blocksize+" count=1 oflag=direct &>/dev/null; echo "+str(int(filenumber) + 1)+","+blocksize+",/mnt/test/file_+"+myuuid+"_"+datestamp+" | tee -a "+writetofile + + outputline = os.popen(cmd).read().strip() + #print (outputline) + +# sqlcmd = ("UPDATE ramendemo SET complete_time = NOW() WHERE ID = ?;") +# values = [ int(filenumber) + 1 ] +# cursor.execute(sqlcmd, values) + + conn.commit() + From 88d8595d62211598e3ba1c7d10cd0b5c40c83d05 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 16:21:13 -0800 Subject: [PATCH 13/42] Change app label for compatibility --- ramendemo/app/rbdloop.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml index 6f7517c..16e970d 100644 --- a/ramendemo/app/rbdloop.yaml +++ b/ramendemo/app/rbdloop.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: ramendemo + labels: + appname: rbdloop spec: accessModes: - ReadWriteOnce @@ -16,7 +18,7 @@ kind: Pod metadata: name: batch-4k labels: - app: batch-4k + appname: rbdloop spec: containers: - name: batch-4k From e71ad0375fd16f6c7aae0098c827ea5a7a98b791 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 16:30:12 -0800 Subject: [PATCH 14/42] Fix kust.yaml with relatiuve path --- ramendemo/app/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemo/app/kustomization.yaml b/ramendemo/app/kustomization.yaml index e014edc..93a8a6b 100644 --- a/ramendemo/app/kustomization.yaml +++ b/ramendemo/app/kustomization.yaml @@ -1,3 +1,3 @@ resources: -- rbdloop.yaml +- app/rbdloop.yaml From cecdc70162f3e832f762665d5f0f01c5c7d35fb5 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 16:36:10 -0800 Subject: [PATCH 15/42] Create dedicated directory for test app --- ramendemoapp/kustomization.yaml | 3 ++ ramendemoapp/rbdloop.yaml | 54 +++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 ramendemoapp/kustomization.yaml create mode 100644 ramendemoapp/rbdloop.yaml diff --git a/ramendemoapp/kustomization.yaml b/ramendemoapp/kustomization.yaml new file mode 100644 index 0000000..e014edc --- /dev/null +++ b/ramendemoapp/kustomization.yaml @@ -0,0 +1,3 @@ +resources: +- rbdloop.yaml + diff --git a/ramendemoapp/rbdloop.yaml b/ramendemoapp/rbdloop.yaml new file mode 100644 index 0000000..16e970d --- /dev/null +++ b/ramendemoapp/rbdloop.yaml @@ -0,0 +1,54 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ramendemo + labels: + appname: rbdloop +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: ocs-storagecluster-ceph-rbdmirror +--- +apiVersion: v1 +kind: Pod +metadata: + name: batch-4k + labels: + appname: rbdloop +spec: + containers: + - name: batch-4k + image: quay.io/vcppds7878/busybox:rbdloop + imagePullPolicy: Always +# command: ["sh"] +# args: +# - '-c' +# - 'sleep 3600' + command: ["python3"] + args: + - '/tmp/runloop.py' + - '--size' + - '--server' + - '--port' + env: + - name: BLOCKSIZE + value: "4K" + - name: SQL_SERVER + value: "ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja" + - name: SQL_PORT + value: "30036" + - name: SQL_URL + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver + volumeMounts: + - name: tmp-store + mountPath: /mnt/test + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: ramendemo + readOnly: false + restartPolicy: Never From 20f51428693ac413a2300f35d82be7c1c8c772c7 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 16:58:33 -0800 Subject: [PATCH 16/42] Tuning --- ramendemoapp/kustomization.yaml | 1 - ramendemoapp/rbdloop.yaml | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ramendemoapp/kustomization.yaml b/ramendemoapp/kustomization.yaml index e014edc..3273ece 100644 --- a/ramendemoapp/kustomization.yaml +++ b/ramendemoapp/kustomization.yaml @@ -1,3 +1,2 @@ resources: - rbdloop.yaml - diff --git a/ramendemoapp/rbdloop.yaml b/ramendemoapp/rbdloop.yaml index 16e970d..29be884 100644 --- a/ramendemoapp/rbdloop.yaml +++ b/ramendemoapp/rbdloop.yaml @@ -22,12 +22,8 @@ metadata: spec: containers: - name: batch-4k - image: quay.io/vcppds7878/busybox:rbdloop + image: "quay.io/vcppds7878/busybox:rbdloop" imagePullPolicy: Always -# command: ["sh"] -# args: -# - '-c' -# - 'sleep 3600' command: ["python3"] args: - '/tmp/runloop.py' From ca6a8fa43561587cae737073f851c478f38cf1e2 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 17:07:26 -0800 Subject: [PATCH 17/42] Bla --- ramendemoapp/rbdloop.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ramendemoapp/rbdloop.yaml b/ramendemoapp/rbdloop.yaml index 29be884..00aa72e 100644 --- a/ramendemoapp/rbdloop.yaml +++ b/ramendemoapp/rbdloop.yaml @@ -18,11 +18,11 @@ kind: Pod metadata: name: batch-4k labels: - appname: rbdloop + appname: batch-4k spec: containers: - name: batch-4k - image: "quay.io/vcppds7878/busybox:rbdloop" + image: quay.io/vcppds7878/busybox:rbdloop imagePullPolicy: Always command: ["python3"] args: From 83965c25508c7f7162d6d7afa771b059149aab3e Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 17:10:30 -0800 Subject: [PATCH 18/42] Bla --- ramendemoapp/kustomization.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ramendemoapp/kustomization.yaml b/ramendemoapp/kustomization.yaml index 3273ece..a009d43 100644 --- a/ramendemoapp/kustomization.yaml +++ b/ramendemoapp/kustomization.yaml @@ -1,2 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization resources: - rbdloop.yaml From 627c6d7517e7092835f1328e48cad264668cd1e1 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Mon, 13 Dec 2021 17:34:19 -0800 Subject: [PATCH 19/42] Fix SQL_URL env variable typo --- ramendemoapp/rbdloop.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemoapp/rbdloop.yaml b/ramendemoapp/rbdloop.yaml index 00aa72e..5b5d753 100644 --- a/ramendemoapp/rbdloop.yaml +++ b/ramendemoapp/rbdloop.yaml @@ -38,7 +38,7 @@ spec: - name: SQL_PORT value: "30036" - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test From 26e8b7c2bee6522e2ea30d787fc57f0cf21c88dd Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Tue, 14 Dec 2021 15:17:53 -0800 Subject: [PATCH 20/42] Add mysql automation --- ramendemo/mysql/kustomization.yaml | 4 +- ramendemo/mysql/mysql.yaml | 19 +-- ramendemoapp/Dockerfile | 22 ++++ ramendemoapp/runloop.py | 202 +++++++++++++++++++++++++++++ 4 files changed, 229 insertions(+), 18 deletions(-) create mode 100644 ramendemoapp/Dockerfile create mode 100755 ramendemoapp/runloop.py diff --git a/ramendemo/mysql/kustomization.yaml b/ramendemo/mysql/kustomization.yaml index 7a6c5a4..3d0795f 100644 --- a/ramendemo/mysql/kustomization.yaml +++ b/ramendemo/mysql/kustomization.yaml @@ -1,3 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization resources: - mysql.yaml - diff --git a/ramendemo/mysql/mysql.yaml b/ramendemo/mysql/mysql.yaml index cbdd638..b3260e1 100644 --- a/ramendemo/mysql/mysql.yaml +++ b/ramendemo/mysql/mysql.yaml @@ -1,12 +1,3 @@ -#--- -#apiVersion: v1 -#data: -# password: cmVkaGF0Cg== -#kind: Secret -#metadata: -# name: mysql-pass -# namespace: testjc -#type: Opaque --- apiVersion: v1 kind: Service @@ -18,11 +9,10 @@ spec: type: NodePort ports: - port: 3306 - nodePort: 30036 + nodePort: 30136 selector: app: ramendemo tier: mysql -# clusterIP: None --- apiVersion: v1 kind: PersistentVolumeClaim @@ -63,10 +53,6 @@ spec: env: - name: MYSQL_ROOT_PASSWORD value: "redhat" -# valueFrom: -# secretKeyRef: -# name: mysql-pass -# key: password - name: MYSQL_DATABASE value: "ramendemo" - name: MYSQL_USER @@ -92,9 +78,8 @@ metadata: labels: app: ramendemo name: ramendemo-mysql - namespace: testjc spec: - host: ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja +# host: ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja port: targetPort: 3306 to: diff --git a/ramendemoapp/Dockerfile b/ramendemoapp/Dockerfile new file mode 100644 index 0000000..fc3855a --- /dev/null +++ b/ramendemoapp/Dockerfile @@ -0,0 +1,22 @@ +FROM registry.access.redhat.com/ubi8/python-38 +#FROM docker.io/centos:centos7 +ENV ENABLE_MICROPIPENV="1" \ + UPGRADE_PIP_TO_LATEST="1" +USER root + +RUN yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y +RUN wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm +RUN yum localinstall mysql80-community-release-el8-1.noarch.rpm -y +RUN yum install python3-mysqlclient mysql-connector-odbc gcc unixODBC-devel -y + +RUN python -m pip install --upgrade pip +RUN pip3 install shortuuid mysqlclient mysql-connector mysql-connector-python pyodbc + +#RUN yum install gcc unixODBC-devel python3-mysqlclient mysql-connector-odbc -y +#RUN python -m pip install --upgrade pip +#RUN pip3 install shortuuid mysqlclient mysql-connector mysql-connector-python pyodbc + +WORKDIR /tmp +ADD *.py . + +ENTRYPOINT [ "python3", "/tmp/runloop.py --size --server" ] diff --git a/ramendemoapp/runloop.py b/ramendemoapp/runloop.py new file mode 100755 index 0000000..a623221 --- /dev/null +++ b/ramendemoapp/runloop.py @@ -0,0 +1,202 @@ +#!/usr/bin/python +import json,sys,os,time,io,pyodbc,shortuuid +from subprocess import Popen, PIPE +from optparse import OptionParser +from random import seed +from random import randint +from time import sleep +from datetime import datetime + +usage = "Usage: %prog -n jobname [-s sqlserver_address] [-f output_file]" +parser = OptionParser() +parser.add_option("-z", "--size", action="store_true",dest="blocksize",help="Block size to use for IOs",default=False) +parser.add_option("-s", "--server", action="store_true",dest="sqlserver",help="SQL server address is in SQL_SERVER environment variable",default=False) +parser.add_option("-p", "--port", action="store_true",dest="sqlport",help="SQL server port exposed through nodePort",default=False) +parser.add_option("-g", "--debug", action="store_true",dest="debugflag",help="Display debugging info",default=False) +parser.add_option("-f", "--file", action="store",dest="writetofile",help="Write output to file",default="/tmp/outfile") + +global writetofile +global sqlserveraddress +global sqlport +global blocksize +global lastuuid +global last1 +global last2 +global sqlurl +global isprimarycluster +global issecondarycluster +global files + +(options, args) = parser.parse_args() + +writetofile = options.writetofile +sqlurl="" +sqlport = "" +lastuuid = "" +last1 = 0 +last2 = 0 +isprimarycluster = 0 +issecondarycluster = 0 +files = [] + +if (options.blocksize == ""): + printf("%s\n", usage) + exit(1) + +blocksize = options.blocksize + +if (options.blocksize == True): + blocksize = os.getenv('BLOCKSIZE') + +if (options.sqlserver == True): + sqlserveraddress = os.getenv('SQL_SERVER') + +if (options.sqlport == True): + sqlport = os.getenv('SQL_PORT') + sqlserveraddress += ":" + sqlserveraddress += sqlport +# +# See if for automation we are overriding the yaml environment variable +# +sqlurl = os.getenv('SQL_URL', 'ramendemo') +if sqlurl != "": + print ("Overriding environment variable from URL content at "+sqlurl) + tmpval = os.popen("curl "+sqlurl+" 2>/dev/null").read() + if tmpval != "404: Not Found": + sqlserveraddress = tmpval.strip() + +print ("SQL Server Address = "+sqlserveraddress) + +db = os.getenv('DB', 'ramendemo') +user = os.getenv('USER', 'root') +password = os.getenv('PASS', 'redhat') +myname = os.getenv('MYNAME', 'UNKNOWN') + +conn = pyodbc.connect('Driver={MySQL ODBC 8.0 ANSI Driver};' + 'Server='+sqlserveraddress+';' + 'Database='+db+';' + 'uid='+user+';' + 'pwd='+password+';' + 'Trusted_Connection=yes;') + +conn.setdecoding(pyodbc.SQL_CHAR, encoding='utf-8') +conn.setdecoding(pyodbc.SQL_WCHAR, encoding='utf-8') +conn.setencoding(encoding='utf-8') + +cursor = conn.cursor() +#sqlcmd = ("DROP TABLE IF EXISTS ramendemo;") +#cursor.execute(sqlcmd) +# +# Create the table to track the data we write +# +sqlcmd = ("CREATE TABLE IF NOT EXISTS ramendemo (id serial PRIMARY KEY, submit_time DATETIME, complete_time DATETIME, isprimary INT, issecondary INT, fsid VARCHAR(64), stampdate VARCHAR(8), stamptime VARCHAR(6), iosize VARCHAR(16));") +cursor.execute(sqlcmd) +conn.commit() +# +# Create the table to track the current fsid and the previous last stamp writtem +# +sqlcmd = ("CREATE TABLE IF NOT EXISTS ramenfsid (id serial PRIMARY KEY, submit_time DATETIME, cluster1 INT, cluster2 INT, fsid VARCHAR(64), prevdate VARCHAR(8), prevtime VARCHAR(6), gap VARCHAR(12));") +cursor.execute(sqlcmd) +# +# Retrieve the last fsid that was running prior to a failover or failback +# +sqlcmd = ("SELECT * FROM ramendemo.ramenfsid;") +records = cursor.execute(sqlcmd).fetchall() +newramendemofsid = len(records) +# +# Check if table is empty (we are the first occurence of the pod) +# +if newramendemofsid != 0: + print ("Table ramenfsid is NOT empty "+str(newramendemofsid)) + for r in records: + print(str(r.id)+" "+str(r.fsid)) + lastuuid = str(r.fsid) + last1 = int(r.cluster1) + last2 = int(r.cluster2) + print ("Saving "+str(lastuuid)+" for later C1="+str(last1)+" C2="+str(last2)) +else: + print ("Table ramenfsid is empty") +# +# Generate uuid for this new occurence +# +tmyuuid = os.popen("cat /proc/sys/kernel/random/uuid").read() +myuuid = tmyuuid.strip() +# +# Now check on disk what is the latest file we have from previous run time +# +files = os.listdir("/mnt/test") # Get list of files in the target directory +os.chdir("/mnt/test") # Change current directory to access time stamps for file +files.sort(key=os.path.getmtime) # Sort file according to last modification time +lastprevious = files[len(files) - 1] # Last file in array has the kast time stamp as it is the last modified +# +# Leave this here for troubleshooting and debugging +# +print ("Current="+myuuid+" Previous run last file="+lastprevious) +# +# Insert one more row for current fsid tracking +# +# +# If array is zero in size this is the first deployment for the application +# +if newramendemofsid == 0: + isprimarycluster = 1 + issecondarycluster = 0 + sqlcmd = ("INSERT INTO ramendemo.ramenfsid (id, submit_time, cluster1, cluster2, fsid, prevdate, prevtime, gap) VALUES (?, NOW(), 1, 0, ?, ?, ?, ?);") + values = [ str((int(newramendemofsid) + 1)), str(myuuid), "", "", "None" ] +else: +# +# If last1 is non zero we failed over from Cluster1 to Cluster2 +# + if last1 == 1: + isprimarycluster = 0 + issecondarycluster = 1 + sqlcmd = ("INSERT INTO ramendemo.ramenfsid (id, submit_time, cluster1, cluster2, fsid, prevdate, prevtime, gap) VALUES (?, NOW(), 0, 1, ?, ?, ?, ?);") + else: + isprimarycluster = 1 + issecondarycluster = 0 + sqlcmd = ("INSERT INTO ramendemo.ramenfsid (id, submit_time, cluster1, cluster2, fsid, prevdate, prevtime, gap) VALUES (?, NOW(), 1, 0, ?, ?, ?, ?);") +# +# Calculate the time difference between now and the time stamp of the last file written to by previous deployment. +# We get this file eventually because of replication over the Ramen setup +# + workstring=lastprevious[-15:-7]+" "+lastprevious[-6:] + print ("Workstring to recompose date and time pickup = "+workstring) + previousrun=datetime.strptime(workstring, "%Y%m%d %H%M%S") + currentrun=datetime.now() + gap=currentrun - previousrun + seconds = gap.total_seconds() + hours = seconds // 3600 + minutes = (seconds % 3600) // 60 + seconds = seconds % 60 + formattedgap="{0:02.0f}:{1:02.0f}:{2:02.0f}".format(hours, minutes, seconds) + + values = [ str((int(newramendemofsid) + 1)), str(myuuid), lastprevious[-15:-7], lastprevious[-6:], formattedgap ] +cursor.execute(sqlcmd, values) +# +# Then loop until the pod if failed over or failed back +# +while True: + tdatestamp = os.popen("date +%Y%m%d_%H%M%S").read() + filenumber = len(files) + + datestamp = tdatestamp.strip() + + sqlcmd = ("INSERT INTO ramendemo.ramendemo (submit_time, isprimary, issecondary, fsid, stampdate, stamptime, iosize) VALUES (NOW(), ?, ?, ?, ?, ?, ?);") + values = [ str(isprimarycluster), str(issecondarycluster), str(myuuid), datestamp[0:8], datestamp[-6:], str(blocksize) ] + cursor.execute(sqlcmd, values) + + conn.commit() + + cmd = "dd if=/dev/urandom of=/mnt/test/file_"+myuuid+"_"+datestamp+" bs="+blocksize+" count=1 oflag=direct &>/dev/null; echo "+str(int(filenumber) + 1)+","+blocksize+",/mnt/test/file_+"+myuuid+"_"+datestamp+" | tee -a "+writetofile + + outputline = os.popen(cmd).read().strip() +# +# This can be placed back in for troubleshotting or to view in the pod log (via the oc logs command) +# + #print (outputline) + +# +# Commit whatever we have left in the pipe +# + conn.commit() + From d06ebff5b5faeee50ca241b5c41af855bd436d65 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Tue, 14 Dec 2021 15:38:27 -0800 Subject: [PATCH 21/42] Modify mysql default storage class --- ramendemo/mysql/mysql.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemo/mysql/mysql.yaml b/ramendemo/mysql/mysql.yaml index b3260e1..fe95ae3 100644 --- a/ramendemo/mysql/mysql.yaml +++ b/ramendemo/mysql/mysql.yaml @@ -23,7 +23,7 @@ metadata: spec: accessModes: - ReadWriteOnce - storageClassName: ocs-storagecluster-ceph-rbd + #storageClassName: ocs-storagecluster-ceph-rbd resources: requests: storage: 1Gi From 785364fda026c581e11347cc78a3ae3bc49ad410 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Tue, 14 Dec 2021 17:33:39 -0800 Subject: [PATCH 22/42] Automate Grafana operator configuration --- ramendemo/grafana/cm-monitoring.yaml | 8 - ramendemo/grafana/dashboard-bar-new.json | 1028 --------------- ramendemo/grafana/dashboard-bar.json | 1028 --------------- .../dashboard-guillaume-qui-marche.json | 644 --------- ramendemo/grafana/dashboard-new-final.json | 1145 ----------------- ramendemo/grafana/dashboard.json | 451 ------- ramendemo/grafana/dashboard.yaml | 652 ---------- ramendemo/grafana/datasource.yaml | 14 - ramendemo/grafana/grafana-instance.yaml | 24 + ...grafana-mysql-dashboard-for-ramendemo.yaml | 664 ++++++++++ ...rafana-mysql-datasource-for-ramendemo.yaml | 15 + ramendemo/grafana/grafana.yaml | 86 -- ramendemo/grafana/kustomization.yaml | 9 +- 13 files changed, 709 insertions(+), 5059 deletions(-) delete mode 100644 ramendemo/grafana/cm-monitoring.yaml delete mode 100644 ramendemo/grafana/dashboard-bar-new.json delete mode 100644 ramendemo/grafana/dashboard-bar.json delete mode 100644 ramendemo/grafana/dashboard-guillaume-qui-marche.json delete mode 100644 ramendemo/grafana/dashboard-new-final.json delete mode 100644 ramendemo/grafana/dashboard.json delete mode 100644 ramendemo/grafana/dashboard.yaml delete mode 100644 ramendemo/grafana/datasource.yaml create mode 100644 ramendemo/grafana/grafana-instance.yaml create mode 100644 ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml create mode 100644 ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml delete mode 100644 ramendemo/grafana/grafana.yaml diff --git a/ramendemo/grafana/cm-monitoring.yaml b/ramendemo/grafana/cm-monitoring.yaml deleted file mode 100644 index 0d76888..0000000 --- a/ramendemo/grafana/cm-monitoring.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: cluster-monitoring-config - namespace: openshift-monitoring -data: - config.yaml: | - enableUserWorkload: true diff --git a/ramendemo/grafana/dashboard-bar-new.json b/ramendemo/grafana/dashboard-bar-new.json deleted file mode 100644 index a20c47a..0000000 --- a/ramendemo/grafana/dashboard-bar-new.json +++ /dev/null @@ -1,1028 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Visualize the failover and failback of a test application", - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 1, - "links": [], - "panels": [ - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 750 - }, - { - "color": "red", - "value": 900 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 6, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Preferred Cluster - IOs During Grafana Interval", - "type": "gauge" - }, - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 750 - }, - { - "color": "red", - "value": 900 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 7, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "0" - ], - "type": "expression" - } - ] - } - ], - "title": "Failover Cluster - IOs During Grafana Interval", - "transformations": [], - "type": "gauge" - }, - { - "datasource": null, - "description": "Track which cluster is active", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "green", - "value": 10 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "cluster1" - }, - "properties": [ - { - "id": "displayName", - "value": "Preferred Cluster" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "cluster2" - }, - "properties": [ - { - "id": "displayName", - "value": "Failover Cluster" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 9, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "titleSize": 0, - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "Preferred Cluster", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ], - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Cluster State", - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 12, - "y": 8 - }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevdate", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Date Of Data From Cluster 2", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 16, - "y": 8 - }, - "id": 14, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": true - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "hide": false, - "metricColumn": "prevtime", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Time Of Data From Cluster 2", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 20, - "y": 8 - }, - "id": 17, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": true - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - }, - { - "params": [ - "avg" - ], - "type": "aggregate" - }, - { - "params": [ - "cluster1" - ], - "type": "alias" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Gap", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 12, - "y": 12 - }, - "id": 15, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevdate", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Date Of Data From Cluster 1", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 16, - "y": 12 - }, - "id": 16, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevtime", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Time Of Data From Cluster 1", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 20, - "y": 12 - }, - "id": 18, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": true - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - }, - { - "params": [ - "avg" - ], - "type": "aggregate" - }, - { - "params": [ - "cluster1" - ], - "type": "alias" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Gap", - "type": "stat" - } - ], - "refresh": "10s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Ramen Demo", - "uid": "EgUfN127k", - "version": 24 -} diff --git a/ramendemo/grafana/dashboard-bar.json b/ramendemo/grafana/dashboard-bar.json deleted file mode 100644 index 76efa97..0000000 --- a/ramendemo/grafana/dashboard-bar.json +++ /dev/null @@ -1,1028 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Visualize the failover and failback of a test application", - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 1, - "links": [], - "panels": [ - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 750 - }, - { - "color": "red", - "value": 900 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 6, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Cluster 1 - 4K IOs During Grafana Interval", - "type": "gauge" - }, - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 750 - }, - { - "color": "red", - "value": 900 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 7, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "0" - ], - "type": "expression" - } - ] - } - ], - "title": "Cluster 2 - 4K IOs During Grafana Interval", - "transformations": [], - "type": "gauge" - }, - { - "datasource": null, - "description": "Track which cluster is active", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "green", - "value": 10 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "cluster1" - }, - "properties": [ - { - "id": "displayName", - "value": "Cluster 1" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "cluster2" - }, - "properties": [ - { - "id": "displayName", - "value": "Cluster 2" - } - ] - } - ] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 9, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "titleSize": 0, - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "Cluster 1", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ], - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Cluster State", - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 12, - "y": 8 - }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevdate", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Date Of Data From Cluster 2", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 16, - "y": 8 - }, - "id": 14, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": true - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "hide": false, - "metricColumn": "prevtime", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Time Of Data From Cluster 2", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 4, - "x": 20, - "y": 8 - }, - "id": 17, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": true - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - }, - { - "params": [ - "avg" - ], - "type": "aggregate" - }, - { - "params": [ - "cluster1" - ], - "type": "alias" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Gap", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 12, - "y": 12 - }, - "id": 15, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevdate", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Date Of Data From Cluster 1", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 16, - "y": 12 - }, - "id": 16, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevtime", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Last Time Of Data From Cluster 1", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 20, - "y": 12 - }, - "id": 18, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": true - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - }, - { - "params": [ - "avg" - ], - "type": "aggregate" - }, - { - "params": [ - "cluster1" - ], - "type": "alias" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Gap", - "type": "stat" - } - ], - "refresh": "10s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Ramen Demo", - "uid": "EgUfN127k", - "version": 24 -} diff --git a/ramendemo/grafana/dashboard-guillaume-qui-marche.json b/ramendemo/grafana/dashboard-guillaume-qui-marche.json deleted file mode 100644 index d6e24e0..0000000 --- a/ramendemo/grafana/dashboard-guillaume-qui-marche.json +++ /dev/null @@ -1,644 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 1, - "links": [], - "panels": [ - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "displayName": "IO", - "mappings": [], - "max": 2000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 1500 - }, - { - "color": "red", - "value": 1700 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Preferred Cluster", - "transparent": true, - "type": "gauge" - }, - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "displayName": "IO", - "mappings": [], - "max": 2000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 1500 - }, - { - "color": "red", - "value": 1700 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 3, - "options": { - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "0" - ], - "type": "expression" - } - ] - } - ], - "title": "Failover Cluster", - "transparent": true, - "type": "gauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 5, - "interval": null, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Preferred Active", - "transparent": true, - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 6, - "interval": null, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Failover Active", - "transparent": true, - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 12 - }, - "id": 8, - "interval": null, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Last Gap", - "transformations": [], - "transparent": true, - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 12 - }, - "id": 9, - "interval": null, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Last Gap", - "transformations": [], - "transparent": true, - "type": "stat" - } - ], - "refresh": "10s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "RamenDemo", - "uid": "FoE9HChnz", - "version": 15 -} diff --git a/ramendemo/grafana/dashboard-new-final.json b/ramendemo/grafana/dashboard-new-final.json deleted file mode 100644 index b5b1bbf..0000000 --- a/ramendemo/grafana/dashboard-new-final.json +++ /dev/null @@ -1,1145 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Visualize the failover and failback of a test application", - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 1, - "links": [], - "panels": [ - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 750 - }, - { - "color": "red", - "value": 900 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 6, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Preferred Cluster - IOs During Grafana Interval", - "type": "gauge" - }, - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 750 - }, - { - "color": "red", - "value": 900 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 7, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "0" - ], - "type": "expression" - } - ] - } - ], - "title": "Failovber Cluster - IOs During Grafana Interval", - "transformations": [], - "type": "gauge" - }, - { - "datasource": null, - "description": "Track which cluster is active", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "green", - "value": 10 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "cluster1" - }, - "properties": [ - { - "id": "displayName", - "value": "Cluster 1" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "cluster2" - }, - "properties": [ - { - "id": "displayName", - "value": "Cluster 2" - } - ] - } - ] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 9, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "titleSize": 0, - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "Cluster 1", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ], - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Preferred Cluster", - "type": "bargauge" - }, - { - "datasource": null, - "description": "Track which cluster is active", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "green", - "value": 10 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "cluster1" - }, - "properties": [ - { - "id": "displayName", - "value": "Cluster 1" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "cluster2" - }, - "properties": [ - { - "id": "displayName", - "value": "Cluster 2" - } - ] - } - ] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 8 - }, - "id": 19, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "titleSize": 0, - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "Cluster 1", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ], - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Failover Cluster", - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 11 - }, - "id": 17, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - }, - { - "params": [ - "avg" - ], - "type": "aggregate" - }, - { - "params": [ - "cluster1" - ], - "type": "alias" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Gap", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 11 - }, - "id": 18, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n avg(cluster1) AS \"cluster1\"\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - }, - { - "params": [ - "avg" - ], - "type": "aggregate" - }, - { - "params": [ - "cluster1" - ], - "type": "alias" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Gap", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 0, - "y": 14 - }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevdate", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Data Datestamp", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 4, - "y": 14 - }, - "id": 14, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "hide": false, - "metricColumn": "prevtime", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Data Timestamp", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 16, - "y": 14 - }, - "id": 15, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevdate", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevdate AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Data Datestamp", - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 4, - "x": 20, - "y": 14 - }, - "id": 16, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "center", - "orientation": "vertical", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": { - "titleSize": 1, - "valueSize": 30 - }, - "textMode": "value" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "prevtime", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n prevtime AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Data Timestamp", - "type": "stat" - } - ], - "refresh": "5s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Ramen Demo", - "uid": "EgUfN127k", - "version": 30 -} diff --git a/ramendemo/grafana/dashboard.json b/ramendemo/grafana/dashboard.json deleted file mode 100644 index 8f0cd84..0000000 --- a/ramendemo/grafana/dashboard.json +++ /dev/null @@ -1,451 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "Visualize the failover and failback of a test application", - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 1, - "iteration": 1639092313850, - "links": [], - "panels": [ - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 50, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 20 - }, - { - "color": "red", - "value": 30 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 6, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "none" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Cluster 1", - "type": "gauge" - }, - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 50, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "#EAB839", - "value": 20 - }, - { - "color": "red", - "value": 30 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 7, - "options": { - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "none" - ], - "type": "time" - } - ], - "hide": false, - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Cluster 2", - "transformations": [], - "type": "gauge" - }, - { - "aliasColors": { - "cluster2": "red" - }, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": null, - "description": "Track which cluster is active", - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "fill": 0, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 8 - }, - "hiddenSeries": false, - "id": 9, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 2, - "nullPointMode": "null", - "options": { - "alertThreshold": false - }, - "percentage": false, - "pluginVersion": "7.5.2", - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": true, - "steppedLine": true, - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "Cluster 1", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ], - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Cluster State", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "$$hashKey": "object:181", - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": "1", - "min": "0", - "show": true - }, - { - "$$hashKey": "object:182", - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "10s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [ - { - "allValue": null, - "current": { - "selected": false, - "text": "60", - "value": "60" - }, - "datasource": null, - "definition": "select count(*) from ramendemo.ramendemo where fsid=(select fsid from ramendemo.ramenfsid limit 1);", - "description": null, - "error": null, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "rowcount1", - "options": [ - { - "selected": true, - "text": "60", - "value": "60" - } - ], - "query": "select count(*) from ramendemo.ramendemo where fsid=(select fsid from ramendemo.ramenfsid limit 1);", - "refresh": 0, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": null, - "current": { - "selected": false, - "text": "301", - "value": "301" - }, - "datasource": null, - "definition": "SELECT COUNT(*) FROM ramendemo WHERE fsid=(SELECT fsid FROM ramenfsid WHERE id=(SELECT MAX(id) FROM ramenfsid) )", - "description": null, - "error": null, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "rowcount2", - "options": [ - { - "selected": true, - "text": "301", - "value": "301" - } - ], - "query": "SELECT COUNT(*) FROM ramendemo WHERE fsid=(SELECT fsid FROM ramenfsid WHERE id=(SELECT MAX(id) FROM ramenfsid) )", - "refresh": 0, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": [], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-30m", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Ramen Demo", - "uid": "EgUfN127k", - "version": 7 -} diff --git a/ramendemo/grafana/dashboard.yaml b/ramendemo/grafana/dashboard.yaml deleted file mode 100644 index b1fbf44..0000000 --- a/ramendemo/grafana/dashboard.yaml +++ /dev/null @@ -1,652 +0,0 @@ -apiVersion: integreatly.org/v1alpha1 -kind: GrafanaDashboard -metadata: - labels: - app: grafana - name: ramendeno-nodes-dashboard -spec: - json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 1, - "links": [], - "panels": [ - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "displayName": "IO", - "mappings": [], - "max": 2000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 1500 - }, - { - "color": "red", - "value": 1700 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Preferred Cluster", - "transparent": true, - "type": "gauge" - }, - { - "datasource": null, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "displayName": "IO", - "mappings": [], - "max": 2000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 1500 - }, - { - "color": "red", - "value": 1700 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 3, - "options": { - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "0" - ], - "type": "expression" - } - ] - } - ], - "title": "Failover Cluster", - "transparent": true, - "type": "gauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 5, - "interval": null, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Preferred Active", - "transparent": true, - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 6, - "interval": null, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Failover Active", - "transparent": true, - "type": "bargauge" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 12 - }, - "id": 8, - "interval": null, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Last Gap", - "transformations": [], - "transparent": true, - "type": "stat" - }, - { - "datasource": null, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 12 - }, - "id": 9, - "interval": null, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Last Gap", - "transformations": [], - "transparent": true, - "type": "stat" - } - ], - "refresh": "10s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timezone": "", - "title": "RamenDemo", - "uid": "FoE9HChnz", - "version": 15 - } - name: ramendemo-dashboard.json diff --git a/ramendemo/grafana/datasource.yaml b/ramendemo/grafana/datasource.yaml deleted file mode 100644 index f6a3083..0000000 --- a/ramendemo/grafana/datasource.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: integreatly.org/v1alpha1 -kind: GrafanaDataSource -metadata: -name: mysql-grafana-datasource -spec: -datasources: - - type: mysql -name: MySQL -access: proxy -url: ramendemo-mysql -database: ramendemo -user: ramendemo -password: ramendemo -name: grafana-mysql-datasource.yaml diff --git a/ramendemo/grafana/grafana-instance.yaml b/ramendemo/grafana/grafana-instance.yaml new file mode 100644 index 0000000..b74b96d --- /dev/null +++ b/ramendemo/grafana/grafana-instance.yaml @@ -0,0 +1,24 @@ +apiVersion: integreatly.org/v1alpha1 +kind: Grafana +metadata: + name: ramendemo-grafana +spec: + ingress: + enabled: true + config: + auth: + disable_signout_menu: true + auth.anonymous: + enabled: true + log: + level: warn + mode: console + security: + admin_password: ramendemo + admin_user: admin + dashboardLabelSelector: + - matchExpressions: + - key: app + operator: In + values: + - grafana diff --git a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml new file mode 100644 index 0000000..e4d2df0 --- /dev/null +++ b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml @@ -0,0 +1,664 @@ +apiVersion: integreatly.org/v1alpha1 +kind: GrafanaDashboard +metadata: + labels: + app: grafana + name: ramendemo-app-dashboard +spec: + json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "MySQL-RamenDemo", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "isprimary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "issecondary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Ramen Demo Application Dashboard", + "uid": "EtKB_e2nz", + "version": 3 + } diff --git a/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml b/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml new file mode 100644 index 0000000..3d26741 --- /dev/null +++ b/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: integreatly.org/v1alpha1 +kind: GrafanaDataSource +metadata: + name: mysql-grafana-datasource-for-ramendemo +spec: + datasources: + - type: mysql + name: MySQL-RamenDemo + access: proxy + url: ramendemo-mysql + database: ramendemo + user: ramendemo + password: ramendemo + name: grafana-mysql-datasource-for-ramendemo.yaml diff --git a/ramendemo/grafana/grafana.yaml b/ramendemo/grafana/grafana.yaml deleted file mode 100644 index 5334b80..0000000 --- a/ramendemo/grafana/grafana.yaml +++ /dev/null @@ -1,86 +0,0 @@ ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: grafana-pvc - namespace: grafana -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: grafana - name: grafana - namespace: grafana -spec: - selector: - matchLabels: - app: grafana - template: - metadata: - labels: - app: grafana - namespace: grafana - spec: - securityContext: - fsGroup: 472 - supplementalGroups: - - 0 - containers: - - name: grafana - image: grafana/grafana:7.5.2 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 3000 - name: http-grafana - protocol: TCP - readinessProbe: - failureThreshold: 3 - httpGet: - path: /robots.txt - port: 3000 - scheme: HTTP - initialDelaySeconds: 10 - periodSeconds: 30 - successThreshold: 1 - timeoutSeconds: 2 - livenessProbe: - failureThreshold: 3 - initialDelaySeconds: 30 - periodSeconds: 10 - successThreshold: 1 - tcpSocket: - port: 3000 - timeoutSeconds: 1 - resources: - requests: - cpu: 250m - memory: 750Mi - volumeMounts: - - mountPath: /var/lib/grafana - name: grafana-pv - volumes: - - name: grafana-pv - persistentVolumeClaim: - claimName: grafana-pvc ---- -apiVersion: v1 -kind: Service -metadata: - name: grafana - namespace: grafana -spec: - ports: - - port: 3000 - protocol: TCP - targetPort: http-grafana - selector: - app: grafana - sessionAffinity: None - type: LoadBalancer diff --git a/ramendemo/grafana/kustomization.yaml b/ramendemo/grafana/kustomization.yaml index 963c2ab..f9ce208 100644 --- a/ramendemo/grafana/kustomization.yaml +++ b/ramendemo/grafana/kustomization.yaml @@ -1,4 +1,7 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization resources: -- pod-cephrbd-loop-stamp-4k.yaml -- pod-cephrbd-loop-stamp-4m.yaml - +- grafana-instance.yaml +- grafana-mysql-datasource-for-ramendemo.yaml +- grafana-mysql-dashboard-for-ramendemo.yaml From a4f5353e097fd270985f78d00f17a3a8a07d43d7 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Tue, 14 Dec 2021 17:40:32 -0800 Subject: [PATCH 23/42] Update gist for mysql on perf3 in mysql namespace --- ramendemoapp/rbdloop.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemoapp/rbdloop.yaml b/ramendemoapp/rbdloop.yaml index 5b5d753..c975e2d 100644 --- a/ramendemoapp/rbdloop.yaml +++ b/ramendemoapp/rbdloop.yaml @@ -38,7 +38,7 @@ spec: - name: SQL_PORT value: "30036" - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver.url" + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test From ac780c693dd3c6fb0609aa36cdd884379059449c Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Tue, 14 Dec 2021 17:47:01 -0800 Subject: [PATCH 24/42] Change Grafana kustomization file order --- ramendemo/grafana/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemo/grafana/kustomization.yaml b/ramendemo/grafana/kustomization.yaml index f9ce208..d7b89c7 100644 --- a/ramendemo/grafana/kustomization.yaml +++ b/ramendemo/grafana/kustomization.yaml @@ -2,6 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- grafana-instance.yaml - grafana-mysql-datasource-for-ramendemo.yaml - grafana-mysql-dashboard-for-ramendemo.yaml +- grafana-instance.yaml From 671ca61aab767002261a667ebb6080f2e3616da6 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Tue, 14 Dec 2021 18:10:53 -0800 Subject: [PATCH 25/42] Make datasource default and change the editable property --- ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml b/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml index 3d26741..1f52f8c 100644 --- a/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml +++ b/ramendemo/grafana/grafana-mysql-datasource-for-ramendemo.yaml @@ -12,4 +12,6 @@ spec: database: ramendemo user: ramendemo password: ramendemo + isDefault: true + editable: true name: grafana-mysql-datasource-for-ramendemo.yaml From 6e5c1281eea10b416d724083405a6cc0f48631f7 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Wed, 15 Dec 2021 08:20:54 -0800 Subject: [PATCH 26/42] Fix SQL_URL and change to default storage class for ACM hub tresting --- ramendemo/app/rbdloop.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml index 16e970d..4229e17 100644 --- a/ramendemo/app/rbdloop.yaml +++ b/ramendemo/app/rbdloop.yaml @@ -11,7 +11,7 @@ spec: resources: requests: storage: 10Gi - storageClassName: ocs-storagecluster-ceph-rbdmirror + #storageClassName: ocs-storagecluster-ceph-rbdmirror --- apiVersion: v1 kind: Pod @@ -42,7 +42,7 @@ spec: - name: SQL_PORT value: "30036" - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test From 15e7ad579abc357a2d05ceda32025536ff0dcac2 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Wed, 15 Dec 2021 11:58:27 -0800 Subject: [PATCH 27/42] For Annette WS environment --- ramendemo/app/rbdloop.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml index 4229e17..8acc505 100644 --- a/ramendemo/app/rbdloop.yaml +++ b/ramendemo/app/rbdloop.yaml @@ -36,13 +36,13 @@ spec: - '--port' env: - name: BLOCKSIZE - value: "4K" + value: "4096" - name: SQL_SERVER - value: "ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja" + value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" - name: SQL_PORT - value: "30036" - - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url" + value: "30136" +# - name: SQL_URL +# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test From dca6d5eb7593747861382d2df0f91c5da1ae6140 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Wed, 15 Dec 2021 13:58:13 -0800 Subject: [PATCH 28/42] Dashboard fix and switch rbdloop.yaml to Annette AWS --- ...ana-mysql-dashboard-for-ramendemo-old.yaml | 664 +++++++++++++++++ guimou-qui-marche-encore.json | 660 +++++++++++++++++ ramendemo/app/rbdloop.yaml | 6 +- ...grafana-mysql-dashboard-for-ramendemo.yaml | 675 +++++++++++++++++- 4 files changed, 1994 insertions(+), 11 deletions(-) create mode 100644 grafana-mysql-dashboard-for-ramendemo-old.yaml create mode 100644 guimou-qui-marche-encore.json diff --git a/grafana-mysql-dashboard-for-ramendemo-old.yaml b/grafana-mysql-dashboard-for-ramendemo-old.yaml new file mode 100644 index 0000000..e4d2df0 --- /dev/null +++ b/grafana-mysql-dashboard-for-ramendemo-old.yaml @@ -0,0 +1,664 @@ +apiVersion: integreatly.org/v1alpha1 +kind: GrafanaDashboard +metadata: + labels: + app: grafana + name: ramendemo-app-dashboard +spec: + json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "MySQL-RamenDemo", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "isprimary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "issecondary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Ramen Demo Application Dashboard", + "uid": "EtKB_e2nz", + "version": 3 + } diff --git a/guimou-qui-marche-encore.json b/guimou-qui-marche-encore.json new file mode 100644 index 0000000..510b616 --- /dev/null +++ b/guimou-qui-marche-encore.json @@ -0,0 +1,660 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "MySQL-RamenDemo", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0.1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "isprimary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0.1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "issecondary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "utc", + "title": "Ramen Demo Application Dashboard", + "uid": "EtKB_e2nz", + "version": 2 +} diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml index 8acc505..21bef9e 100644 --- a/ramendemo/app/rbdloop.yaml +++ b/ramendemo/app/rbdloop.yaml @@ -23,7 +23,7 @@ spec: containers: - name: batch-4k image: quay.io/vcppds7878/busybox:rbdloop - imagePullPolicy: Always + imagePullPolicy: IfNotPresent # command: ["sh"] # args: # - '-c' @@ -41,8 +41,8 @@ spec: value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" - name: SQL_PORT value: "30136" -# - name: SQL_URL -# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url" + - name: SQL_URL + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/900ac1a34a3c98fc0f668a24d1e7dc8ef107f6dc/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test diff --git a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml index e4d2df0..b74b7cb 100644 --- a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml +++ b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml @@ -75,7 +75,7 @@ spec: "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "7.5.2", + "pluginVersion": "7.5.11", "targets": [ { "format": "time_series", @@ -189,7 +189,7 @@ spec: "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "7.5.2", + "pluginVersion": "7.5.11", "targets": [ { "format": "time_series", @@ -262,6 +262,8 @@ spec: "mode": "thresholds" }, "mappings": [], + "max": 1, + "min": 0.1, "thresholds": { "mode": "absolute", "steps": [ @@ -297,7 +299,7 @@ spec: "valueSize": 0 } }, - "pluginVersion": "7.5.2", + "pluginVersion": "7.5.11", "targets": [ { "format": "time_series", @@ -342,6 +344,8 @@ spec: "mode": "thresholds" }, "mappings": [], + "max": 1, + "min": 0.1, "thresholds": { "mode": "absolute", "steps": [ @@ -377,7 +381,7 @@ spec: "valueSize": 0 } }, - "pluginVersion": "7.5.2", + "pluginVersion": "7.5.11", "targets": [ { "format": "time_series", @@ -457,7 +461,7 @@ spec: "text": {}, "textMode": "auto" }, - "pluginVersion": "7.5.2", + "pluginVersion": "7.5.11", "targets": [ { "format": "table", @@ -566,7 +570,7 @@ spec: "text": {}, "textMode": "auto" }, - "pluginVersion": "7.5.2", + "pluginVersion": "7.5.11", "targets": [ { "format": "table", @@ -657,8 +661,663 @@ spec: "1d" ] }, - "timezone": "", + "timezone": "utc", "title": "Ramen Demo Application Dashboard", "uid": "EtKB_e2nz", - "version": 3 + "version": 2 } + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "MySQL-RamenDemo", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "isprimary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "issecondary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "UTC", + "title": "Ramen Demo Application Dashboard", + "uid": "EtKB_e2nz", + "version": 3 + } From e7b30906375cc0345781ce034cb5e440abdddcee Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Wed, 15 Dec 2021 15:55:49 -0800 Subject: [PATCH 29/42] Fix bar min and max values and add instructions --- README.md | 103 +- ...ana-mysql-dashboard-for-ramendemo-new.yaml | 1323 +++++++++++++++++ ramendemo/app/rbdloop.yaml | 2 +- ...grafana-mysql-dashboard-for-ramendemo.yaml | 675 +-------- ramendemo/grafana/operator.yaml | 11 + 5 files changed, 1426 insertions(+), 688 deletions(-) create mode 100644 grafana-mysql-dashboard-for-ramendemo-new.yaml create mode 100644 ramendemo/grafana/operator.yaml diff --git a/README.md b/README.md index 135103a..43878fe 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,81 @@ -# Application Samples -The home for Application samples, based on the open-clutser-management.io Subscription, Channel and Placement API - -## Requirements -- `open-cluster-management.io` or Red Hat Advanced Cluster Management for Kubernetes. -- Cluster's labelled as `development`, `test` and/or `production -```yaml -metadata: - labels: - usage: development -``` - -# How to use -1. The first time you want to start using the Subscriptions from the CLI, add the channel (source) repository. -```bash -oc apply -k subscriptions/channel -``` -2. Now apply the subscription you want to demonstrato -```bash -oc apply -k subscriptions/DEMO_APP_NAME -``` -3. You can also add these applications using the Red Had Advanced Cluster Management for Kubernetes console. \ No newline at end of file +RBD Loop Demo With Dash Board + +Fork my repo at https://github.com/jeanchlopez/application-samples +git clone https://github.com/{username}/application-samples +cd application-samples +git checkout ramendemo +git fetch +git pull + +Deploying The MYSQL Server +In ACM create new application +Name = ramendemo-mysql +Namespace = ramendemo-mysql +Git = https://github.com/{username}/application-samples +Branch = ramendemo +Path = ramendemo/mysql + +Deploy to local cluster + +Deploying the Grafana dashboard +cd grafana +oc project ramendemo-mysql Project name has to be the same as the one you specified for mysql +Deploy the Grafana operator +oc create -f ./operator.yaml + +Wait for the operator to be deployed with an oc get csv -n mysql command + +Once the operator is deployed, customize the operator +oc create -k . + +Wait for the Grafana pod to restart (the user and password for Grafana if you need to log in is admin/ramendemo + +Do an oc get route to check where to reach the Grafana UI + +Update the rbdloop.yaml for parameters matching your environment +cd ../app +cat rbdloop.yaml +[…] + - name: SQL_SERVER + value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" + - name: SQL_PORT + value: "30136" +# - name: SQL_URL +# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” +[…] + +Option 1 - Your environment always uses the same base domain and you use the default ./mysql/mysql.kustomization.yaml from this repo + +Change the value for the SQL_SERVER environment variable value that matches your name space and your base domain + +e.g. You have deployed with ACM the MySQL server +Namespace = mysqljc +Base domain = ocstraining.com + +You would set the SQL_SERVER value = ramendemo-mysql-mysqljc.apps.ocstraining.com + +Option 2 - You have a GIST available with the MySQL Server address. The URL must point to a raw gist. + +Verify the path to your raw gist like this + +curl https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url +ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja:30136 + +Remove the comment in front of the SQL_URL environment variable + +e.g. +# - name: SQL_URL +# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” + +Update your gist with the correct MySQL server address (Remember that this repo configures port 30136 by default for the MySQL DB so just change the FQDN + +Deploy the app +In ACM create new application +Name = {Your Choice} +Namespace = {Your Choice} +Git = https://github.com/{username}/application-samples +Branch = ramendemo +Path = ramendemo/app + + + diff --git a/grafana-mysql-dashboard-for-ramendemo-new.yaml b/grafana-mysql-dashboard-for-ramendemo-new.yaml new file mode 100644 index 0000000..b74b7cb --- /dev/null +++ b/grafana-mysql-dashboard-for-ramendemo-new.yaml @@ -0,0 +1,1323 @@ +apiVersion: integreatly.org/v1alpha1 +kind: GrafanaDashboard +metadata: + labels: + app: grafana + name: ramendemo-app-dashboard +spec: + json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "MySQL-RamenDemo", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0.1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "isprimary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 1, + "min": 0.1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "issecondary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "utc", + "title": "Ramen Demo Application Dashboard", + "uid": "EtKB_e2nz", + "version": 2 + } + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "MySQL-RamenDemo", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 2, + "links": [], + "panels": [ + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "title": "Preferred Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "displayName": "IO", + "mappings": [], + "max": 2000, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "yellow", + "value": 1500 + }, + { + "color": "red", + "value": 1700 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 3, + "options": { + "reduceOptions": { + "calcs": [], + "fields": "", + "values": false + }, + "showThresholdLabels": true, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "id" + ], + "type": "column" + }, + { + "params": [ + "count" + ], + "type": "aggregate" + }, + { + "params": [ + "id" + ], + "type": "alias" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "int", + "name": "", + "params": [ + "isprimary", + "=", + "0" + ], + "type": "expression" + } + ] + } + ], + "title": "Failover Cluster", + "transparent": true, + "type": "gauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 5, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "isprimary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Preferred Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 6, + "interval": null, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showUnfilled": false, + "text": { + "valueSize": 0 + } + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "time_series", + "group": [], + "metricColumn": "none", + "rawQuery": false, + "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", + "refId": "A", + "select": [ + [ + { + "params": [ + "issecondary" + ], + "type": "column" + } + ] + ], + "table": "ramendemo", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Failover Active", + "transparent": true, + "type": "bargauge" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 12 + }, + "id": 8, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster1" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster1", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + }, + { + "datasource": "MySQL-RamenDemo", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 12 + }, + "id": 9, + "interval": null, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^metric$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "7.5.2", + "targets": [ + { + "format": "table", + "group": [ + { + "params": [ + "$__interval", + "0" + ], + "type": "time" + } + ], + "metricColumn": "gap", + "rawQuery": false, + "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", + "refId": "A", + "select": [ + [ + { + "params": [ + "cluster2" + ], + "type": "column" + } + ] + ], + "table": "ramenfsid", + "timeColumn": "submit_time", + "timeColumnType": "datetime", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + }, + { + "datatype": "varchar", + "name": "", + "params": [ + "prevdate", + "!=", + "0" + ], + "type": "expression" + }, + { + "datatype": "int", + "name": "", + "params": [ + "cluster2", + "=", + "1" + ], + "type": "expression" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Last Gap", + "transformations": [], + "transparent": true, + "type": "stat" + } + ], + "refresh": "10s", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "UTC", + "title": "Ramen Demo Application Dashboard", + "uid": "EtKB_e2nz", + "version": 3 + } diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml index 21bef9e..ed26de0 100644 --- a/ramendemo/app/rbdloop.yaml +++ b/ramendemo/app/rbdloop.yaml @@ -11,7 +11,7 @@ spec: resources: requests: storage: 10Gi - #storageClassName: ocs-storagecluster-ceph-rbdmirror + storageClassName: ocs-storagecluster-ceph-rbdmirror --- apiVersion: v1 kind: Pod diff --git a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml index b74b7cb..721a1aa 100644 --- a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml +++ b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml @@ -75,7 +75,7 @@ spec: "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "7.5.11", + "pluginVersion": "7.5.2", "targets": [ { "format": "time_series", @@ -189,7 +189,7 @@ spec: "showThresholdMarkers": true, "text": {} }, - "pluginVersion": "7.5.11", + "pluginVersion": "7.5.2", "targets": [ { "format": "time_series", @@ -262,8 +262,6 @@ spec: "mode": "thresholds" }, "mappings": [], - "max": 1, - "min": 0.1, "thresholds": { "mode": "absolute", "steps": [ @@ -299,7 +297,7 @@ spec: "valueSize": 0 } }, - "pluginVersion": "7.5.11", + "pluginVersion": "7.5.2", "targets": [ { "format": "time_series", @@ -381,7 +379,7 @@ spec: "valueSize": 0 } }, - "pluginVersion": "7.5.11", + "pluginVersion": "7.5.2", "targets": [ { "format": "time_series", @@ -426,6 +424,8 @@ spec: "mode": "thresholds" }, "mappings": [], + "max": 1, + "min": 0.1, "thresholds": { "mode": "absolute", "steps": [ @@ -461,7 +461,7 @@ spec: "text": {}, "textMode": "auto" }, - "pluginVersion": "7.5.11", + "pluginVersion": "7.5.2", "targets": [ { "format": "table", @@ -570,7 +570,7 @@ spec: "text": {}, "textMode": "auto" }, - "pluginVersion": "7.5.11", + "pluginVersion": "7.5.2", "targets": [ { "format": "table", @@ -661,663 +661,8 @@ spec: "1d" ] }, - "timezone": "utc", + "timezone": "", "title": "Ramen Demo Application Dashboard", "uid": "EtKB_e2nz", - "version": 2 + "version": 3 } - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "MySQL-RamenDemo", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "gnetId": null, - "graphTooltip": 0, - "id": 2, - "links": [], - "panels": [ - { - "datasource": "MySQL-RamenDemo", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "displayName": "IO", - "mappings": [], - "max": 2000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 1500 - }, - { - "color": "red", - "value": 1700 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 1\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "title": "Preferred Cluster", - "transparent": true, - "type": "gauge" - }, - { - "datasource": "MySQL-RamenDemo", - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "displayName": "IO", - "mappings": [], - "max": 2000, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 1500 - }, - { - "color": "red", - "value": 1700 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 3, - "options": { - "reduceOptions": { - "calcs": [], - "fields": "", - "values": false - }, - "showThresholdLabels": true, - "showThresholdMarkers": true, - "text": {} - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n count(id) AS \"id\"\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time) AND\n isprimary = 0\nGROUP BY 1\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "id" - ], - "type": "column" - }, - { - "params": [ - "count" - ], - "type": "aggregate" - }, - { - "params": [ - "id" - ], - "type": "alias" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "int", - "name": "", - "params": [ - "isprimary", - "=", - "0" - ], - "type": "expression" - } - ] - } - ], - "title": "Failover Cluster", - "transparent": true, - "type": "gauge" - }, - { - "datasource": "MySQL-RamenDemo", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 5, - "interval": null, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n isprimary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "isprimary" - ], - "type": "column" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Preferred Active", - "transparent": true, - "type": "bargauge" - }, - { - "datasource": "MySQL-RamenDemo", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 6, - "interval": null, - "options": { - "displayMode": "gradient", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "last" - ], - "fields": "", - "values": false - }, - "showUnfilled": false, - "text": { - "valueSize": 0 - } - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n submit_time AS \"time\",\n issecondary\nFROM ramendemo\nWHERE\n $__timeFilter(submit_time)\nORDER BY submit_time", - "refId": "A", - "select": [ - [ - { - "params": [ - "issecondary" - ], - "type": "column" - } - ] - ], - "table": "ramendemo", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Failover Active", - "transparent": true, - "type": "bargauge" - }, - { - "datasource": "MySQL-RamenDemo", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 0, - "y": 12 - }, - "id": 8, - "interval": null, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster1\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster1 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster1" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster1", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Last Gap", - "transformations": [], - "transparent": true, - "type": "stat" - }, - { - "datasource": "MySQL-RamenDemo", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 3, - "w": 12, - "x": 12, - "y": 12 - }, - "id": 9, - "interval": null, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^metric$/", - "values": false - }, - "text": {}, - "textMode": "auto" - }, - "pluginVersion": "7.5.2", - "targets": [ - { - "format": "table", - "group": [ - { - "params": [ - "$__interval", - "0" - ], - "type": "time" - } - ], - "metricColumn": "gap", - "rawQuery": false, - "rawSql": "SELECT\n $__timeGroupAlias(submit_time,$__interval,0),\n gap AS metric,\n cluster2\nFROM ramenfsid\nWHERE\n $__timeFilter(submit_time) AND\n prevdate != 0 AND\n cluster2 = 1\nGROUP BY 1,2\nORDER BY $__timeGroup(submit_time,$__interval,0)", - "refId": "A", - "select": [ - [ - { - "params": [ - "cluster2" - ], - "type": "column" - } - ] - ], - "table": "ramenfsid", - "timeColumn": "submit_time", - "timeColumnType": "datetime", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "varchar", - "name": "", - "params": [ - "prevdate", - "!=", - "0" - ], - "type": "expression" - }, - { - "datatype": "int", - "name": "", - "params": [ - "cluster2", - "=", - "1" - ], - "type": "expression" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Last Gap", - "transformations": [], - "transparent": true, - "type": "stat" - } - ], - "refresh": "10s", - "schemaVersion": 27, - "style": "dark", - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-5m", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ] - }, - "timezone": "UTC", - "title": "Ramen Demo Application Dashboard", - "uid": "EtKB_e2nz", - "version": 3 - } diff --git a/ramendemo/grafana/operator.yaml b/ramendemo/grafana/operator.yaml new file mode 100644 index 0000000..1b1e0cc --- /dev/null +++ b/ramendemo/grafana/operator.yaml @@ -0,0 +1,11 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: grafana-operator +spec: + channel: v4 + installPlanApproval: Automatic + name: grafana-operator + source: community-operators + sourceNamespace: openshift-marketplace + startingCSV: grafana-operator.v4.1.0 From 1fed0f71134454f2194086cc162cbdf8073efe38 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Wed, 15 Dec 2021 16:48:51 -0800 Subject: [PATCH 30/42] Move README.md file for ramendemoapp --- README.md | 103 ++++++++++---------------------------------- ramendemo/README.md | 81 ++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+), 81 deletions(-) create mode 100644 ramendemo/README.md diff --git a/README.md b/README.md index 43878fe..eeb2a40 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,22 @@ -RBD Loop Demo With Dash Board - -Fork my repo at https://github.com/jeanchlopez/application-samples -git clone https://github.com/{username}/application-samples -cd application-samples -git checkout ramendemo -git fetch -git pull - -Deploying The MYSQL Server -In ACM create new application -Name = ramendemo-mysql -Namespace = ramendemo-mysql -Git = https://github.com/{username}/application-samples -Branch = ramendemo -Path = ramendemo/mysql - -Deploy to local cluster - -Deploying the Grafana dashboard -cd grafana -oc project ramendemo-mysql Project name has to be the same as the one you specified for mysql -Deploy the Grafana operator -oc create -f ./operator.yaml - -Wait for the operator to be deployed with an oc get csv -n mysql command - -Once the operator is deployed, customize the operator -oc create -k . - -Wait for the Grafana pod to restart (the user and password for Grafana if you need to log in is admin/ramendemo - -Do an oc get route to check where to reach the Grafana UI - -Update the rbdloop.yaml for parameters matching your environment -cd ../app -cat rbdloop.yaml -[…] - - name: SQL_SERVER - value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" - - name: SQL_PORT - value: "30136" -# - name: SQL_URL -# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” -[…] - -Option 1 - Your environment always uses the same base domain and you use the default ./mysql/mysql.kustomization.yaml from this repo - -Change the value for the SQL_SERVER environment variable value that matches your name space and your base domain - -e.g. You have deployed with ACM the MySQL server -Namespace = mysqljc -Base domain = ocstraining.com - -You would set the SQL_SERVER value = ramendemo-mysql-mysqljc.apps.ocstraining.com - -Option 2 - You have a GIST available with the MySQL Server address. The URL must point to a raw gist. - -Verify the path to your raw gist like this - -curl https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url -ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja:30136 - -Remove the comment in front of the SQL_URL environment variable - -e.g. -# - name: SQL_URL -# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” - -Update your gist with the correct MySQL server address (Remember that this repo configures port 30136 by default for the MySQL DB so just change the FQDN - -Deploy the app -In ACM create new application -Name = {Your Choice} -Namespace = {Your Choice} -Git = https://github.com/{username}/application-samples -Branch = ramendemo -Path = ramendemo/app - - - +# Application Samples +The home for Application samples, based on the open-clutser-management.io Subscription, Channel and Placement API + +## Requirements +- `open-cluster-management.io` or Red Hat Advanced Cluster Management for Kubernetes. +- Cluster's labelled as `development`, `test` and/or `production +```yaml +metadata: + labels: + usage: development +``` + +# How to use +1. The first time you want to start using the Subscriptions from the CLI, add the channel (source) repository. +```bash +oc apply -k subscriptions/channel +``` +2. Now apply the subscription you want to demonstrato +```bash +oc apply -k subscriptions/DEMO_APP_NAME +``` +3. You can also add these applications using the Red Had Advanced Cluster Management for Kubernetes console. diff --git a/ramendemo/README.md b/ramendemo/README.md new file mode 100644 index 0000000..43878fe --- /dev/null +++ b/ramendemo/README.md @@ -0,0 +1,81 @@ +RBD Loop Demo With Dash Board + +Fork my repo at https://github.com/jeanchlopez/application-samples +git clone https://github.com/{username}/application-samples +cd application-samples +git checkout ramendemo +git fetch +git pull + +Deploying The MYSQL Server +In ACM create new application +Name = ramendemo-mysql +Namespace = ramendemo-mysql +Git = https://github.com/{username}/application-samples +Branch = ramendemo +Path = ramendemo/mysql + +Deploy to local cluster + +Deploying the Grafana dashboard +cd grafana +oc project ramendemo-mysql Project name has to be the same as the one you specified for mysql +Deploy the Grafana operator +oc create -f ./operator.yaml + +Wait for the operator to be deployed with an oc get csv -n mysql command + +Once the operator is deployed, customize the operator +oc create -k . + +Wait for the Grafana pod to restart (the user and password for Grafana if you need to log in is admin/ramendemo + +Do an oc get route to check where to reach the Grafana UI + +Update the rbdloop.yaml for parameters matching your environment +cd ../app +cat rbdloop.yaml +[…] + - name: SQL_SERVER + value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" + - name: SQL_PORT + value: "30136" +# - name: SQL_URL +# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” +[…] + +Option 1 - Your environment always uses the same base domain and you use the default ./mysql/mysql.kustomization.yaml from this repo + +Change the value for the SQL_SERVER environment variable value that matches your name space and your base domain + +e.g. You have deployed with ACM the MySQL server +Namespace = mysqljc +Base domain = ocstraining.com + +You would set the SQL_SERVER value = ramendemo-mysql-mysqljc.apps.ocstraining.com + +Option 2 - You have a GIST available with the MySQL Server address. The URL must point to a raw gist. + +Verify the path to your raw gist like this + +curl https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url +ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja:30136 + +Remove the comment in front of the SQL_URL environment variable + +e.g. +# - name: SQL_URL +# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” + +Update your gist with the correct MySQL server address (Remember that this repo configures port 30136 by default for the MySQL DB so just change the FQDN + +Deploy the app +In ACM create new application +Name = {Your Choice} +Namespace = {Your Choice} +Git = https://github.com/{username}/application-samples +Branch = ramendemo +Path = ramendemo/app + + + From 5f06d5d2ffea2996858af958b22391d1cb3bc720 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Wed, 15 Dec 2021 17:14:21 -0800 Subject: [PATCH 31/42] Fix min max at the incorrect place --- .../grafana/grafana-mysql-dashboard-for-ramendemo.yaml | 4 ++-- ramendemo/rbdloop-new.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml index 721a1aa..d4f2805 100644 --- a/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml +++ b/ramendemo/grafana/grafana-mysql-dashboard-for-ramendemo.yaml @@ -262,6 +262,8 @@ spec: "mode": "thresholds" }, "mappings": [], + "max": 1, + "min": 0.1, "thresholds": { "mode": "absolute", "steps": [ @@ -424,8 +426,6 @@ spec: "mode": "thresholds" }, "mappings": [], - "max": 1, - "min": 0.1, "thresholds": { "mode": "absolute", "steps": [ diff --git a/ramendemo/rbdloop-new.yaml b/ramendemo/rbdloop-new.yaml index 8ee8504..a7c9087 100644 --- a/ramendemo/rbdloop-new.yaml +++ b/ramendemo/rbdloop-new.yaml @@ -37,11 +37,11 @@ spec: - name: BLOCKSIZE value: "4096" - name: SQL_SERVER - value: "ramendemo-mysql-testjc.apps.perf1.chris.ocs.ninja" + value: "ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja" - name: SQL_PORT - value: "99999" - - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver.url" + value: "30136" +# - name: SQL_URL +# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test From fb00e81de7d3cddea9933aaeb69b60212b7445a9 Mon Sep 17 00:00:00 2001 From: jeanchlopez Date: Thu, 16 Dec 2021 11:13:29 -0800 Subject: [PATCH 32/42] Convert instructions to markdown --- ramendemo/README.md | 95 +++++++++++++++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 30 deletions(-) diff --git a/ramendemo/README.md b/ramendemo/README.md index 43878fe..848f729 100644 --- a/ramendemo/README.md +++ b/ramendemo/README.md @@ -1,38 +1,62 @@ -RBD Loop Demo With Dash Board +# RBD demo application with dashboard -Fork my repo at https://github.com/jeanchlopez/application-samples +## Prepare your demo +Fork my repo at `https://github.com/jeanchlopez/application-samples` + +``` git clone https://github.com/{username}/application-samples cd application-samples git checkout ramendemo git fetch git pull +``` + +## Deploying MySQL Server -Deploying The MYSQL Server In ACM create new application -Name = ramendemo-mysql -Namespace = ramendemo-mysql -Git = https://github.com/{username}/application-samples -Branch = ramendemo -Path = ramendemo/mysql + +- Name = `ramendemo-mysql` +- Namespace = `ramendemo-mysql` +- Git = `https://github.com/{username}/application-samples` +- Branch = `ramendemo` +- Path = `ramendemo/mysql` Deploy to local cluster -Deploying the Grafana dashboard +## Deploying Grafana dashboard + +Due to an issue with the Grafana operator (`https://github.com/grafana-operator/grafana-operator/issues/655`) +the dashboard can not be configured via ACM. + +You will have to deploy the Grafana dashboard in the same namespace as the one where the MySQl server was deployed. + +``` cd grafana -oc project ramendemo-mysql Project name has to be the same as the one you specified for mysql +oc project ramendemo-mysql Deploy the Grafana operator oc create -f ./operator.yaml +``` Wait for the operator to be deployed with an oc get csv -n mysql command Once the operator is deployed, customize the operator + +``` oc create -k . +``` + +Wait for the Grafana pod to restart. If you need to connect with admin privilege use the following credentials. + +- User name = `admin` +- Password = `ramendemo` -Wait for the Grafana pod to restart (the user and password for Grafana if you need to log in is admin/ramendemo +Do an `oc get route -n ramendemo-mysql` to check where to reach the Grafana UI -Do an oc get route to check where to reach the Grafana UI +## Configure MySQl address for test application -Update the rbdloop.yaml for parameters matching your environment +Update the `rbdloop.yaml` with parameters matching your environment + +``` cd ../app cat rbdloop.yaml […] @@ -43,39 +67,50 @@ cat rbdloop.yaml # - name: SQL_URL # value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” […] +``` + +### Option 1 -Option 1 - Your environment always uses the same base domain and you use the default ./mysql/mysql.kustomization.yaml from this repo +Your environment always uses the same base domain and you use the default `./mysql/mysql.kustomization.yaml` from this repo. -Change the value for the SQL_SERVER environment variable value that matches your name space and your base domain +Change the value for the `SQL_SERVER` environment variable value that matches your name space and your base domain. e.g. You have deployed with ACM the MySQL server -Namespace = mysqljc -Base domain = ocstraining.com -You would set the SQL_SERVER value = ramendemo-mysql-mysqljc.apps.ocstraining.com +- Namespace = mysqljc +- Base domain = ocstraining.com + +You would set the `SQL_SERVER` value to `ramendemo-mysql-mysqljc.apps.ocstraining.com`. -Option 2 - You have a GIST available with the MySQL Server address. The URL must point to a raw gist. +### Option 2 + +You have a `gist` available with the MySQL Server address. The URL must point to a raw gist. Verify the path to your raw gist like this +``` curl https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja:30136 +``` -Remove the comment in front of the SQL_URL environment variable +Remove the comment in front of the `SQL_URL` environment variable. e.g. -# - name: SQL_URL -# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” -Update your gist with the correct MySQL server address (Remember that this repo configures port 30136 by default for the MySQL DB so just change the FQDN +``` + - name: SQL_URL + value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” +``` -Deploy the app -In ACM create new application -Name = {Your Choice} -Namespace = {Your Choice} -Git = https://github.com/{username}/application-samples -Branch = ramendemo -Path = ramendemo/app +Update your `gist` with the correct MySQL server address (Remember that this repo configures port 30136 by default for the MySQL DB so just change the FQDN +## Deploy the app + +In ACM create new application +- Name = `{Your Choice}` +- Namespace = `{Your Choice}` +- Git = `https://github.com/{username}/application-samples` +- Branch = `ramendemo` +- Path = `ramendemo/app` From 70e384b972b1ce4612dedfd11066e1c5ee0196b1 Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Fri, 17 Dec 2021 01:57:04 +0000 Subject: [PATCH 33/42] Modified rbdloop.yaml --- ramendemo/app/rbdloop.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml index ed26de0..6c7150d 100644 --- a/ramendemo/app/rbdloop.yaml +++ b/ramendemo/app/rbdloop.yaml @@ -38,11 +38,9 @@ spec: - name: BLOCKSIZE value: "4096" - name: SQL_SERVER - value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" + value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" - name: SQL_PORT value: "30136" - - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/900ac1a34a3c98fc0f668a24d1e7dc8ef107f6dc/sqlserver.url" volumeMounts: - name: tmp-store mountPath: /mnt/test From 8a61a78c4304aca8422674a6cafbc302025c3661 Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Fri, 17 Dec 2021 02:27:09 +0000 Subject: [PATCH 34/42] add rbdloop.yaml --- ramendemo/app/rbdloop-drpc.yaml | 17 ++++++++ ramendemo/app/rbdloop-placementrule.yaml | 13 ++++++ ramendemo/grafana/operator.yaml | 14 ++++++- ramendemo/kustomization.yaml | 3 ++ ramendemo/rbdloop-drpc.yaml | 17 ++++++++ ramendemo/rbdloop-placementrule.yaml | 13 ++++++ ramendemo/rbdloop.yaml | 52 ++++++++++++++++++++++++ 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 ramendemo/app/rbdloop-drpc.yaml create mode 100644 ramendemo/app/rbdloop-placementrule.yaml create mode 100644 ramendemo/kustomization.yaml create mode 100644 ramendemo/rbdloop-drpc.yaml create mode 100644 ramendemo/rbdloop-placementrule.yaml create mode 100644 ramendemo/rbdloop.yaml diff --git a/ramendemo/app/rbdloop-drpc.yaml b/ramendemo/app/rbdloop-drpc.yaml new file mode 100644 index 0000000..4d86808 --- /dev/null +++ b/ramendemo/app/rbdloop-drpc.yaml @@ -0,0 +1,17 @@ +apiVersion: ramendr.openshift.io/v1alpha1 +kind: DRPlacementControl +metadata: + labels: + appname: rbdloop + name: rbdloop-drpc + namespace: rbdloop-dashboard +spec: + drPolicyRef: + name: odr-policy-5m + placementRef: + kind: PlacementRule + name: rbdloop-placement + preferredCluster: cluster1 + pvcSelector: + matchLabels: + appname: rbdloop diff --git a/ramendemo/app/rbdloop-placementrule.yaml b/ramendemo/app/rbdloop-placementrule.yaml new file mode 100644 index 0000000..e484087 --- /dev/null +++ b/ramendemo/app/rbdloop-placementrule.yaml @@ -0,0 +1,13 @@ +apiVersion: apps.open-cluster-management.io/v1 +kind: PlacementRule +metadata: + labels: + appname: rbdloop + name: rbdloop-placement + namespace: rbdloop-dashboard +spec: + clusterConditions: + - status: "True" + type: ManagedClusterConditionAvailable + clusterReplicas: 1 + schedulerName: ramen diff --git a/ramendemo/grafana/operator.yaml b/ramendemo/grafana/operator.yaml index 1b1e0cc..92c5718 100644 --- a/ramendemo/grafana/operator.yaml +++ b/ramendemo/grafana/operator.yaml @@ -1,3 +1,16 @@ +--- +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: ramendemo-mysql-operatorgroup + namespace: ramendemo-mysql +spec: + serviceAccount: + metadata: + creationTimestamp: null + targetNamespaces: + - ramendemo-mysql +--- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: @@ -8,4 +21,3 @@ spec: name: grafana-operator source: community-operators sourceNamespace: openshift-marketplace - startingCSV: grafana-operator.v4.1.0 diff --git a/ramendemo/kustomization.yaml b/ramendemo/kustomization.yaml new file mode 100644 index 0000000..93a8a6b --- /dev/null +++ b/ramendemo/kustomization.yaml @@ -0,0 +1,3 @@ +resources: +- app/rbdloop.yaml + diff --git a/ramendemo/rbdloop-drpc.yaml b/ramendemo/rbdloop-drpc.yaml new file mode 100644 index 0000000..4d86808 --- /dev/null +++ b/ramendemo/rbdloop-drpc.yaml @@ -0,0 +1,17 @@ +apiVersion: ramendr.openshift.io/v1alpha1 +kind: DRPlacementControl +metadata: + labels: + appname: rbdloop + name: rbdloop-drpc + namespace: rbdloop-dashboard +spec: + drPolicyRef: + name: odr-policy-5m + placementRef: + kind: PlacementRule + name: rbdloop-placement + preferredCluster: cluster1 + pvcSelector: + matchLabels: + appname: rbdloop diff --git a/ramendemo/rbdloop-placementrule.yaml b/ramendemo/rbdloop-placementrule.yaml new file mode 100644 index 0000000..e484087 --- /dev/null +++ b/ramendemo/rbdloop-placementrule.yaml @@ -0,0 +1,13 @@ +apiVersion: apps.open-cluster-management.io/v1 +kind: PlacementRule +metadata: + labels: + appname: rbdloop + name: rbdloop-placement + namespace: rbdloop-dashboard +spec: + clusterConditions: + - status: "True" + type: ManagedClusterConditionAvailable + clusterReplicas: 1 + schedulerName: ramen diff --git a/ramendemo/rbdloop.yaml b/ramendemo/rbdloop.yaml new file mode 100644 index 0000000..6c7150d --- /dev/null +++ b/ramendemo/rbdloop.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ramendemo + labels: + appname: rbdloop +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: ocs-storagecluster-ceph-rbdmirror +--- +apiVersion: v1 +kind: Pod +metadata: + name: batch-4k + labels: + appname: rbdloop +spec: + containers: + - name: batch-4k + image: quay.io/vcppds7878/busybox:rbdloop + imagePullPolicy: IfNotPresent +# command: ["sh"] +# args: +# - '-c' +# - 'sleep 3600' + command: ["python3"] + args: + - '/tmp/runloop.py' + - '--size' + - '--server' + - '--port' + env: + - name: BLOCKSIZE + value: "4096" + - name: SQL_SERVER + value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" + - name: SQL_PORT + value: "30136" + volumeMounts: + - name: tmp-store + mountPath: /mnt/test + volumes: + - name: tmp-store + persistentVolumeClaim: + claimName: ramendemo + readOnly: false + restartPolicy: Never From f2eb6a1368cf1c7455c0b78e8fbe75689f63b1be Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Fri, 17 Dec 2021 02:35:16 +0000 Subject: [PATCH 35/42] modify kustomization.yaml --- ramendemo/kustomization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemo/kustomization.yaml b/ramendemo/kustomization.yaml index 93a8a6b..e014edc 100644 --- a/ramendemo/kustomization.yaml +++ b/ramendemo/kustomization.yaml @@ -1,3 +1,3 @@ resources: -- app/rbdloop.yaml +- rbdloop.yaml From e279df46a5fae177ad128b7afae942fa4d7dc32c Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Fri, 17 Dec 2021 16:04:12 +0000 Subject: [PATCH 36/42] rbdloop image pull Always --- ramendemo/rbdloop.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ramendemo/rbdloop.yaml b/ramendemo/rbdloop.yaml index 6c7150d..a505e7f 100644 --- a/ramendemo/rbdloop.yaml +++ b/ramendemo/rbdloop.yaml @@ -23,7 +23,7 @@ spec: containers: - name: batch-4k image: quay.io/vcppds7878/busybox:rbdloop - imagePullPolicy: IfNotPresent + imagePullPolicy: Always # command: ["sh"] # args: # - '-c' From d741495a3564e9a9697ea0bbc86684fc3b80ae5f Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Sat, 18 Dec 2021 01:03:04 +0000 Subject: [PATCH 37/42] change to IP:port --- ramendemo/rbdloop.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ramendemo/rbdloop.yaml b/ramendemo/rbdloop.yaml index a505e7f..f383b46 100644 --- a/ramendemo/rbdloop.yaml +++ b/ramendemo/rbdloop.yaml @@ -38,9 +38,9 @@ spec: - name: BLOCKSIZE value: "4096" - name: SQL_SERVER - value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" + value: "10.109.2.34" - name: SQL_PORT - value: "30136" + value: "3306" volumeMounts: - name: tmp-store mountPath: /mnt/test From 9cc55c40df63d5f2d04485b3be094c9441386a86 Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Sat, 18 Dec 2021 01:07:27 +0000 Subject: [PATCH 38/42] change to back hostname --- ramendemo/rbdloop.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ramendemo/rbdloop.yaml b/ramendemo/rbdloop.yaml index f383b46..a505e7f 100644 --- a/ramendemo/rbdloop.yaml +++ b/ramendemo/rbdloop.yaml @@ -38,9 +38,9 @@ spec: - name: BLOCKSIZE value: "4096" - name: SQL_SERVER - value: "10.109.2.34" + value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" - name: SQL_PORT - value: "3306" + value: "30136" volumeMounts: - name: tmp-store mountPath: /mnt/test From d8d0a9db6a0f22df77847a8443e36b642f3e5009 Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Sat, 18 Dec 2021 01:52:10 +0000 Subject: [PATCH 39/42] new README and delete app diretory --- ramendemo/README.md | 119 ++++++++++++++--------- ramendemo/app/kustomization.yaml | 3 - ramendemo/app/rbdloop-drpc.yaml | 17 ---- ramendemo/app/rbdloop-placementrule.yaml | 13 --- ramendemo/app/rbdloop.yaml | 52 ---------- ramendemo/rbdloop-new.yaml | 53 ---------- 6 files changed, 73 insertions(+), 184 deletions(-) delete mode 100644 ramendemo/app/kustomization.yaml delete mode 100644 ramendemo/app/rbdloop-drpc.yaml delete mode 100644 ramendemo/app/rbdloop-placementrule.yaml delete mode 100644 ramendemo/app/rbdloop.yaml delete mode 100644 ramendemo/rbdloop-new.yaml diff --git a/ramendemo/README.md b/ramendemo/README.md index 848f729..46df3a3 100644 --- a/ramendemo/README.md +++ b/ramendemo/README.md @@ -1,7 +1,7 @@ # RBD demo application with dashboard ## Prepare your demo -Fork my repo at `https://github.com/jeanchlopez/application-samples` +Fork my repo at `https://github.com/jeanchlopez/application-samples`. ``` git clone https://github.com/{username}/application-samples @@ -10,18 +10,22 @@ git checkout ramendemo git fetch git pull ``` +Create a new project on OpenShift cluster with ACM installed: + +``` +oc new-project ramendemo-mysql +``` ## Deploying MySQL Server -In ACM create new application +In ACM create new application: - Name = `ramendemo-mysql` - Namespace = `ramendemo-mysql` - Git = `https://github.com/{username}/application-samples` - Branch = `ramendemo` - Path = `ramendemo/mysql` - -Deploy to local cluster +- `Deploy on local cluster` ## Deploying Grafana dashboard @@ -29,20 +33,36 @@ Due to an issue with the Grafana operator (`https://github.com/grafana-operator/ the dashboard can not be configured via ACM. You will have to deploy the Grafana dashboard in the same namespace as the one where the MySQl server was deployed. - ``` -cd grafana +cd ramendemo/grafana oc project ramendemo-mysql -Deploy the Grafana operator -oc create -f ./operator.yaml ``` -Wait for the operator to be deployed with an oc get csv -n mysql command +Deploy the Grafana operator: -Once the operator is deployed, customize the operator +``` +oc create -f operator.yaml +``` + +Wait for the operator to be deployed and show a `Succeeded` Phase. ``` -oc create -k . +oc get csv -n ramendemo-mysql +``` + +Example output: + +``` +NAME DISPLAY VERSION REPLACES PHASE +grafana-operator.v4.1.1 Grafana Operator 4.1.1 grafana-operator.v4.1.0 Succeeded +``` + +Once the Grafana operator is deployed, create Grafana resources. Order of yaml files is datasource, next dashboard, then grafana instance. + +``` +oc create -f grafana-mysql-datasource-for-ramendemo.yaml -n ramendemo-mysql +oc create -f grafana-mysql-dashboard-for-ramendemo.yaml -n ramendemo-mysql +oc create -f grafana-instance.yaml -n ramendemo-mysql ``` Wait for the Grafana pod to restart. If you need to connect with admin privilege use the following credentials. @@ -50,67 +70,74 @@ Wait for the Grafana pod to restart. If you need to connect with admin privilege - User name = `admin` - Password = `ramendemo` -Do an `oc get route -n ramendemo-mysql` to check where to reach the Grafana UI +Do this to find the URL to reach the Grafana UI: + +``` +oc get route grafana-route in ramendemo-mysql | grep grafana-route +``` + +Copy the resulting route into a browser tab to validate you have access to Grafana. + +NOTE: Make sure you sure to use `https` for the Grafana route. ## Configure MySQl address for test application -Update the `rbdloop.yaml` with parameters matching your environment +Update the `rbdloop.yaml` with parameters matching your environment. + +To do this find the route for your mysql instance: + +``` +oc get route ramendemo-mysql -n ramendemo-mysql +``` +Use the resulting route to modify `rbdloop.yaml`as shown below (example SQL_SERVER value). + +NOTE: Make sure you are in the `ramendemo` directory. ``` -cd ../app cat rbdloop.yaml […] - name: SQL_SERVER - value: "ramendemo-mysql-mysql.apps.makestoragegreatagain.com" + value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" - name: SQL_PORT value: "30136" -# - name: SQL_URL -# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” […] ``` +Now `rbdloop.yaml` needs to be committed to your forked repo. -### Option 1 - -Your environment always uses the same base domain and you use the default `./mysql/mysql.kustomization.yaml` from this repo. - -Change the value for the `SQL_SERVER` environment variable value that matches your name space and your base domain. - -e.g. You have deployed with ACM the MySQL server - -- Namespace = mysqljc -- Base domain = ocstraining.com - -You would set the `SQL_SERVER` value to `ramendemo-mysql-mysqljc.apps.ocstraining.com`. - -### Option 2 +``` +git add rbdloop.yaml +git commit -m "Modified rbdloop.yaml" +git push origin ramendemo +``` -You have a `gist` available with the MySQL Server address. The URL must point to a raw gist. +## Deploy the application -Verify the path to your raw gist like this +Create a new project on OpenShift cluster with ACM installed. ``` -curl https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url -ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja:30136 +oc new-project rbdloop-dashboard ``` +NOTE: Make sure you are in the `ramendemo` directory. -Remove the comment in front of the `SQL_URL` environment variable. +You now need to create a DRPlacementControl (DRPC)and PlacementRule for the `rbdloop` application. -e.g. +NOTE: Make sure to modify the DRPC YAML file and modify `cluster1` to be accurate for your environment. Modify to use the cluster name in ACM for your preferredCluster. ``` - - name: SQL_URL - value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/c5d79fbe37fb6e243908a88bee4e66f7d692003e/sqlserver.url” +oc create -f rbdloop-drpc.yaml -n rbdloop-dashboard ``` -Update your `gist` with the correct MySQL server address (Remember that this repo configures port 30136 by default for the MySQL DB so just change the FQDN +Now create the PlacementRule: -## Deploy the app +``` +oc create -f rbdloop-placementrule.yaml -n rbdloop-dashboard +``` -In ACM create new application +In ACM create the new `rbdloop` application. -- Name = `{Your Choice}` -- Namespace = `{Your Choice}` +- Name = `rbdloop` +- Namespace = `rbdloop-dashboard` - Git = `https://github.com/{username}/application-samples` - Branch = `ramendemo` -- Path = `ramendemo/app` - +- Path = `ramendemo` +- Select an existing placement configuration = `rbdloop-placement` diff --git a/ramendemo/app/kustomization.yaml b/ramendemo/app/kustomization.yaml deleted file mode 100644 index 93a8a6b..0000000 --- a/ramendemo/app/kustomization.yaml +++ /dev/null @@ -1,3 +0,0 @@ -resources: -- app/rbdloop.yaml - diff --git a/ramendemo/app/rbdloop-drpc.yaml b/ramendemo/app/rbdloop-drpc.yaml deleted file mode 100644 index 4d86808..0000000 --- a/ramendemo/app/rbdloop-drpc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: ramendr.openshift.io/v1alpha1 -kind: DRPlacementControl -metadata: - labels: - appname: rbdloop - name: rbdloop-drpc - namespace: rbdloop-dashboard -spec: - drPolicyRef: - name: odr-policy-5m - placementRef: - kind: PlacementRule - name: rbdloop-placement - preferredCluster: cluster1 - pvcSelector: - matchLabels: - appname: rbdloop diff --git a/ramendemo/app/rbdloop-placementrule.yaml b/ramendemo/app/rbdloop-placementrule.yaml deleted file mode 100644 index e484087..0000000 --- a/ramendemo/app/rbdloop-placementrule.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: apps.open-cluster-management.io/v1 -kind: PlacementRule -metadata: - labels: - appname: rbdloop - name: rbdloop-placement - namespace: rbdloop-dashboard -spec: - clusterConditions: - - status: "True" - type: ManagedClusterConditionAvailable - clusterReplicas: 1 - schedulerName: ramen diff --git a/ramendemo/app/rbdloop.yaml b/ramendemo/app/rbdloop.yaml deleted file mode 100644 index 6c7150d..0000000 --- a/ramendemo/app/rbdloop.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: ramendemo - labels: - appname: rbdloop -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi - storageClassName: ocs-storagecluster-ceph-rbdmirror ---- -apiVersion: v1 -kind: Pod -metadata: - name: batch-4k - labels: - appname: rbdloop -spec: - containers: - - name: batch-4k - image: quay.io/vcppds7878/busybox:rbdloop - imagePullPolicy: IfNotPresent -# command: ["sh"] -# args: -# - '-c' -# - 'sleep 3600' - command: ["python3"] - args: - - '/tmp/runloop.py' - - '--size' - - '--server' - - '--port' - env: - - name: BLOCKSIZE - value: "4096" - - name: SQL_SERVER - value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" - - name: SQL_PORT - value: "30136" - volumeMounts: - - name: tmp-store - mountPath: /mnt/test - volumes: - - name: tmp-store - persistentVolumeClaim: - claimName: ramendemo - readOnly: false - restartPolicy: Never diff --git a/ramendemo/rbdloop-new.yaml b/ramendemo/rbdloop-new.yaml deleted file mode 100644 index a7c9087..0000000 --- a/ramendemo/rbdloop-new.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: ramendemo -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi - storageClassName: ocs-storagecluster-ceph-rbd - #storageClassName: thin ---- -apiVersion: v1 -kind: Pod -metadata: - name: batch-4k - labels: - app: batch-4k -spec: - containers: - - name: batch-4k - image: quay.io/vcppds7878/busybox:rbdloop - imagePullPolicy: Always - command: ["sh"] - args: - - '-c' - - 'sleep 3600' -# command: ["python3"] -# args: -# - '/tmp/runloop.py' -# - '--size' -# - '--server' -# - '--port' - env: - - name: BLOCKSIZE - value: "4096" - - name: SQL_SERVER - value: "ramendemo-mysql-mysql.apps.perf3.chris.ocs.ninja" - - name: SQL_PORT - value: "30136" -# - name: SQL_URL -# value: "https://gist.githubusercontent.com/jeanchlopez/0cdd2a30562b735c3bb384bd734282b7/raw/62b3b52e20bd7b640d8f14cab7893ed3a294a3e0/sqlserver.url" - volumeMounts: - - name: tmp-store - mountPath: /mnt/test - volumes: - - name: tmp-store - persistentVolumeClaim: - claimName: ramendemo - readOnly: false - restartPolicy: Never From 7e2564c253bbdee4d87cc43efc28871098c2e800 Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Sat, 18 Dec 2021 02:14:01 +0000 Subject: [PATCH 40/42] More README changes --- ramendemo/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ramendemo/README.md b/ramendemo/README.md index 46df3a3..5b16f8b 100644 --- a/ramendemo/README.md +++ b/ramendemo/README.md @@ -73,7 +73,7 @@ Wait for the Grafana pod to restart. If you need to connect with admin privilege Do this to find the URL to reach the Grafana UI: ``` -oc get route grafana-route in ramendemo-mysql | grep grafana-route +oc get route grafana-route in ramendemo-mysql ``` Copy the resulting route into a browser tab to validate you have access to Grafana. @@ -141,3 +141,5 @@ In ACM create the new `rbdloop` application. - Branch = `ramendemo` - Path = `ramendemo` - Select an existing placement configuration = `rbdloop-placement` + +Go back to Grafana and navigate to the `Ramen Demo Application Dashboard` to monitor cluster Failover and Relocate operations. From 6fe0e13c5a2aee78bb23c64fbdb00a3a1cbe885d Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Tue, 21 Dec 2021 01:02:15 +0000 Subject: [PATCH 41/42] Changes for AWS infra in files and README --- ramendemo/README.md | 33 +++++++++++++++- ramendemo/mysql/mysql-aws.yaml | 69 ++++++++++++++++++++++++++++++++++ ramendemo/rbdloop.yaml | 4 +- 3 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 ramendemo/mysql/mysql-aws.yaml diff --git a/ramendemo/README.md b/ramendemo/README.md index 5b16f8b..2ebc55f 100644 --- a/ramendemo/README.md +++ b/ramendemo/README.md @@ -18,7 +18,7 @@ oc new-project ramendemo-mysql ## Deploying MySQL Server -In ACM create new application: +In ACM create new application (**non-AWS**): - Name = `ramendemo-mysql` - Namespace = `ramendemo-mysql` @@ -27,6 +27,14 @@ In ACM create new application: - Path = `ramendemo/mysql` - `Deploy on local cluster` +If deploying on **AWS** use this method and YAML file to deploy MySQL. + +``` +cd ramendemo/mysql +oc project ramendemo-mysql +oc create -f mysql-aws.yaml +``` + ## Deploying Grafana dashboard Due to an issue with the Grafana operator (`https://github.com/grafana-operator/grafana-operator/issues/655`) @@ -80,11 +88,13 @@ Copy the resulting route into a browser tab to validate you have access to Grafa NOTE: Make sure you sure to use `https` for the Grafana route. +NOTE: Login to Grafana and check you have a datasource. If there is a no datasource, you need to `oc apply -f grafana-mysql-datasource-for-ramendemo.yaml` and then check again to see of there is a datasource. + ## Configure MySQl address for test application Update the `rbdloop.yaml` with parameters matching your environment. -To do this find the route for your mysql instance: +To do this find the route for your mysql instance (**non-AWS**): ``` oc get route ramendemo-mysql -n ramendemo-mysql @@ -102,6 +112,25 @@ cat rbdloop.yaml value: "30136" […] ``` + +If on using **AWS** do this: + +``` +oc get svc ramendemo-mysql -n ramendemo-mysql +``` + +Use the resulting `LoadBalancer` service `EXTERNAL-IP` to modify `rbdloop.yaml`as shown below (example SQL_SERVER value). + +``` +cat rbdloop.yaml +[…] + - name: SQL_SERVER + value: "a0daa32ed84804c9c88924a734218abc-1519604064.us-east-2.elb.amazonaws.com" + - name: SQL_PORT + value: "3306" +[…] +``` + Now `rbdloop.yaml` needs to be committed to your forked repo. ``` diff --git a/ramendemo/mysql/mysql-aws.yaml b/ramendemo/mysql/mysql-aws.yaml new file mode 100644 index 0000000..b745b52 --- /dev/null +++ b/ramendemo/mysql/mysql-aws.yaml @@ -0,0 +1,69 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: ramendemo-mysql + labels: + app: ramendemo +spec: + type: LoadBalancer + ports: + - port: 3306 + selector: + app: ramendemo + tier: mysql +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ramendemo-mysql-pv-claim + labels: + app: ramendemo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ramendemo-mysql + labels: + app: ramendemo +spec: + selector: + matchLabels: + app: ramendemo + tier: mysql + strategy: + type: Recreate + template: + metadata: + labels: + app: ramendemo + tier: mysql + spec: + containers: + - image: mysql:5.6 + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + value: "redhat" + - name: MYSQL_DATABASE + value: "ramendemo" + - name: MYSQL_USER + value: "ramendemo" + - name: MYSQL_PASSWORD + value: "ramendemo" + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: mysql-persistent-storage + mountPath: /var/lib/mysql + volumes: + - name: mysql-persistent-storage + persistentVolumeClaim: + claimName: ramendemo-mysql-pv-claim diff --git a/ramendemo/rbdloop.yaml b/ramendemo/rbdloop.yaml index a505e7f..f2b8fbe 100644 --- a/ramendemo/rbdloop.yaml +++ b/ramendemo/rbdloop.yaml @@ -38,9 +38,9 @@ spec: - name: BLOCKSIZE value: "4096" - name: SQL_SERVER - value: "ramendemo-mysql-ramendemo-mysql.apps.hub.makestoragegreatagain.com" + value: "a1f3f174920324755951447a31448e16-795488745.us-east-2.elb.amazonaws.com" - name: SQL_PORT - value: "30136" + value: "3306" volumeMounts: - name: tmp-store mountPath: /mnt/test From 7c46c891d3e1bb74d2a2af0f70633d0a052c6eba Mon Sep 17 00:00:00 2001 From: Annette Clewett Date: Tue, 21 Dec 2021 01:05:51 +0000 Subject: [PATCH 42/42] minor change to mysql.yaml --- ramendemo/mysql/mysql.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ramendemo/mysql/mysql.yaml b/ramendemo/mysql/mysql.yaml index fe95ae3..3920755 100644 --- a/ramendemo/mysql/mysql.yaml +++ b/ramendemo/mysql/mysql.yaml @@ -23,10 +23,9 @@ metadata: spec: accessModes: - ReadWriteOnce - #storageClassName: ocs-storagecluster-ceph-rbd resources: requests: - storage: 1Gi + storage: 5Gi --- apiVersion: apps/v1 kind: Deployment