Logo

User Guide

Nobl9 User Guide

Back to Nobl9 Documentation

To install CloudWatch agent, use relevant docker command and apply YAML through kubectl:

If you are using AWS Access Key ID and Secret Access Key, replace AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY in the following YAML. Next, run the command line below to deploy the Nobl9 Agent. The Agent enables Nobl9 to import your service metrics.

🔴 Important notes:
Ensure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables are set appropriately if you are using Access/Secret Keys. If these variables are not set, a Default Credential Provider Chain will be used. Next, apply YAML to deploy the Nobl9 Agent in your cluster. The Agent enables Nobl9 to import your service metrics.

apiVersion: v1
kind: Secret
metadata:
  name: nobl9-agent-nobl9-dev-cloudwatch-cloudwatch
  namespace: default
type: Opaque
stringData:
  aws_access_key_id: <AWS_ACCESS_KEY_ID>
  aws_secret__access_key: <AWS_SECRET_ACCESS_KEY>
  client_id: 0oa1a0zunmjUsrkxD417
  client_secret: ctHZ_dCdVi2EIjEtp4sD4Iia6VfIqWsJBBFS_Q_p
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nobl9-agent-nobl9-dev-cloudwatch-cloudwatch
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      nobl9-agent-name: cloudwatch
      nobl9-agent-project: cloudwatch
      nobl9-agent-organization: nobl9-dev
  template:
    metadata:
      labels:
        nobl9-agent-name: cloudwatch
        nobl9-agent-project: cloudwatch
        nobl9-agent-organization: nobl9-dev
    spec:
      containers:
        - name: agent-container
          image: nobl9/agent:0.31.0
          resources:
            requests:
              memory: "350Mi"
              cpu: "0.1"
          env:
            - name: N9_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  key: client_id
                  name: nobl9-agent-nobl9-dev-cloudwatch-cloudwatch
            - name: N9_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  key: client_secret
                  name: nobl9-agent-nobl9-dev-cloudwatch-cloudwatch
            - name: AWS_ACCESS_KEY_ID
              valueFrom:
                secretKeyRef:
                  key: aws_access_key_id
                  name: nobl9-agent-nobl9-dev-cloudwatch-cloudwatch
            - name: AWS_SECRET_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  key: aws_secret_access_key
                  name: nobl9-agent-nobl9-dev-cloudwatch-cloudwatch

docker run -d --restart on-failure \
--name nobl9-agent-nobl9-dev-cloudwatch-cloudwatch \
-e N9_CLIENT_ID="0oa1a0zunmjUsrkxD417" \
-e N9_CLIENT_SECRET="ctHZ_dCdVi2EIjEtp4sD4Iia6VfIqWsJBBFS_Q_p" \
-e AWS_ACCESS_KEY_ID="<AWS_ACCESS_KEY_ID>" \
-e AWS_SECRET_ACCESS_KEY="<AWS_SECRET_ACCESS_KEY>" \
nobl9/agent:0.31.0