Skip to content

Commit 7e99fd5

Browse files
committed
Add Grafana to dev_setup.sh
Add subscription to community Grafana operator and configure ArgoCD to deploy a Grafana instance using the mainfests from redhat-appstudio. A separate GrafanaDashboard instance is created using the in-tree dashboard manifests, which allows Pipeline Service contributors to iterate on the dashboard via GitOps. Instructions on how to do "inner loop" developement are included in a README.
1 parent b0eab12 commit 7e99fd5

File tree

5 files changed

+136
-3
lines changed

5 files changed

+136
-3
lines changed
Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Pipeline Service Observability
22

3-
This deploys observability (o11y) components used to configure Prometheus.
4-
It utilizes the o11y stack from redhat-appstudio, with modifications to only deploy
5-
what is needed by the Pipeline Service for inner-loop development.
3+
This deploys observability (o11y) components used to configure Prometheus and
4+
Grafana. It utilizes the o11y stack from redhat-appstudio, with modifications
5+
to only deploy what is needed by the Pipeline Service for GitOps-based
6+
development.
7+
8+
## GitOps Inner Loop Development
9+
10+
The `dev_setup.sh` configures Prometheus and Grafana to deploy the Pipeline
11+
Service dashboards. Grafana's UI can be accessed at the
12+
`grafana-access-appstudio-grafana.apps...` route on your cluster.
13+
14+
To iterate on your dashboard (deploying with `--use-current-branch`):
15+
16+
1. Navigate to the Pipeline Service dashboard in Grafana.
17+
2. Add the panels and/or rows for your metrics as desired.
18+
3. Click the "Share" icon to save the dashboard to JSON.
19+
4. Copy the JSON into the pipeline-service-dashboard.json file, located in
20+
`operator/gitops/argocd/grafana/dashboards`.
21+
5. Commit the updated JSON, push to your branch, and verify the dashboard is
22+
updated once ArgoCD syncs your repository.
23+
24+
## Components
25+
26+
### appstudio-prometheus
27+
28+
This configures the Red Hat
29+
[Observability Operator](https://github.com/rhobs/observability-operator) using
30+
the same manifests used by App Studio. The operator consolidates the "cluster
31+
monitoring" and "user workload" monitoring stacks, allowing metrics to combined
32+
in a single data source view.
33+
34+
### appstudio-grafana
35+
36+
This configures the [Grafana Operator](https://github.com/grafana-operator/grafana-operator)
37+
using the same manifests as App Studio. The operator deploys and manages
38+
Grafana instances, and lets dashboards be configured with custom resources and
39+
JSON stored in ConfigMaps. The deployment includes the Pipeline Service
40+
dashboard, which is referenced in-tree.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: openshift-gitops-apply-grafana
6+
rules:
7+
- apiGroups:
8+
- integreatly.org
9+
resources:
10+
- grafanas
11+
- grafanadashboards
12+
- grafanadatasources
13+
verbs:
14+
- get
15+
- list
16+
- create
17+
- update
18+
- patch
19+
- delete
20+
---
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
kind: ClusterRoleBinding
23+
metadata:
24+
name: openshift-gitops-apply-grafana
25+
roleRef:
26+
apiGroup: rbac.authorization.k8s.io
27+
kind: ClusterRole
28+
name: openshift-gitops-apply-grafana
29+
subjects:
30+
- kind: ServiceAccount
31+
name: openshift-gitops-argocd-application-controller
32+
namespace: openshift-gitops
33+
---
34+
apiVersion: rbac.authorization.k8s.io/v1
35+
kind: Role
36+
metadata:
37+
name: openshift-gitops-manage-grafana
38+
namespace: appstudio-grafana
39+
rules:
40+
- apiGroups:
41+
- ""
42+
resources:
43+
- secrets
44+
- configmaps
45+
- serviceaccounts
46+
verbs:
47+
- get
48+
- list
49+
- create
50+
- update
51+
- patch
52+
- delete
53+
- apiGroups:
54+
- route.openshift.io
55+
resources:
56+
- routes
57+
verbs:
58+
- get
59+
- list
60+
- create
61+
- update
62+
- patch
63+
- delete
64+
---
65+
apiVersion: rbac.authorization.k8s.io/v1
66+
kind: RoleBinding
67+
metadata:
68+
name: openshift-gitops-manage-grafana
69+
namespace: appstudio-grafana
70+
roleRef:
71+
apiGroup: rbac.authorization.k8s.io
72+
kind: Role
73+
name: openshift-gitops-manage-grafana
74+
subjects:
75+
- kind: ServiceAccount
76+
name: openshift-gitops-argocd-application-controller
77+
namespace: openshift-gitops
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- allow-argocd-to-manage.yaml
6+
- namespace.yaml
7+
- https://raw.githubusercontent.com/redhat-appstudio/infra-deployments/main/components/monitoring/grafana/base/grafana-operator.yaml
8+
- https://raw.githubusercontent.com/redhat-appstudio/infra-deployments/main/components/monitoring/grafana/base/grafana-app.yaml
9+
- ../../../../../../operator/gitops/argocd/grafana
10+
commonAnnotations:
11+
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
12+
namespace: appstudio-grafana
13+
configurations:
14+
- https://raw.githubusercontent.com/redhat-appstudio/infra-deployments/main/components/monitoring/grafana/base/cm-dashboard.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: appstudio-grafana
6+
spec: {}

developer/openshift/gitops/argocd/pipeline-service-o11y/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
55
- appstudio-prometheus
6+
- appstudio-grafana

0 commit comments

Comments
 (0)