Skip to content

Commit 24c2915

Browse files
authored
Update README.md
1 parent d4569b3 commit 24c2915

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

examples/AWS/AWS-EKS/README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ This process can also be done using the AWS Command Line Interface (CLI) or the
7474
you can add to customize the cluster further. Cluster creation takes around 20 minutes.
7575

7676
## Installing the Amazon EBS CSI Driver
77-
You need to install the Elastic Block Store (EBS) Container Storage Interface (CSI) Driver so the EKS cluster can manage Amazon EBS volumes. This is necessary if you want to run any application that has a database, such as Prometheus.
78-
1. First, attach an OpenID Connect (OIDC) identity provider so that applications within the EKS cluster can access AWS resources. Execute the command `eksctl utils associate-iam-oidc-provider --region=<cluster_region> --cluster=<cluster_name> --approve`.
79-
2. Next, grant the prospective EBS CSI driver IAM permissions to call the AWS APIs with this command:
80-
'''
77+
You need to install the Elastic Block Store (EBS) Container Storage Interface (CSI) Driver so the EKS cluster can manage Amazon EBS volumes. This is necessary if you want to run any application that has a database, such as Prometheus.
78+
1. First, attach an OpenID Connect (OIDC) identity provider so that applications within the EKS cluster can access AWS resources. Execute the command `eksctl utils associate-iam-oidc-provider --region=<cluster_region> --cluster=<cluster_name> --approve`.
79+
2. Next, grant the prospective EBS CSI driver IAM permissions to call the AWS APIs with this command:
80+
8181
eksctl create iamserviceaccount \
8282
--name ebs-csi-controller-sa \
8383
--namespace kube-system \
@@ -87,78 +87,78 @@ This process can also be done using the AWS Command Line Interface (CLI) or the
8787
--role-only \
8888
--role-name AmazonEKS_EBS_CSI_DriverRole \
8989
--region <cluster_region>
90-
'''
91-
3. Finally, add the EBS CSI driver with this command:
92-
`eksctl create addon --name aws-ebs-csi-driver --cluster <cluster_name> --service-account-role-arn arn:aws:iam::<AWS Account ID>:role/AmazonEKS_EBS_CSI_DriverRole --region <cluster region>`
93-
Note the Account ID is the 12-digit number associated with the user you created earlier.
90+
91+
3. Finally, add the EBS CSI driver with this command:
92+
`eksctl create addon --name aws-ebs-csi-driver --cluster <cluster_name> --service-account-role-arn
93+
arn:aws:iam::<AWS Account ID>:role/AmazonEKS_EBS_CSI_DriverRole --region <cluster region>`
94+
Note the Account ID is the 12-digit number associated with the user you created earlier.
9495

9596
## Deploying the sample application
96-
1. Execute the command `cd {your_path}/Chronos/examples/AWS/AWS-EKS` so you are in the AWS-EKS directory.
97-
2. Execute the command `kubectl apply -f knote` to deploy the sample application.
98-
3. Run `kubectl get pods` to monitor the status of the pods. Wait until all pods go from status 'ContainerCreating' to 'Running.'
99-
4. Run `kubectl get service knote` and visit the external IP address. Add some notes or images to your functioning application!
97+
1. Execute the command `cd {your_path}/Chronos/examples/AWS/AWS-EKS` so you are in the AWS-EKS directory.
98+
2. Execute the command `kubectl apply -f knote` to deploy the sample application.
99+
3. Run `kubectl get pods` to monitor the status of the pods. Wait until all pods go from status 'ContainerCreating' to 'Running.'
100+
4. Run `kubectl get service knote` and visit the external IP address. Add some notes or images to your functioning application!
100101

101102
## Deploying Prometheus
102-
1. Exectute the command:
103-
`helm repo add prometheus-community https://prometheus-community.github.io/helm-charts`
104-
2. Execute the command:
105-
```
103+
1. Exectute the command:
104+
`helm repo add prometheus-community https://prometheus-community.github.io/helm-charts`
105+
2. Execute the command:
106+
106107
helm install my-prometheus --repo https://prometheus-community.github.io/helm-charts prometheus \
107108
--namespace prometheus --create-namespace \
108109
--set pushgateway.enabled=false \
109110
--set alertmanager.enabled=false \
110111
-f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/prometheus/extraScrapeConfigs.yaml
111-
```
112-
112+
113113
## Deploying OpenCost
114-
1. Execute the command:
115-
`kubectl apply --namespace opencost -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/opencost.yaml`
116-
2. Check the UI with the command:
117-
`kubectl port-forward --namespace opencost service/opencost 9003 9090`
114+
1. Execute the command:
115+
`kubectl apply --namespace opencost -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/opencost.yaml`
116+
2. Check the UI with the command:
117+
`kubectl port-forward --namespace opencost service/opencost 9003 9090`
118118

119119
## Deploying and Configuring Grafana
120-
1. Execute the command:
121-
`helm repo add grafana https://grafana.github.io/helm-charts`
122-
2. Execute the command:
123-
```
120+
1. Execute the command:
121+
`helm repo add grafana https://grafana.github.io/helm-charts`
122+
2. Execute the command:
123+
124124
helm install grafana grafana/grafana \
125125
--namespace grafana \
126126
--set persistence.storageClassName="gp2" \
127127
--set persistence.enabled=true \
128128
--set adminPassword='EKS!sAWSome' \
129129
--values ${HOME}/environment/grafana/grafana.yaml \
130130
--set service.type=LoadBalancer
131-
```
132-
3. Execute these commands to get the URL. Login in with the username admin and the password EKS!sAWsome
133-
```
131+
132+
3. Execute these commands to get the URL. Login in with the username admin and the password EKS!sAWsome
133+
134134
export ELB=$(kubectl get svc -n grafana grafana -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
135135
echo "http://$ELB"
136136
```
137-
4. To create the dashboard for monitoring Prometheus metrics, go to the sidebar, click on the four square icon, and click '+Import.' For the ID, type in 3119. For tracking, select Prometheus. Hit Create.
138-
5. For the Opencost dashbaord, go to the sidebar, click on the four square icon, and click '+Import.' Upload the opencostGrafana.json file, select Prometheus under tracking, and then create.
139-
6. You need to edit the Grafana ini file to make Grafana publicly accessible. In order to do so, go to your terminal and run:
137+
4. To create the dashboard for monitoring Prometheus metrics, go to the sidebar, click on the four square icon, and click '+Import.' For the ID, type in 3119. For tracking, select Prometheus. Hit Create.
138+
5. For the Opencost dashbaord, go to the sidebar, click on the four square icon, and click '+Import.' Upload the opencostGrafana.json file, select Prometheus under tracking, and then create.
139+
6. You need to edit the Grafana ini file to make Grafana publicly accessible. In order to do so, go to your terminal and run:
140140
`kubectl edit -n grafana configmap/grafana`
141-
7. Press the 'i' key to start editing and add this into the Grafana ini section:
142-
```
141+
7. Press the 'i' key to start editing and add this into the Grafana ini section:
142+
143143
documentation:
144144
[security]
145145
allow_embedding: true
146146
[auth.anonymous]
147147
enabled: true
148148
[dataproxy]
149149
timeout: 600
150-
```
151-
8. Type ':wq' to save the file and quit the editor.
152-
9. Execute this command: `kubectl rollout restart deployment grafana -n grafana`
150+
151+
8. Type ':wq' to save the file and quit the editor.
152+
9. Execute this command: `kubectl rollout restart deployment grafana -n grafana`
153153
154154
## Adding EKS cluster to Chronos dashboard using the Grafana URL
155-
1. Click the add modal on the dashboard. Select Cloudbased Services. Select EKS. Input your Grafana URL (ex: xxxx.region.xxx.amazonaws.com) at the root path.
156-
2. You should now be able to view two Grafana embedded dashboards -- the Prometheus Metrics & Opencost! Anytime you want to view the status of other microservices, whether cloudbased or locally hosted, go back to the Dashboard on the sidebar menu and click a new modal.
155+
1. Click the add modal on the dashboard. Select Cloudbased Services. Select EKS. Input your Grafana URL (ex: xxxx.region.xxx.amazonaws.com) at the root path.
156+
2. You should now be able to view two Grafana embedded dashboards -- the Prometheus Metrics & Opencost! Anytime you want to view the status of other microservices, whether cloudbased or locally hosted, go back to the Dashboard on the sidebar menu and click a new modal.
157157
158158
## Cleanup
159-
To tear down your cluster, execute this command:
160-
`eksctl delete cluster --name=<cluster_name> --region=<cluster_region>`
159+
To tear down your cluster, execute this command:
160+
`eksctl delete cluster --name=<cluster_name> --region=<cluster_region>`
161161
162162
## Credit
163-
Credit for Knote application goes to the user learnK8s on [Github](https://github.com/learnk8s). Here is the source project [folder](https://github.com/learnk8s/knote-js/tree/master/04-05/kube).
163+
Credit for Knote application goes to the user learnK8s on [Github](https://github.com/learnk8s). Here is the source project [folder](https://github.com/learnk8s/knote-js/tree/master/04-05/kube).
164164

0 commit comments

Comments
 (0)