text
stringlengths
0
59.1k
- name: dev
mountPath: /dev
- name: run
mountPath: /var/run/docker.sock
- name: log
mountPath: /var/log
- name: host-root
mountPath: /host
readOnly: true
volumes:
- name: newrelic-config
secret:
secretName: newrelic-config
- name: dev
hostPath:
path: /dev
- name: run
hostPath:
path: /var/run/docker.sock
- name: log
hostPath:
path: /var/log
- name: host-root
hostPath:
path: /
<|endoftext|>
# source: k8s_examples/_archived/newrelic-infrastructure/newrelic-config-template.yaml type: yaml
apiVersion: v1
kind: Secret
metadata:
name: newrelic-config
type: Opaque
data:
config: {{config_data}}
<|endoftext|>
# source: k8s_examples/_archived/newrelic-infrastructure/README.md type: docs
## New Relic Infrastructure agent Example
This example shows how to run a New Relic Infrastructure agent as a pod in a DaemonSet on an existing Kubernetes cluster.
This example will create a DaemonSet which places the New Relic Infrastructure agent on every node in the cluster. It's also fairly trivial to exclude specific Kubernetes nodes from the DaemonSet to just monitor specific servers. (The prior nrsysmond has been deprecated.)
### Step 0: Prerequisites
This process will create privileged containers which have full access to the host system for logging. Beware of the security implications of this.
DaemonSets must be enabled on your cluster. Instructions for enabling DaemonSet can be found [here](../../docs/api.md#enabling-the-extensions-group).
### Step 1: Configure New Relic Infrastructure Agent
The New Relic Infrastructure agent is configured via environment variables. We will configure these environment variables in a sourced bash script, encode the environment file data, and store it in a secret which will be loaded at container runtime. (Reread this sentence a few times, it's *HOW* the entire container wor...
The [New Relic Infrastructure agent configuration page](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/configure-infrastructure-agent) lists all the other settings for the Infrastructure process.
To create an environment variable for a setting, prepend NRIA_ to its name and capitalize all of the env variable. For example,
```console
log_file=/var/log/nr-infra.log
```
translates to
```console
NRIA_LOG_FILE=/var/log/nr-infra.log
```
Edit examples/newrelic-infrastructure/nrconfig.env and configure relevant environment variables for your NewRelic Infrastructure agent. There are a few defaults defined, but the only required variable is the New Relic license key.
Now, let's vendor the config into a secret.
```console
$ cd examples/newrelic-infrastructure/
$ ./config-to-secret.sh
```
<!-- BEGIN MUNGE: EXAMPLE newrelic-config-template.yaml -->
```yaml
apiVersion: v1
kind: Secret
metadata:
name: newrelic-config
type: Opaque
data:
config: {{config_data}}
```
[Download example](newrelic-config-template.yaml?raw=true)
<!-- END MUNGE: EXAMPLE newrelic-config-template.yaml -->
The script will encode the config file and write it to `newrelic-config.yaml`.
Finally, submit the config to the cluster:
```console
$ kubectl create -f examples/newrelic-infrastructure/newrelic-config.yaml
```