From b42fcbf1e436c73985d96fc942f6ccf518ff9aa3 Mon Sep 17 00:00:00 2001
From: Mike Hepburn <eformat@gmail.com>
Date: Sun, 19 Apr 2020 10:40:43 +1000
Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=A5=95=20add=20metrics=20=F0=9F=A5=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bootstrap/templates/argocd-install.yaml | 15 +++++++++++++++
 bootstrap/values-bootstrap.yaml         |  4 ++++
 2 files changed, 19 insertions(+)

diff --git a/bootstrap/templates/argocd-install.yaml b/bootstrap/templates/argocd-install.yaml
index 7f13808..16a8e03 100644
--- a/bootstrap/templates/argocd-install.yaml
+++ b/bootstrap/templates/argocd-install.yaml
@@ -101,4 +101,19 @@ spec:
   statusBadgeEnabled: true
   usersAnonymousEnabled: false
   version: {{ .Values.argocd.version | quote }}
+---
+{{- if .Values.argocd.metrics.enabled }}
+apiVersion: operators.coreos.com/v1alpha1
+kind: Subscription
+metadata:
+  name: prometheus-operator
+spec:
+  channel: beta
+  installPlanApproval: Automatic
+  name: prometheus
+  source: community-operators
+  sourceNamespace: openshift-marketplace
+  startingCSV: {{- .Values.argocd.metrics.prometheus.version | quote }}
 {{- end }}
+---
+{{- end }}
\ No newline at end of file
diff --git a/bootstrap/values-bootstrap.yaml b/bootstrap/values-bootstrap.yaml
index ac7feda..4e1e834 100644
--- a/bootstrap/values-bootstrap.yaml
+++ b/bootstrap/values-bootstrap.yaml
@@ -58,3 +58,7 @@ argocd:
   namespace: *ci_cd
   version: v1.5.2
   instancelabel: redhat.com/ubiquitous-journey
+  metrics:
+    enabled: true
+    prometheus:
+      version: prometheusoperator.0.32.0

From b04655eefa542deedc5ac987b8b2e66422ee79a5 Mon Sep 17 00:00:00 2001
From: Mike Hepburn <eformat@gmail.com>
Date: Sun, 19 Apr 2020 10:44:46 +1000
Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A5=95=20add=20metrics=20=F0=9F=A5=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bootstrap/templates/argocd-install.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bootstrap/templates/argocd-install.yaml b/bootstrap/templates/argocd-install.yaml
index 16a8e03..10732df 100644
--- a/bootstrap/templates/argocd-install.yaml
+++ b/bootstrap/templates/argocd-install.yaml
@@ -113,7 +113,7 @@ spec:
   name: prometheus
   source: community-operators
   sourceNamespace: openshift-marketplace
-  startingCSV: {{- .Values.argocd.metrics.prometheus.version | quote }}
+  startingCSV: {{ .Values.argocd.metrics.prometheus.version | quote }}
 {{- end }}
 ---
 {{- end }}
\ No newline at end of file

From 87e51dec02f45eaf3a11b54a1cec68fe99bcf550 Mon Sep 17 00:00:00 2001
From: Mike Hepburn <eformat@gmail.com>
Date: Sun, 19 Apr 2020 12:17:40 +1000
Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=A5=95=20add=20metrics=20=F0=9F=A5=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bootstrap/templates/argocd-install.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bootstrap/templates/argocd-install.yaml b/bootstrap/templates/argocd-install.yaml
index 10732df..e371990 100644
--- a/bootstrap/templates/argocd-install.yaml
+++ b/bootstrap/templates/argocd-install.yaml
@@ -77,11 +77,19 @@ spec:
   ha:
     enabled: false
   grafana:
+{{- if .Values.argocd.metrics.enabled }}  
+    enabled: true
+{{- else }}
     enabled: false
+{{- end }}
     route: true
     size: 1
   prometheus:
+{{- if .Values.argocd.metrics.enabled }}  
+    enabled: true
+{{- else }}
     enabled: false
+{{- end }}
     route: true
     size: 1
   rbac:

From 5158f8f8ce3788d38b22c88f09cffad5fbeccacb Mon Sep 17 00:00:00 2001
From: Mike Hepburn <eformat@gmail.com>
Date: Sun, 19 Apr 2020 18:40:29 +1000
Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=A5=95=20add=20metrics=20=F0=9F=A5=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/README.md b/README.md
index c87b7c8..e150eb0 100644
--- a/README.md
+++ b/README.md
@@ -144,4 +144,11 @@ TODO - add some instructions for adding:
 1) new helm charts
 2) new Operators etc
 
+## Metrics
+
+By setting `argocd.metrics.enabled: true` in `values-bootstrap.yaml`, promethus and grafana are deployed by the operator to capture argocd metrics.
+
+An example of the latest grafana dashboard for argocd is available here
+- https://raw.githubusercontent.com/argoproj/argo-cd/master/examples/dashboard.json
+
 ## Contributing

From a97e988fb1d50e722f8e7dad0aef41c801823922 Mon Sep 17 00:00:00 2001
From: Mike Hepburn <eformat@gmail.com>
Date: Sun, 19 Apr 2020 18:44:23 +1000
Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=A5=95=20operator=20version=20moved?=
 =?UTF-8?q?=20to=20values=20=F0=9F=A5=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bootstrap/templates/argocd-install.yaml | 2 +-
 bootstrap/values-bootstrap.yaml         | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/bootstrap/templates/argocd-install.yaml b/bootstrap/templates/argocd-install.yaml
index e371990..5ac4439 100644
--- a/bootstrap/templates/argocd-install.yaml
+++ b/bootstrap/templates/argocd-install.yaml
@@ -58,7 +58,7 @@ spec:
   name: argocd-operator
   source: community-operators
   sourceNamespace: openshift-marketplace
-  startingCSV: argocd-operator.v0.0.6
+  startingCSV: {{ .Values.argocd.operator.version | quote }}
 ---
 apiVersion: argoproj.io/v1alpha1
 kind: ArgoCD
diff --git a/bootstrap/values-bootstrap.yaml b/bootstrap/values-bootstrap.yaml
index 4e1e834..1545740 100644
--- a/bootstrap/values-bootstrap.yaml
+++ b/bootstrap/values-bootstrap.yaml
@@ -54,7 +54,7 @@ bootstrap-project:
 
 argocd:
   enabled: true
-  name: argocd
+  name: labs-argocd
   namespace: *ci_cd
   version: v1.5.2
   instancelabel: redhat.com/ubiquitous-journey
@@ -62,3 +62,5 @@ argocd:
     enabled: true
     prometheus:
       version: prometheusoperator.0.32.0
+  operator:
+    version: argocd-operator.v0.0.6

From 36b9ea578801231378bdc6d4ba18dc1f4b9d29b8 Mon Sep 17 00:00:00 2001
From: Mike Hepburn <eformat@gmail.com>
Date: Sun, 19 Apr 2020 18:45:55 +1000
Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A5=95=20newline=20=F0=9F=A5=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 bootstrap/templates/argocd-install.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bootstrap/templates/argocd-install.yaml b/bootstrap/templates/argocd-install.yaml
index 5ac4439..e74e67b 100644
--- a/bootstrap/templates/argocd-install.yaml
+++ b/bootstrap/templates/argocd-install.yaml
@@ -124,4 +124,4 @@ spec:
   startingCSV: {{ .Values.argocd.metrics.prometheus.version | quote }}
 {{- end }}
 ---
-{{- end }}
\ No newline at end of file
+{{- end }}