github.com/argoproj-labs/argocd-operator@v0.10.0/docs/usage/insights.md (about) 1 # Insights 2 3 The Argo CD Operator aggregates, visualizes and exposes the metrics exported by Argo CD using Prometheus. 4 5 ## Overview 6 7 Argo CD exports many metrics that can be used to monitor and provide insights into the state and health of the cluster. The operator makes use of the Prometheus Operator to provision a Prometheus instance for string the metrics from both Argo CD and the operator itself. 8 9 ## Cluster 10 11 This section builds on the example minishift cluster from the [OLM Istall Guide][olm_guide]. 12 13 ## Prometheus 14 15 The Prometheus Operator is available through [operatorhub.io](https://operatorhub.io/operator/prometheus) and is also present in the embedded OpenShift Operator Hub. 16 17 Install the Prometheus Operator by creating a Subscription in the same namespace where the Argo CD cluster will reside. An example Subscription can be found below. 18 19 ``` yaml 20 apiVersion: operators.coreos.com/v1alpha1 21 kind: Subscription 22 metadata: 23 name: prometheus-operator 24 spec: 25 channel: beta 26 name: prometheus 27 source: operatorhubio-catalog 28 sourceNamespace: olm 29 ``` 30 31 Verify that an OperatorGroup is present in the namespace before creating the Subscription. 32 33 ``` bash 34 kubectl get operatorgroups -n argocd 35 ``` 36 37 The OperatorGroup created as part of the [OLM Istall Guide][olm_guide] will work. 38 39 ``` bash 40 NAME AGE 41 argocd-operator 2m47s 42 ``` 43 44 With an OperatorGroup present, the Subscription for the Prometheus Operator can be created. 45 46 ``` bash 47 kubectl apply -n argocd -f deploy/prometheus.yaml 48 ``` 49 50 Verify that the Prometheus Operator is running. 51 52 ``` bash 53 kubectl get pods 54 ``` 55 56 The operator should start after several moments. 57 58 ``` bash 59 NAME READY STATUS RESTARTS AGE 60 prometheus-operator-7f6dfb7686-wb9h2 1/1 Running 0 9m4s 61 ``` 62 63 ## Example 64 65 The following example shows how to enable Prometheus to provide operator insights. This example also enables Ingress for accessing the cluster resources. 66 67 ``` yaml 68 apiVersion: argoproj.io/v1alpha1 69 kind: ArgoCD 70 metadata: 71 name: example-argocd 72 labels: 73 example: insights 74 spec: 75 ingress: 76 enabled: true 77 prometheus: 78 enabled: true 79 server: 80 insecure: true 81 ``` 82 83 With the Prometheus Operator running in the namespace, create the Argo CD cluster using the example above and verify that the cluster is running. 84 85 ``` Bash 86 kubectl get pods -n argocd 87 ``` 88 89 Look for the Prometheus Pods. 90 91 ``` bash 92 NAME READY STATUS RESTARTS AGE 93 argocd-operator-5fc46479bd-pp9b2 1/1 Running 0 15h 94 example-argocd-application-controller-6c9c8fc6c-27lvv 1/1 Running 0 15h 95 example-argocd-dex-server-94477bc6f-lzn8m 1/1 Running 0 15h 96 example-argocd-redis-756b6764-4r2q4 1/1 Running 0 15h 97 example-argocd-repo-server-5ddfd76c48-xmwdt 1/1 Running 0 15h 98 example-argocd-server-65dbd7c68b-kbjgr 1/1 Running 0 15h 99 prometheus-example-argocd-0 3/3 Running 1 14m 100 prometheus-operator-7f6dfb7686-wb9h2 1/1 Running 0 14m 101 ``` 102 103 Prometheus can be accessed via Ingress resources. 104 105 ``` bash 106 kubectl get ing -n argocd 107 ``` 108 109 This example shows the default hostnames that are configured for the resources. 110 111 ``` bash 112 NAME CLASS HOSTS ADDRESS PORTS AGE 113 example-argocd <none> example-argocd 192.168.39.68 80, 443 15h 114 example-argocd-grpc <none> example-argocd-grpc 192.168.39.68 80, 443 15h 115 example-argocd-prometheus <none> example-argocd-prometheus 192.168.39.68 80, 443 15h 116 ``` 117 118 For OpenShift clusters, Routes will be created when route is enabled as shown in the below example. 119 120 ``` yaml 121 apiVersion: argoproj.io/v1alpha1 122 kind: ArgoCD 123 metadata: 124 name: example-argocd 125 labels: 126 example: insights 127 spec: 128 route: 129 enabled: true 130 prometheus: 131 enabled: true 132 route: 133 enabled: true 134 server: 135 insecure: true 136 route: 137 enabled: true 138 ``` 139 140 Password can be obtained from the secret by running the below command. 141 ``` 142 oc -n argocd extract secret/example-argocd-cluster --to=- 143 ``` 144 145 Refer to the [Ingress Guide][ingress_guide] for further steps on accessing these resources. 146 147 [olm_guide]:../install/olm.md 148 [ingress_guide]:./ingress.md#access