You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using GitOps with Grafana Operator to create Grafana Dashboard with Flux. (#164)
* Grafana With GitOps Feature
* Grafana With GitOps Feature
* Grafana With GitOps Feature
* Fix setup logs retention policy (#169)
* Fixing GitOps Repo
* Commenting out the NodeExp Dash
* Commenting out the NodeExp Dash
* Adding all Grafana Dashboards
* Adding all Grafana Dashboards
* Fixing Grafana Operator Version and cleaning full boards
* Fixing Grafana Operator Version and cleaning full boards
* Fixing Grafana Operator Version and cleaning full boards
* Fixing Grafana Operator Version and cleaning full boards
* Fixing Grafana Operator Version and cleaning full boards and PR Issues
* Fixing Grafana Operator Version and cleaning full boards and PR Issues
* Fixing Grafana Operator Version and cleaning full boards and PR Issues
* Fixing Grafana Operator Version and cleaning full boards and PR Issues
* Fixing Grafana Operator Version and cleaning full boards and PR Issues
* Fixing Grafana Operator Version and cleaning full boards and PR Issues
---------
Co-authored-by: Rodrigue Koffi <[email protected]>
|[aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity)| data source |
63
59
|[aws_eks_cluster.eks_cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster)| data source |
64
60
|[aws_partition.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/partition)| data source |
@@ -87,8 +83,19 @@ This module makes use of the open source [kube-prometheus-stack](https://github.
87
83
| <aname="input_enable_recording_rules"></a> [enable\_recording\_rules](#input\_enable\_recording\_rules)| Enables or disables Managed Prometheus recording rules |`bool`|`true`| no |
88
84
| <aname="input_enable_tracing"></a> [enable\_tracing](#input\_enable\_tracing)| (Experimental) Enables tracing with AWS X-Ray. This changes the deploy mode of the collector to daemon set. Requirement: adot add-on <= 0.58-build.0 |`bool`|`false`| no |
| <aname="input_grafana_workloads_dashboard_url"></a> [grafana\_workloads\_dashboard\_url](#input\_grafana\_workloads\_dashboard\_url)| Dashboard URL for Workloads Grafana Dashboard JSON |`string`|`"https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/1d731aca31cdeb26e9fe9d017e609a5ba1621a30/artifacts/grafana-dashboards/workloads.json"`| no |
92
99
| <aname="input_helm_config"></a> [helm\_config](#input\_helm\_config)| Helm Config for Prometheus |`any`|`{}`| no |
93
100
| <aname="input_irsa_iam_permissions_boundary"></a> [irsa\_iam\_permissions\_boundary](#input\_irsa\_iam\_permissions\_boundary)| IAM permissions boundary for IRSA roles |`string`|`null`| no |
94
101
| <aname="input_irsa_iam_role_path"></a> [irsa\_iam\_role\_path](#input\_irsa\_iam\_role\_path)| IAM role path for IRSA roles |`string`|`"/"`| no |
@@ -117,7 +124,7 @@ This module makes use of the open source [kube-prometheus-stack](https://github.
117
124
118
125
## Troubleshooting
119
126
120
-
When you upgrade the eks-monitoring module from v2.1.0 or earlier, the following error may occur.
127
+
1.When you upgrade the eks-monitoring module from v2.1.0 or earlier, the following error may occur.
121
128
122
129
```bash
123
130
Error: cannot patch "prometheus-node-exporter" with kind DaemonSet: DaemonSet.apps "prometheus-node-exporter" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"prometheus-node-exporter", "app.kubernetes.io/name":"prometheus-node-exporter"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
@@ -129,3 +136,68 @@ This is due to the upgrade of the node-exporter chart from v2 to v4. Manually de
2. In case you dont see the grafana dashboards in your Amazon Managed Grafana console, check on the logs on your grafana operator pod using the below command :
If you observe, the the above `grafana-api-key error` in the logs, your grafana API key is expired. Please use the operational procedure to update your `grafana-api-key` :
- Next, lets grab the Grafana API key secret name from AWS Secrets Manager. The keyname should start with `terraform-..`
179
+
180
+
```bash
181
+
aws secretsmanager list-secrets
182
+
```
183
+
184
+
- Finally, update the Grafana API key secret in AWS Secrets Manager using the above new Grafana API key:
185
+
186
+
```bash
187
+
aws secretsmanager update-secret \
188
+
--secret-id <Your Secret Name> \
189
+
--secret-string "${GO_AMG_API_KEY}" \
190
+
--region <Your AWS Region>
191
+
```
192
+
193
+
## Grafana datasources and dashboards via GitOps on Amazon Managed Grafana
194
+
195
+
We have upgraded out solution to use [grafana-operator](https://github.com/grafana-operator/grafana-operator#:~:text=The%20grafana%2Doperator%20is%20a,an%20easy%20and%20scalable%20way.) and [Flux](https://fluxcd.io/) to create Grafana datasources, folder and dashboards via GitOps on Amazon Managed Grafana.
196
+
197
+
The grafana-operator is a Kubernetes operator built to help you manage your Grafana instances inside and outside Kubernetes. Grafana Operator makes it possible for you to manage and create Grafana dashboards, datasources etc. declaratively between multiple instances in an easy and scalable way. Using grafana-operator it will be possible to add AWS data sources such as Amazon Managed Service for Prometheus, Amazon CloudWatch, AWS X-Ray to Amazon Managed Grafana and create Grafana dashboards on Amazon Managed Grafana from your Amazon EKS cluster. This enables us to use our Kubernetes cluster to create and manage the lifecycle of resources in Amazon Managed Grafana in a Kubernetes native way. This ultimately enables us to use GitOps mechanisms using CNCF projects such as Flux to create and manage the lifecycle of resources in Amazon Managed Grafana.
198
+
199
+
GitOps is a way of managing application and infrastructure deployment so that the whole system is described declaratively in a Git repository. It is an operational model that offers you the ability to manage the state of multiple Kubernetes clusters leveraging the best practices of version control, immutable artifacts, and automation. Flux is a declarative, GitOps-based continuous delivery tool that can be integrated into any CI/CD pipeline. It gives users the flexibility of choosing their Git provider (GitHub, GitLab, BitBucket). Now, with grafana-operator supporting the management of external Grafana instances such as Amazon Managed Grafana, operations personas can use GitOps mechanisms using CNCF projects such as Flux to create and manage the lifecycle of resources in Amazon Managed Grafana.
200
+
201
+
We have setup a [GitRepository](https://fluxcd.io/flux/components/source/gitrepositories/) and [Kustomization](https://fluxcd.io/flux/components/kustomize/kustomization/) using flux to sync our GitHub Repository to add Grafana Datasources, folder and Dashboards to Amazon Managed Grafana using Grafana Operator. GitRepository defines a Source to produce an Artifact for a Git repository revision. Kustomization defines a pipeline for fetching, decrypting, building, validating and applying Kustomize overlays or plain Kubernetes manifests. we are also using [Flux Post build variable substitution](https://fluxcd.io/flux/components/kustomize/kustomization/#post-build-variable-substitution) to dynamically render variables such as AMG_AWS_REGION, AMP_ENDPOINT_URL, AMG_ENDPOINT_URL,GRAFANA_NODEEXP_DASH_URL on the YAML manifests during deployment time to avoid hardcoding on the YAML manifests stored in Git repo.
202
+
203
+
We have placed our declarative code snippet to create an Amazon Managed Service For Promethes datasource and Grafana Dashboard in Amazon Managed Grafana in our [AWS Observabiity Accelerator GitHub Repository](https://github.com/aws-observability/aws-observability-accelerator/tree/main/artifacts/grafana-operator-manifests). We have setup a GitRepository to point to the AWS Observabiity Accelerator GitHub Repository and `Kustomization` for flux to sync Git Repository with artifacts in `./artifacts/grafana-operator-manifests` path in the AWS Observabiity Accelerator GitHub Repository. You can use this extension of our solution to point your own Kubernetes manifests to create Grafana Datasources and personified Grafana Dashboards of your choice using GitOps with Grafana Operator and Flux in Kubernetes native way with altering and redeploying this solution for changes to Grafana resources.
0 commit comments