Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test do not merge]Test chart #1179

Closed
wants to merge 21 commits into from
Closed
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
9 changes: 9 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
"patch"
],
"enabled": true
},
{
// Update Super Agent chart
"fileMatch": [ "^charts/super-agent-deployment/Chart.yaml$" ],
"datasourceTemplate": "docker",
"depNameTemplate": "newrelic/newrelic-super-agent",
"matchStrings": [
"appVersion: (?<currentValue>.*) # .*"
]
}
]
}
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
# synthetics-job-manager
/charts/synthetics-job-manager/ @newrelic/proactive-monitoring

# Infrastructure-related charts
/charts/nri-statsd/ @newrelic/caos
/charts/super-agent-deployment/ @newrelic/coreint
23 changes: 23 additions & 0 deletions charts/super-agent-deployment/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions charts/super-agent-deployment/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common-library
repository: https://helm-charts.newrelic.com
version: 1.1.1
digest: sha256:3c9053021f3c22aa3cdfc6781d3498bcbedb0b973af9121b1722469744fb5162
generated: "2023-10-13T15:08:34.076909+02:00"
28 changes: 28 additions & 0 deletions charts/super-agent-deployment/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v2
name: super-agent-deployment
description: A Helm chart to install New Relic Super agent on Kubernetes

type: application
version: 0.0.0-beta
appVersion: nightly # TODO: Change this with a proper version of the image.

dependencies:
- name: common-library
version: 1.1.1
repository: https://helm-charts.newrelic.com

keywords:
- newrelic
- super-agent

maintainers:
- name: sigilioso
url: https://github.com/sigilioso
- name: gsanchezgavier
url: https://github.com/gsanchezgavier
- name: kang-makes
url: https://github.com/kang-makes
- name: marcsanmi
url: https://github.com/marcsanmi
- name: paologallinaharbur
url: https://github.com/paologallinaharbur
80 changes: 80 additions & 0 deletions charts/super-agent-deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)

# super-agent-deployment

![Version: 0.0.0-beta](https://img.shields.io/badge/Version-0.0.0--beta-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: nightly](https://img.shields.io/badge/AppVersion-nightly-informational?style=flat-square)

A Helm chart to install New Relic Super agent on Kubernetes

# Helm installation

You can install this chart using directly this Helm repository:

```shell
helm repo add newrelic https://helm-charts.newrelic.com
helm upgrade --install newrelic/super-agent-deployment -f your-custom-values.yaml
```

## Values managed globally

This chart implements the [New Relic's common Helm library](https://github.com/newrelic/helm-charts/tree/master/library/common-library) which
means that it honors a wide range of defaults and globals common to most New Relic Helm charts.

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).

## 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.

At the point of the creation of the chart, it has no particularities and this section can be removed safely.

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | Sets pod/node affinities. Can be configured also with `global.affinity` |
| cluster | string | `""` | TODO: Name of the Kubernetes cluster monitored. Can be configured also with `global.cluster`. |
| config.content | string | See `values.yaml` for examples | Here you can set New Relic' Super Agent configuration. |
| config.create | bool | `true` | Set if the configMap is going to be created by this chart or the user will provide its own. |
| config.key | string | `""` | The key in the configMap that has the configuration for the Super Agent. |
| config.name | string | `""` | The name the configMap is going to have. If create is set to false, the name of an existing configMap that will be used to config the Super Agent. |
| containerSecurityContext | object | `{}` | Sets security context (at container level). Can be configured also with `global.containerSecurityContext` |
| customAttributes | object | `{}` | TODO: Adds extra attributes to the cluster and all the metrics emitted to the backend. Can be configured also with `global.customAttributes` |
| customSecretLicenseKey | string | `""` | TODO: In case you don't want to have the license key in you values, this allows you to point to which secret key is the license key located. Can be configured also with `global.customSecretLicenseKey` |
| customSecretName | string | `""` | TODO: In case you don't want to have the license key in you values, this allows you to point to a user created secret to get the key from there. Can be configured also with `global.customSecretName` |
| dnsConfig | object | `{}` | Sets pod's dnsConfig. Can be configured also with `global.dnsConfig` |
| extraEnv | list | `[]` | Add user environment variables to the agent |
| extraEnvFrom | list | `[]` | Add user environment from configMaps or secrets as variables to the agent |
| extraVolumeMounts | list | `[]` | Defines where to mount volumes specified with `extraVolumes` |
| extraVolumes | list | `[]` | Volumes to mount in the containers |
| fedramp.enabled | bool | `false` | Enables FedRAMP. Can be configured also with `global.fedramp.enabled` |
| fullnameOverride | string | `""` | Override the full name of the release |
| hostNetwork | bool | `false` | Sets pod's hostNetwork. Can be configured also with `global.hostNetwork` |
| image | object | See `values.yaml` | Image for the New Relic Super Agent |
| image.pullSecrets | list | `[]` | The secrets that are needed to pull images from a custom registry. |
| labels | object | `{}` | Additional labels for chart objects. Can be configured also with `global.labels` |
| licenseKey | string | `""` | This set this license key to use. Can be configured also with `global.licenseKey` |
| nameOverride | string | `""` | Override the name of the chart |
| nodeSelector | object | `{}` | Sets pod's node selector. Can be configured also with `global.nodeSelector` |
| nrStaging | bool | `false` | Send the metrics to the staging backend. Requires a valid staging license key. Can be configured also with `global.nrStaging` |
| podAnnotations | object | `{}` | Annotations to be added to all pods created by the integration. |
| podLabels | object | `{}` | Additional labels for chart pods. Can be configured also with `global.podLabels` |
| podSecurityContext | object | `{}` | Sets security context (at pod level). Can be configured also with `global.podSecurityContext` |
| priorityClassName | string | `""` | Sets pod's priorityClassName. Can be configured also with `global.priorityClassName` |
| proxy | string | `""` | TODO: Configures the integration to send all HTTP/HTTPS request through the proxy in that URL. The URL should have a standard format like `https://user:password@hostname:port`. Can be configured also with `global.proxy` |
| rbac.create | bool | `true` | Whether the chart should automatically create the RBAC objects required to run. |
| resources | object | `{}` | Resource limits to be added to all pods created by the integration. |
| serviceAccount | object | See `values.yaml` | Settings controlling ServiceAccount creation. |
| serviceAccount.create | bool | `true` | Whether the chart should automatically create the ServiceAccount objects required to run. |
| tolerations | list | `[]` | Sets pod's tolerations to node taints. Can be configured also with `global.tolerations` |
| verboseLog | bool | `false` | TODO: Sets the debug logs to this integration or all integrations if it is set globally. Can be configured also with `global.verboseLog` |

## Maintainers

* [sigilioso](https://github.com/sigilioso)
* [gsanchezgavier](https://github.com/gsanchezgavier)
* [kang-makes](https://github.com/kang-makes)
* [marcsanmi](https://github.com/marcsanmi)
* [paologallinaharbur](https://github.com/paologallinaharbur)
51 changes: 51 additions & 0 deletions charts/super-agent-deployment/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[![Community Plus header](https://github.com/newrelic/opensource-website/raw/master/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)

{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

# Helm installation

You can install this chart using directly this Helm repository:

```shell
helm repo add newrelic https://helm-charts.newrelic.com
helm upgrade --install newrelic/super-agent-deployment -f your-custom-values.yaml
```

{{ template "chart.sourcesSection" . }}

## Values managed globally

This chart implements the [New Relic's common Helm library](https://github.com/newrelic/helm-charts/tree/master/library/common-library) which
means that it honors a wide range of defaults and globals common to most New Relic Helm charts.

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).

## 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.

At the point of the creation of the chart, it has no particularities and this section can be removed safely.

{{ template "chart.valuesSection" . }}

{{ if .Maintainers }}
## Maintainers
{{ range .Maintainers }}
{{- if .Name }}
{{- if .Url }}
* [{{ .Name }}]({{ .Url }})
{{- else }}
* {{ .Name }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
72 changes: 72 additions & 0 deletions charts/super-agent-deployment/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{{- /*
Return the name of the configMap holding the Super Agent's config. Defaults to release's fill name suffiexed with "-config"
*/ -}}
{{- define "newrelic-super-agent.config.name" -}}
{{- .Values.config.name | default (include "newrelic.common.naming.truncateToDNSWithSuffix" ( dict "name" (include "newrelic.common.naming.fullname" .) "suffix" "config" )) -}}
{{- end -}}


{{- /*
Return the key name of the configMap holding the Super Agent's config. Defaults to "config.yaml"
*/ -}}
{{- define "newrelic-super-agent.config.key" -}}
{{- .Values.config.key | default "config.yaml" -}}
{{- end -}}


{{- /*
This function simply templates the default configuration for the agent.
*/ -}}
{{- define "newrelic-super-agent.config.defaultConfig" -}}
opamp:
endpoint: COMPLETE-ME
headers:
api-key: COMPLETE-ME
{{- end -}}


{{- /*
Builds the configuration from config on the values and add more config options like
cluster name, licenses, and custom attributes
*/ -}}
{{- define "newrelic-super-agent.config.content" -}}
{{- /*
This snippet should execute always to block all unsupported features from the common-lirary that are not yet supported
by this chart.

TODO: Remove this file when the Super Agent supports licensekey as an envVar.
*/ -}}
{{ $licenseKey := include "newrelic.common.license._licenseKey" . }}
{{- if or (include "newrelic.common.license._customSecretName" .) (include "newrelic.common.license._customSecretKey" .) -}}
{{- fail "Common library supports setting an external custom secret for the license but the super agent still does not support the license by an env var. You must specify a .licenseKey or .global.licenseKey" -}}
{{- end -}}
{{- if not $licenseKey -}}
{{- fail "You must specify .licenseKey or .global.licenseKey" -}}
{{- end -}}

{{- /*
TODO: There are a lot of TODOs to be made in this chart yet and some of them are going to impact the YAML that holds
the config.

If you need a list of TODOs, just `grep TODO` on the `values.yaml` and look for things that are yet to be implemented.
*/ -}}
{{- $config := fromYaml (include "newrelic-super-agent.config.defaultConfig" .) -}}
{{- if .Values.config.content -}}
{{- $_ := deepCopy .Values.config.content | mustMergeOverwrite $config -}}
{{- end -}}

{{- if include "newrelic.common.fedramp.enabled" . -}}
{{- fail "FedRAMP is not supported yet" -}}{{- /* TODO: Add FedRamp support */ -}}
{{- else if include "newrelic.common.nrStaging" . -}}
{{- $_ := set $config.opamp "endpoint" "https://opamp.staging-service.newrelic.com/v1/opamp" -}}
{{- else -}}
{{- /* TODO: Is this the prod URL? */ -}}
{{- $_ := set $config.opamp "endpoint" "https://opamp.service.newrelic.com/v1/opamp" -}}
{{- end -}}

{{- /* We have to use common library internals because the agent does not support envvars yet */ -}}
{{- /* TODO: Remove this when the sa supports licenseKeys from envVars */ -}}
{{- $_ := set $config.opamp.headers "api-key" $licenseKey -}}

{{- $config | toYaml -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.config.create -}}
---
kind: ConfigMap
metadata:
name: {{ include "newrelic-super-agent.config.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "newrelic.common.labels" $ | nindent 4 }}
apiVersion: v1
data:
{{ include "newrelic-super-agent.config.key" . }}: |
{{- include "newrelic-super-agent.config.content" . | nindent 4 }}
{{- end }}
Loading
Loading