Skip to content

Commit

Permalink
feat(dev): add option for dynamicAgent (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
paologallinaharbur authored Nov 21, 2024
1 parent 64de0d0 commit 32d0166
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 12 deletions.
6 changes: 3 additions & 3 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
/charts/synthetics-job-manager/ @newrelic/proactive-monitoring

# Infrastructure-related charts
/charts/nri-statsd/ @newrelic/caos
/charts/super-agent-deployment/ @newrelic/coreint @newrelic/caos
/charts/super-agent/ @newrelic/coreint @newrelic/caos
/charts/nri-statsd/ @newrelic/ohai
/charts/super-agent-deployment/ @newrelic/ac @newrelic/ohai
/charts/super-agent/ @newrelic/ac @newrelic/ohai
6 changes: 3 additions & 3 deletions charts/super-agent/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ dependencies:
version: 2.13.0
- name: super-agent-deployment
repository: ""
version: 0.0.26-beta
version: 0.0.27-beta
- name: common-library
repository: https://helm-charts.newrelic.com
version: 1.3.0
digest: sha256:55ec5d7556e8ea4a5628d8aaa7e21975b0fb6441717bfb2f082de540508c3d38
generated: "2024-11-04T13:03:03.888745-01:00"
digest: sha256:7da311726a72e9fca667861e0717fc0a79f768b529ca44b0d46b8d8f535f8f70
generated: "2024-11-15T08:53:29.020878-01:00"
4 changes: 2 additions & 2 deletions charts/super-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: super-agent
description: Bootstraps New Relic' Super Agent

type: application
version: 0.0.23-beta
version: 0.0.24-beta

dependencies:
- name: flux2
repository: https://fluxcd-community.github.io/helm-charts
version: 2.13.0
condition: flux2.enabled
- name: super-agent-deployment
version: 0.0.26-beta
version: 0.0.27-beta
condition: super-agent-deployment.enabled
# The following dependency is needed as sub-dependency of super-agent-deployment
- name: common-library
Expand Down
28 changes: 28 additions & 0 deletions charts/super-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,41 @@ means that it honors a wide range of defaults and globals common to most New Rel
Options that can be defined globally include `affinity`, `nodeSelector`, `tolerations`, `proxy` and others. The full list can be found at
[user's guide of the common library](https://github.com/newrelic/helm-charts/blob/master/library/common-library/README.md).

## Test custom agentTypes

In order to test custom agentTypes is possible to leverage `extraVolumeMounts` and `extraVolumes` once you have created the configMap in the namespace.

You can run the following commands to create in the newrelic namespace a configMap containing a dynamic agentType:
```bash
$ kubectl create configmap dynamic-agent --from-file=dynamic-agent-type=./local/values-dynamic-agent-type.yaml -n default
```

Then you can mount such agentType leveraging extra volumes in the values.yaml
```yaml
super-agent-deployment:
# [...]
extraVolumeMounts:
- name: dynamic
mountPath: /etc/newrelic-super-agent/dynamic-agent-type.yaml
subPath: dynamic-agent-type.yaml
readOnly: true
extraVolumes:
- name: dynamic
configMap:
name: dynamic-agent
items:
- key: dynamic-agent-type
path: dynamic-agent-type.yaml
```
## Chart particularities
> **TODO:** Here is where you should add particularities for this chart like what does the chart do with the privileged and
low data modes or any other quirk that it could have.
As of the creation of the chart, it has no particularities and this section can be removed safely.
## Values
| Key | Type | Default | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Helm chart to install New Relic Super agent on Kubernetes

type: application

version: 0.0.26-beta
version: 0.0.27-beta

keywords:
- newrelic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ spec:

volumeMounts:
- name: super-agent-config
mountPath: /etc/newrelic-super-agent
mountPath: /etc/newrelic-super-agent/config.yaml
readOnly: true
subPath: config.yaml
# TODO: when releasing we should check if this is still needed and/or if we need to persist the data.
- mountPath: /var/lib/newrelic-super-agent
name: var-lib-newrelic-super-agent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ tests:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: super-agent-config
mountPath: /etc/newrelic-super-agent
mountPath: /etc/newrelic-super-agent/config.yaml
readOnly: true
subPath: config.yaml
- mountPath: /var/lib/newrelic-super-agent
name: var-lib-newrelic-super-agent
readOnly: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ tests:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: super-agent-config
mountPath: /etc/newrelic-super-agent
mountPath: /etc/newrelic-super-agent/config.yaml
readOnly: true
subPath: config.yaml
- mountPath: /var/lib/newrelic-super-agent
name: var-lib-newrelic-super-agent
readOnly: false
Expand Down

0 comments on commit 32d0166

Please sign in to comment.