Skip to content

Commit fbc6c9b

Browse files
Kalyan Reddy DaidaKalyan Reddy Daida
authored andcommitted
Welcome to Stack Simplify
1 parent c5c45e8 commit fbc6c9b

File tree

4 files changed

+64
-52
lines changed

4 files changed

+64
-52
lines changed

18-EKS-Monitoring-using-CloudWatch-Container-Insights/README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
- What is CloudWatch Agent and Fluentd?
77

88

9-
## Step-01: Deploy our Sample to generate Load
9+
## Step-01: Deploy Sample Nginx Application to generate Load
1010
```
1111
# Deploy
1212
kubectl apply -f kube-manifests
1313
1414
# Access Application
15-
http://<Network-Load-Balancer-URL>/app1/index.html
15+
http://<Network-Load-Balancer-URL>/
1616
```
1717

1818
## Step-02: Associate CloudWatch Policy to our EKS Worker Nodes Role
@@ -29,14 +29,14 @@ Associate Policy: CloudWatchAgentServerPolicy
2929

3030
### Deploy CloudWatch Agent and Fluentd as DaemonSets
3131
- This command will
32-
- Create the Namespace amazon-cloudwatch.
33-
- Create all the necessary security objects for both DaemonSet:
34-
- SecurityAccount.
35-
- ClusterRole.
36-
- ClusterRoleBinding.
37-
- Deploy Cloudwatch-Agent (responsible for sending the metrics to CloudWatch) as a DaemonSet.
38-
- Deploy fluentd (responsible for sending the logs to Cloudwatch) as a DaemonSet.
39-
- Deploy ConfigMap configurations for both DaemonSets.
32+
- Creates the Namespace amazon-cloudwatch.
33+
- Creates all the necessary security objects for both DaemonSet:
34+
- SecurityAccount
35+
- ClusterRole
36+
- ClusterRoleBinding
37+
- Deploys `Cloudwatch-Agent` (responsible for sending the metrics to CloudWatch) as a DaemonSet.
38+
- Deploys fluentd (responsible for sending the logs to Cloudwatch) as a DaemonSet.
39+
- Deploys ConfigMap configurations for both DaemonSets.
4040
```
4141
# Template
4242
curl -s https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml | sed "s/{{cluster_name}}/<REPLACE_CLUSTER_NAME>/;s/{{region_name}}/<REPLACE-AWS_REGION>/" | kubectl apply -f -
@@ -47,23 +47,29 @@ curl -s https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-containe
4747

4848
## Verify
4949
```
50+
# List Daemonsets
5051
kubectl -n amazon-cloudwatch get daemonsets
5152
```
5253

54+
## Step-04: Create the load on our Sample Nginx Pod
55+
```
56+
# Generate Load
57+
kubectl run --generator=run-pod/v1 apache-bench -i --tty --rm --image=httpd -- ab -n 500000 -c 1000 http://sample-nginx-service.default.svc.cluster.local/
58+
```
5359

54-
## Step-04: Access CloudWatch Dashboard & Generate Traffic using Postman Runner
60+
## Step-05: Access CloudWatch Dashboard & Generate Traffic using Postman Runner
5561
- Access CloudWatch Container Insigths Dashboard
56-
- Generate some traffic using Postman Runner
5762

58-
## Step-05: CloudWatch Log Insights
63+
64+
## Step-06: CloudWatch Log Insights
5965
- View Container logs
6066

6167

62-
## Step-06: CloudWatch Alarms from metrics
68+
## Step-07: CloudWatch Alarms from metrics
6369
- Create Alarms
6470

6571

66-
## Step-07: Clean-Up Container Insights
72+
## Step-08: Clean-Up Container Insights
6773
```
6874
# Template
6975
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml | sed "s/{{cluster_name}}/cluster-name/;s/{{region_name}}/cluster-region/" | kubectl delete -f -
@@ -72,7 +78,7 @@ curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-i
7278
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml | sed "s/{{cluster_name}}/eksdemo1/;s/{{region_name}}/us-east-1/" | kubectl delete -f -
7379
```
7480

75-
## Step-08: Clean-Up Application
81+
## Step-09: Clean-Up Application
7682
```
7783
# Delete Apps
7884
kubectl delete -f kube-manifests/

18-EKS-Monitoring-using-CloudWatch-Container-Insights/kube-manifests/01-Nginx-App1-Deployment.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

18-EKS-Monitoring-using-CloudWatch-Container-Insights/kube-manifests/02-NetworkLoadBalancer.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: sample-nginx-deployment
5+
labels:
6+
app: sample-nginx
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: sample-nginx
12+
template:
13+
metadata:
14+
labels:
15+
app: sample-nginx
16+
spec:
17+
containers:
18+
- name: sample-nginx
19+
image: stacksimplify/kubenginx:1.0.0
20+
ports:
21+
- containerPort: 80
22+
resources:
23+
requests:
24+
cpu: "5m"
25+
memory: "5Mi"
26+
limits:
27+
cpu: "10m"
28+
memory: "10Mi"
29+
---
30+
apiVersion: v1
31+
kind: Service
32+
metadata:
33+
name: sample-nginx-service
34+
labels:
35+
app: sample-nginx
36+
spec:
37+
type: NodePort
38+
selector:
39+
app: sample-nginx
40+
ports:
41+
- port: 80
42+
targetPort: 80

0 commit comments

Comments
 (0)