Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Agent Control setup with Terraform"
metaDescription: "Agent Control is an agent supervisor that can be used to deploy, update, and manage New Relic agents."
freshnessValidatedDate: never
---
[New Relic Agent Control](/docs/new-relic-control/agent-control/overview) with Terraform provides a powerful, declarative solution for managing fleets of agents at scale. By using Terraform and Helm together, you can ensure a consistent, repeatable, and scalable approach to deploying New Relic instrumentation across your entire infrastructure, especially when dealing with multiple Kubernetes clusters.
[New Relic Agent Control](/docs/new-relic-control/agent-control/overview) with Terraform provides a powerful, declarative solution for managing fleets of agents at scale. By using Terraform and Agent Control together, you can ensure a consistent, repeatable, and scalable approach to deploying New Relic instrumentation across your entire infrastructure, especially when dealing with multiple Kubernetes clusters.

## Prerequisites [#prereqs]
Before you begin, ensure you have the following:
Expand All @@ -19,11 +19,11 @@ Before you begin, ensure you have the following:

- **Configuration Details:**
- **New Relic Organization ID:** The New Relic `OrgId` will identify which organization you are getting your client ID key and secret from.
- **User permissions:** Your user needs the correct permissions to create a System Identity. This typically requires the Authentication Domain Manager and Org Product Admin roles.
- **User permissions:** Your user needs the correct permissions to create a System Identity. This typically requires the Authentication Domain Manager or NR Control role.
- **Kubernetes cluster name:** Have the name of your Kubernetes cluster ready, as it will be referenced during the installation process.

<Callout variant="tip">
When setting up a new cluster with Terraform, make sure to use the same cluster name during the installation of agent control.
When setting up a new cluster with Terraform, make sure to use the same cluster name during the installation of Agent Control.
</Callout>

### Kubernetes Compatibility [#compatibility]
Expand All @@ -32,7 +32,7 @@ To find out which Kubernetes versions are compatible with this solution, refer t

## Install [#installation]

If you don't have your `clientId` and `clientSecret`, use the following [NerdGraph](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/) API call to generate them. This requires your New Relic Admin User Key and Organization ID.
If you don't have your `clientId` and `clientSecret`, use the following [NerdGraph](https://docs.newrelic.com/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/) API call to generate them. This requires your New Relic Admin User Key and Organization ID.

```sh
curl -X POST \
Expand Down Expand Up @@ -156,7 +156,7 @@ agent-control-deployment:
infrastructure:
type: newrelic/com.newrelic.infrastructure:0.1.0
content:
chart_version: "*"
chart_version: "*"
chart_values:
newrelic-infrastructure:
enableProcessMetrics: true
Expand Down Expand Up @@ -210,6 +210,6 @@ agent-control-deployment:
### To uninstall Agent Control:
1. **Remove the `helm_release` resource block** for `newrelic_agent_control` from your `main.tf` file.
2. **Run `terraform plan`** to review the changes. Carefully examine the plan output to ensure that only the intended resources are marked for deletion.
3. **Run `terraform apply`** and confirm the execution to uninstall the release. This will implement the planned changes, effectively removing the specified Helm release from your environment.
3. **Run `terraform apply`** and confirm the execution to uninstall the release. This will implement the planned changes, effectively removing the specified Helm release from your environment.

Confirm the execution when prompted to complete the uninstallation process.
98 changes: 30 additions & 68 deletions src/content/docs/logs/log-collectors/log-collector-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,66 +61,29 @@ You have two primary options for setting up Fluent Bit in your Kubernetes cluste

#### Option 1 (Recommended): Install Fluent Bit with New Relic Control

For an installation that's fully managed by Agent Control, enable log forwarding as part of your New Relic Control guided installation. This process installs the Fluent Bit agent and other essential components and registers the agent with your fleet.
To use Fluent Bit with Agent Control, enable log forwarding as part of the Agent Control installation, as shown in the sample configuration below.

<CollapserGroup>
<Collapser
id="fluent-bit-config"
title="Sample config"
>
```yaml
global:
cluster: "YOUR_CLUSTER_NAME"
licenseKey: "YOUR_LICENSE_KEY"
userKey: "YOUR_USER_KEY"

# Values related to the agent control's Helm chart release.
# `https://github.com/newrelic/helm-charts/blob/master/charts/agent-control/values.yaml`
agent-control-deployment:
identityClientId: ""
identityClientSecret: ""
config:
fleet_control:
# Optional: Specify a fleet_id (entity guid) to automatically connect to an existing fleet.
fleet_id: ""
auth:
# New Relic organization ID where agent will connect to.
organizationId: "YOUR_ORGANIZATION_ID"

# List of managed agents that will be deployed. The key represents the name of the agent and the value holds the configuration.
subAgents:
infrastructure:
type: newrelic/com.newrelic.infrastructure:0.1.0
content:
# Ref: `https://github.com/newrelic/helm-charts/tree/master/charts/nri-bundle`
# Recommended: check and define an explicit chart version (latest stable)
chart_version: "*"
# chart_values:
# newrelic-infrastructure:
# enableProcessMetrics: true
logs:
type: newrelic/io.fluentbit:0.1.0
content:
# Ref: `https://github.com/newrelic/helm-charts/tree/master/charts/newrelic-logging`
# Recommended: check and define an explicit chart version (latest stable)
chart_version: "*"
chart_values:
newrelic-logging:
sendMetrics: true
agent-operator:
type: com.newrelic.k8s_agent_operator:0.1.0
content:
chart_version: "*"
```
</Collapser>
</CollapserGroup>

Remember to uncomment the necessary configurations and replace placeholders such as `YOUR_CLUSTER_NAME` and `YOUR_LICENSE_KEY` with your actual values.
For an installation that's fully managed by New Relic Control, add Fluent Bit as part of a deployment to your fleet of Kubernetes clusters in Fleet Control. This process installs the Fluent Bit agent and other essential components and registers the agent with your fleet.

To add Fluent Bit to a deployment, follow these steps:
1. In New Relic Control, open **Fleets**.
2. Create a new fleet for the Kubernetes clusters where you want to install Fluent Bit, or use an existing fleet.
3. Click **Create deployment**.
4. On the New deployment page, enter a deployment name and description, and then click **Install agents and add configs**.
5. Select **Fluent Bit** from the list of available agents.
6. Select an existing Fluent Bit configuration or create a new configuration.
7. Select the configuration version.
<Callout variant="important">
Specify an explicit chart version to ensure consistency and reliability across deployments.
</Callout>
8. Click **Add to deployment**.
9. Click **Save draft**.
10. Click **Start deployment**.

To install Agent Control to a Kubernetes cluster and join it to your fleet, follow these steps:
1. In Integrations & Agents, follow the guided installation to install Agent Control.
2. On the **Select your fleet** page, select the fleet with Fluent Bit deployed to it.
3. Complete the remaining steps in the Agent Control guided installation.
4. After installing Agent Control to your Kubernetes cluster, Fluent Bit will be remotely installed by Fleet Control.


#### Option 2: Install with the Kubernetes integration

Expand All @@ -147,22 +110,21 @@ To create a Fluent Bit configuration, follow these steps:

### Create a deployment
1. In New Relic Control, open **Fleets**.
2. Select the fleet you want to create a Fluent Bit configuration for.
2. Select the fleet for the Kubernetes clusters where you want to install Fluent Bit.
3. Click **Create a deployment**.
4. On the New deployment page, enter a deployment name and description, and then click **Add a configuration**.
5. Select **Fluent Bit** as the agent type, select the configuration you want to deploy, and then click **Next**.
6. Select the configuration version.
<Callout variant="important">
A configuration can have multiple versions. Choose the version you want to deploy. For a newly created configuration, you’ll have only one version.
</Callout>
7. Click **Add to deployment**.
4. On the New deployment page, enter a deployment name and description, and then click **Install agents and add configs**.
5. Select **Fluent Bit** from the list of available agents.
6. Select an existing Fluent Bit configuration or create a new configuration.
7. Select the configuration version.
<Callout variant="important">
Ensure the fleet has at least one managed entity. Or, add one.
A configuration can have multiple versions. Choose the version you want to deploy. For a newly created configuration, you'll have only one version.
</Callout>
8. Click **Start deployment**.
8. Click **Add to deployment**.
9. Click **Save draft**.
10. Click **Start deployment**.

### View fleet
In Fleets, select the specific fleet you want to work with. This opens the fleet detail page. The Summary tab shows the entities that are part of your fleet. To view agent or deployment details, use the Agents or the Deployments tab.
In Fleets, select the specific fleet you want to work with. This opens the fleet detail page. The Summary tab shows the managed entities that are part of your fleet. To view agent or deployment details, use the Agents or the Deployments tab.

### Monitor the health and performance of your log collector
Effective performance monitoring of the Fluent Bit agent is crucial for log management and optimization within your Kubernetes environments. By tracking key metrics, you can identify potential issues and facilitate troubleshooting.
Expand Down Expand Up @@ -222,7 +184,7 @@ Before upgrading, ensure your current configurations are backed up. Review any r
8. Back in New Relic, close the side panel and click the fleet that contains the agent. It opens the fleet summary in New Relic Control.
9. Select the Fluent Bit configuration.
10. Update the chart version in the configuration file per the chart version you noted earlier, and save your changes.
11. Deploy the configuration.
11. Deploy the configuration.

<Callout variant="important">
If an agent isn't part of a fleet yet, add the agent to a fleet first, and then perform the steps to upgrade.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ freshnessValidatedDate: never

Agent Control provides a single, unified platform for managing a wide variety of New Relic and OpenTelemetry agents across your fleets. By centralizing management, you can deploy, configure, and update your instrumentation with ease.

While Agent Control is designed to support both containerized and on-premise environments, support for specific agent types varies. The following table provides a comprehensive overview of which agents can be managed by Agent Control and their support status across environments.
While Agent Control is designed to support both Kubernetes and host-based environments, support for specific agent types varies. The following table provides a comprehensive overview of which agents can be managed by Agent Control and their support status across environments.

### Current support

Expand All @@ -37,4 +37,4 @@ Agent-specific permissions: Agent Control is designed to provide you with flexib
| **Fluent Bit** | Read access to pod and container logs. | Kubernetes |
| **New Relic Prometheus agent** | Permissions to discover and access service endpoints within the cluster for scraping metrics. | Kubernetes |
| **New Relic eBPF agent** | Elevated privileges (for example, `CAP_SYS_ADMIN`) to load eBPF programs on the host kernel. | Kubernetes |
| **APM agents (.NET, Java, Node, Python, Ruby)** | *Not currently supported by Agent Control.* | N/A |
| **APM agents (.NET, Java, Node, Python, Ruby)** | *Not currently supported by Agent Control.* | N/A |
Loading