Skip to content

Commit 16ddad5

Browse files
committed
Update README.md
1 parent b4ba2e8 commit 16ddad5

File tree

1 file changed

+73
-29
lines changed
  • Monitoring/monitor_fsxn_with_harvest_on_eks

1 file changed

+73
-29
lines changed

Monitoring/monitor_fsxn_with_harvest_on_eks/README.md

Lines changed: 73 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,62 +18,105 @@ Harvest Helm chart installation will result the following:
1818
* `Helm` - for resources installation.
1919
* An FSx for ONTAP file system deployed in the same VPC as the EKS cluster.
2020
* Existing `Secrets Manager`secret in the same region as the FSxN file system.
21-
* Existing `Prometheus` running on your EKS cluster.
22-
* Existing `Grafana` running on your EKS cluster.
23-
24-
**NOTE:** You can install both Prometheus and Grafana using this [Helm chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack).
2521

2622
### Deployment
27-
### User Input
2823

29-
Parameter | Description |
30-
--- | --- |
31-
fsxs.clusters.name | FSxN cluster name |
32-
fsxs.clusters.managment_lif | FSxN for NetApp ONTAP filesystem management IP |
33-
fsxs.clusters.secretName | AWS Secrets Manager for FSxN credentials |
34-
fsxs.clusters.region | FSxN and AWS Secrets Manager region |
35-
fsxs.clusters.promPort | Which port harvest will be created and exposed to Promethues |
36-
promethues | Existing Promethues name for discovering |
24+
## Deployment of Prometheus and Grafana
25+
If you don't already have Prometheus and Grafana running in your EKS cluster, you can deploy both of them
26+
from the Prometheus community repository by using the following commands:
27+
28+
:memo: **NOTE:** You need to make a substitution in the command below before running it.
29+
```bash
30+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
31+
helm repo update
32+
helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace prometheus --create-namespace \
33+
--set prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storage=50Gi \
34+
--set prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.storageClassName=<FSX-BASIC-NAS>
35+
```
36+
Where:
37+
* \<FSX-BASIC-NAS\> is the storage class you want to use. If you don't care about persistent storage, you can omit the
38+
last two lines from the above command.
3739

38-
### Integration with AWS Secrets Manager
40+
The above will create a 50Gib PVC for Prometheus to use. You can adjust the size as needed.
3941

40-
The installation supports integration with AWS Secrets Manager. You can store your FSxN credentials by using existing or new AWS Secrets Manager.
41-
Harvest will invoke script specified in the credentials_script path section which already mapped to Harvest container.
42-
Harvest uses ServiceAccount with permissions to fetch the secrets.
43-
Credentails script expect to fetch `USERNAME`, `PASSWORD` values from Secrets Manager.
44-
ServiceAccount should be created during the installation with the sufficient permissions.
42+
A successful installation should look like this:
43+
```
44+
$ helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace prometheus --create-namespace \
45+
--set prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storage=50Gi \
46+
--set prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.storageClassName=fsx-basic-nas
47+
NAME: kube-prometheus-stack
48+
LAST DEPLOYED: Fri Jul 26 22:57:04 2024
49+
NAMESPACE: prometheus
50+
STATUS: deployed
51+
REVISION: 1
52+
NOTES:
53+
kube-prometheus-stack has been installed. Check its status by running:
54+
kubectl --namespace prometheus get pods -l "release=kube-prometheus-stack"
55+
56+
Visit https://github.com/prometheus-operator/kube-prometheus for instructions on how to create & configure the Alertmanager and Prometheus instances using the Operator.
57+
```
58+
To check the status, you can run the following command:
59+
```bash
60+
kubectl get pods -n prometheus
61+
```
62+
The output should look something like this:
63+
```bash
64+
$ kubectl get pods -n prometheus
65+
NAME READY STATUS RESTARTS AGE
66+
alertmanager-kube-prometheus-stack-alertmanager-0 2/2 Running 0 51s
67+
kube-prometheus-stack-grafana-86844f6b47-njw6n 3/3 Running 0 56s
68+
kube-prometheus-stack-kube-state-metrics-7c8d64d446-rj4tv 1/1 Running 0 56s
69+
kube-prometheus-stack-operator-85b765d6bc-ll5q2 1/1 Running 0 56s
70+
kube-prometheus-stack-prometheus-node-exporter-7rtbp 1/1 Running 0 56s
71+
kube-prometheus-stack-prometheus-node-exporter-ffckd 1/1 Running 0 56s
72+
prometheus-kube-prometheus-stack-prometheus-0 2/2 Running 0 50s
73+
```
4574

75+
### Integration with AWS Secrets Manager
76+
77+
This Harvest installation supports integration with AWS Secrets Manager. To use it store your FSxN credentials into a
78+
Secrets Manager secret. Harvest will invoke the script specified in the credentials_script path section which is already
79+
mapped in Harvest container. The credentails_script will fetch the secret and set the credentials based on its content.
80+
It expects the secret string to be a json structure with a `username` and `password` keys. For example:
81+
```json
82+
{
83+
"username": "fsxadmin",
84+
"password": "fsxadmin-password"
85+
}
86+
```
87+
A ServiceAccount should be created during the installation with the sufficient permissions to fetch the secrets.
4688

4789
### Monitoring multiples FSxN
4890

49-
The Helm chart supports monitoring multiple FSxNs.
50-
You can add multiples FSxNs by configure it on `values.yaml`:
91+
The Helm chart supports monitoring multiple FSxNs. You can add multiples FSxNs by configure it on `values.yaml`.
5192
For example:
5293
```
5394
fsxs:
5495
clusters:
55-
- name: fsx1
96+
- name: <fsx1>
5697
managment_lif: <FSx1_Management_LIF>
5798
promPort: 12990
5899
secretName: <FSx1_secret_name>
59100
region: <FSx1_region>
60-
- name: fsx2
101+
- name: <fsx2>
61102
managment_lif: <FSx2_Management_LIF>
62103
promPort: 12991
63104
secretName: <FSx2_secret_name>
64105
region: <FSx2_region>
65106
```
107+
Of course replace the strings within the <> with your own values.
108+
66109
**NOTE:** Each FSxN cluster should have unique port number for promPort.
67110

68111
### Installation
69-
Install Harvest helm chart from this GitHub repository. The custom Helm chart includes:
112+
Download the Harvest helm chart from this GitHub repository found in the 'harvest' directory. The custom Helm chart includes:
70113
* `deplyment.yaml` - Harvest deployment using Harvest latest version image
71114
* `harvest-config.yaml` - Harvest backend configuration
72115
* `harvest-cm.yaml` - Environment variables configuration for credentails script.
73116
* `service-monitor.yaml` - Promethues ServiceMonitor for collecting Harvest metrics.
74117

75118
1. **Create AWS Secrets Manager for FSxN credentials**
76-
If you don't already have an AWS Secrets Manager secret for your FSxN credentials, you can create one using the AWS CLI.
119+
If you don't already have an AWS Secrets Manager secret with your FSxN credentials, you can create one using the AWS CLI.
77120
```
78121
aws secretsmanager create-secret \
79122
--region <REGION> \
@@ -105,8 +148,9 @@ The following IAM policy can be used to grant the all permissions required by Ha
105148
],
106149
"Version": "2012-10-17"
107150
}
108-
109151
```
152+
Of course replace the strings within the <> with your own values.
153+
110154
You can use the following command to create the policy:
111155

112156
POLICY_ARN=$(aws iam create-policy --policy-name harvest_read_secrets --policy-document file://harvest-read-secrets-policy.json --query Policy.Arn --output text)
@@ -134,7 +178,8 @@ Once the deployment is complete, Harvest should be listed as a target on Prometh
134178

135179
### Import FSxN CloudWatch metrics into your monitoring stack using YACE
136180
AWS provides FSx for ONTAP metrics which cannot be collected by Harvest. Therefore, we recommend to
137-
use yet-another-exporter (by Prometheus community) for collecting metrics from CloudWatch. See [YACE](https://github.com/nerdswords/helm-charts) for more information.
181+
use yet-another-exporter (by Prometheus community) for collecting metrics from CloudWatch.
182+
See [YACE](https://github.com/nerdswords/helm-charts) for more information.
138183

139184
#### Installation ####
140185
1. **Create ServiceAccount with permissions to AWS CloudWatch**
@@ -174,8 +219,7 @@ POLICY_ARN=$(aws iam create-policy --policy-name yace-exporter-policy --policy-d
174219

175220
2. **Create ServiceAccount**:
176221

177-
**note**: namespace should be already exists\
178-
if not exist use the following command:
222+
**note**: namespace should be already exists if not exist use the following command:
179223
```
180224
kubectl create ns <NAMESPACE>
181225
```

0 commit comments

Comments
 (0)