From 999d1729a7d64c3391f2904feb129ff75867dd99 Mon Sep 17 00:00:00 2001
From: Rob Kooper <kooper@illinois.edu>
Date: Sat, 9 Sep 2023 09:46:16 -0500
Subject: [PATCH] allow to use monitoring in argocd

---
 CHANGELOG.md                                  |  5 ++++
 .../apps/templates/monitoring/monitoring.yaml | 11 +++++++--
 charts/apps/values.yaml                       |  2 +-
 terraform/modules/argocd/variables.tf         |  4 ++--
 terraform/modules/rke1/variables.tf           | 24 +++++++++++--------
 5 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 52f77c3..b063e9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
 
 The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
 
+## 2.3.3 - 2023-09-09
+
+### Changed
+- added rancher monitoring chart, this can now be managed through argocd.
+
 ## 2.3.2 - 2023-08-30
 
 CRITICAL the version 2.2.0 - 2.3.1 could result in all nodes in the cluster being deleted in the case of changes to the userdata.
diff --git a/charts/apps/templates/monitoring/monitoring.yaml b/charts/apps/templates/monitoring/monitoring.yaml
index c6da14f..35537d6 100644
--- a/charts/apps/templates/monitoring/monitoring.yaml
+++ b/charts/apps/templates/monitoring/monitoring.yaml
@@ -26,7 +26,7 @@ spec:
   source:
     repoURL: https://charts.rancher.io
     chart: rancher-monitoring
-    targetRevision: {{ .Values.rancherMonitoring.version | quote }}
+    targetRevision: {{ .Values.monitoring.version | quote }}
     helm:
       version: v3
       releaseName: rancher-monitoring
@@ -37,6 +37,13 @@ spec:
             clusterName: {{ .Values.cluster.name }}
             systemDefaultRegistry: ""
           systemDefaultRegistry: ""
+  ignoreDifferences:
+    - group: ""
+      kind: ConfigMap
+      name: rancher-default-dashboards-k8s
+      namespace: cattle-dashboards
+      jsonPointers:
+        - /data
 ---
 apiVersion: argoproj.io/v1alpha1
 kind: Application
@@ -66,7 +73,7 @@ spec:
   source:
     repoURL: https://charts.rancher.io
     chart: rancher-monitoring-crd
-    targetRevision: {{ .Values.rancherMonitoring.version | quote }}
+    targetRevision: {{ .Values.monitoring.version | quote }}
     helm:
       version: v3
       releaseName: rancher-monitoring-crd
diff --git a/charts/apps/values.yaml b/charts/apps/values.yaml
index 68bc1b6..a327bef 100644
--- a/charts/apps/values.yaml
+++ b/charts/apps/values.yaml
@@ -49,7 +49,7 @@ sealedsecrets:
 
 monitoring:
   enabled: false
-  version: "101.*"
+  version: "102.*"
 
 healthmonitor:
   enabled: false
diff --git a/terraform/modules/argocd/variables.tf b/terraform/modules/argocd/variables.tf
index 335651f..eece7bb 100644
--- a/terraform/modules/argocd/variables.tf
+++ b/terraform/modules/argocd/variables.tf
@@ -102,8 +102,8 @@ variable "argocd_annotations" {
 
 variable "monitoring_enabled" {
   type        = bool
-  description = "Enable monitoring in rancher"
-  default     = true
+  description = "Enable monitoring using prometheus"
+  default     = false
 }
 
 variable "cinder_enabled" {
diff --git a/terraform/modules/rke1/variables.tf b/terraform/modules/rke1/variables.tf
index 913ac78..589c537 100644
--- a/terraform/modules/rke1/variables.tf
+++ b/terraform/modules/rke1/variables.tf
@@ -28,18 +28,21 @@ variable "cluster_machines" {
 # APPLICATIONS
 # ----------------------------------------------------------------------
 
+# DEPRECATED - will move to argocd
 variable "monitoring_enabled" {
   type        = bool
   description = "Enable monitoring in rancher"
   default     = true
 }
 
+# DEPRECATED - will move to argocd
 variable "longhorn_enabled" {
   type        = bool
   description = "Enable longhorn storage"
   default     = true
 }
 
+# DEPRECATED - will move to argocd
 variable "longhorn_replicas" {
   type        = string
   description = "Number of replicas"
@@ -125,14 +128,14 @@ variable "openstack_external_net" {
   default     = "ext-net"
 }
 
-# DEPRECATED, new key will always be created
+# DEPRECATED - new key will always be created
 variable "openstack_ssh_key" {
   type        = string
   description = "existing SSH key to use, leave blank for a new one"
   default     = ""
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "openstack_zone" {
   type        = string
   description = "default zone to use for openstack nodes"
@@ -149,6 +152,7 @@ variable "openstack_security_kubernetes" {
   }
 }
 
+// TODO change this to be ncsa only
 variable "openstack_security_ssh" {
   type        = map(any)
   description = "IP address to allow connections to ssh, default is open to the world"
@@ -170,56 +174,56 @@ variable "openstack_os_image" {
 # OPENSTACK NODES
 # ----------------------------------------------------------------------
 
-# DEPRECATED
+# DEPRECATED - will always start at 1 with cluster.json
 variable "old_hostnames" {
   type        = bool
   description = "should old hostname be used (base 0)"
   default     = false
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "os" {
   type        = string
   description = "Base image to use for the OS"
   default     = "CentOS-7-GenericCloud-Latest"
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "controlplane_count" {
   type        = string
   description = "Desired quantity of control-plane nodes"
   default     = 1
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "controlplane_flavor" {
   type        = string
   description = "Desired flavor of control-plane nodes"
   default     = "m1.medium"
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "controlplane_disksize" {
   type        = string
   description = "Desired disksize of control-plane nodes"
   default     = 40
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "worker_count" {
   type        = string
   description = "Desired quantity of worker nodes"
   default     = 1
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "worker_flavor" {
   type        = string
   description = "Desired flavor of worker nodes"
   default     = "m1.large"
 }
 
-# DEPRECATED
+# DEPRECATED - use cluster.json
 variable "worker_disksize" {
   type        = string
   description = "Desired disksize of worker nodes"
-- 
GitLab