Skip to content

Commit

Permalink
[chart] Document ksm defaults in the values (#421)
Browse files Browse the repository at this point in the history
* document ksm defaults in the values
* compatibility layer takes now precedence
  • Loading branch information
kang-makes authored May 13, 2022
1 parent ee09a53 commit 5313cb2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/newrelic-infrastructure/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sources:
- https://github.com/newrelic/nri-kubernetes/tree/master/charts/newrelic-infrastructure
- https://github.com/newrelic/infrastructure-agent/

version: 3.3.4
version: 3.3.5
appVersion: 3.1.1

dependencies:
Expand Down
4 changes: 3 additions & 1 deletion charts/newrelic-infrastructure/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# newrelic-infrastructure

![Version: 3.3.3](https://img.shields.io/badge/Version-3.3.3-informational?style=flat-square) ![AppVersion: 3.1.1](https://img.shields.io/badge/AppVersion-3.1.1-informational?style=flat-square)
![Version: 3.3.5](https://img.shields.io/badge/Version-3.3.5-informational?style=flat-square) ![AppVersion: 3.1.1](https://img.shields.io/badge/AppVersion-3.1.1-informational?style=flat-square)

A Helm chart to deploy the New Relic Kubernetes monitoring solution

Expand Down Expand Up @@ -146,6 +146,8 @@ integrations that you have configured.
| ksm | object | See `values.yaml` | Configuration for the Deployment that collects state metrics from KSM (kube-state-metrics). |
| ksm.affinity | object | Deployed in the same node as KSM | Affinity for the control plane DaemonSet. |
| ksm.config.retries | int | `3` | Number of retries after timeout expired |
| ksm.config.scheme | string | `"http"` | the URL scheme cannot be discovered and so you have to specify one |
| ksm.config.selector | string | `"app.kubernetes.io/name=kube-state-metrics"` | pods matching this selector are taken into account during autodiscovery |
| ksm.config.timeout | string | `"10s"` | Timeout for the ksm API contacted by the integration |
| ksm.enabled | bool | `true` | Enable cluster state monitoring. Advanced users only. Setting this to `false` is not supported and will break the New Relic experience. |
| ksm.resources | object | 100m/150M -/850M | Resources for the KSM scraper pod. Keep in mind that sharding is not supported at the moment, so memory usage for this component ramps up quickly on large clusters. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ data:
nri-kubernetes.yml: |-
{{- (merge .Values.common.config (include "newrelic.integrationConfigDefaults" . | fromYaml)) | toYaml | nindent 4 }}
ksm:
{{- /* Notice that new values takes precedence since they have no default and the user need to set them up specifically*/ -}}
{{- mustMergeOverwrite (include "newrelic.compatibility.ksm.legacyData" . | fromYaml) .Values.ksm.config | toYaml | nindent 6 -}}
{{- mustMergeOverwrite .Values.ksm.config (include "newrelic.compatibility.ksm.legacyData" . | fromYaml) | toYaml | nindent 6 -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tests:
asserts:
- hasDocuments:
count: 0

- it: kubeStateMetric config is not created due to ksm.config.enabled and test fails
set:
licenseKey: test
Expand All @@ -22,6 +23,7 @@ tests:
asserts:
- hasDocuments:
count: 0

- it: kubeStateMetricsPort is taken into account since ksm.config.port is not defined
set:
licenseKey: test
Expand All @@ -36,7 +38,10 @@ tests:
enabled: true
port: 22
retries: 3
scheme: http
selector: app.kubernetes.io/name=kube-state-metrics
timeout: 10s
- it: kubeStateMetricsPodLabel is taken into account since ksm.config.label is not defined
set:
licenseKey: test
Expand All @@ -50,8 +55,10 @@ tests:
ksm:
enabled: true
retries: 3
scheme: http
selector: label-name=kube-state-metrics
timeout: 10s
- it: kubeStateMetricsPort is ignored since ksm.config.port is defined
set:
licenseKey: test
Expand All @@ -65,15 +72,18 @@ tests:
interval: 15s
ksm:
enabled: true
port: 25
port: 22
retries: 3
scheme: http
selector: app.kubernetes.io/name=kube-state-metrics
timeout: 10s
- it: a mix of values is passed and the config is rendered correctly
set:
licenseKey: test
cluster: test
ksm.config.staticURL: newURL
ksm.config.scheme: http
ksm.config.scheme: https
ksm.config.selector: a=b
ksm.config.namespace: test
ksm.config.distributed: true
Expand All @@ -90,7 +100,7 @@ tests:
namespace: test
port: 22
retries: 3
scheme: http
scheme: https
selector: a=b
staticURL: newURL
staticURL: test2.io
timeout: 10s
21 changes: 11 additions & 10 deletions charts/newrelic-infrastructure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,17 @@ ksm:
timeout: 10s
# -- Number of retries after timeout expired
retries: 3
# -- if specified autodiscovery is not performed and the specified URL is used
# staticUrl: "http://test.io:8080/metrics"
# -- the URL scheme is not discovered and the specified one is used
# scheme: "http"
# -- the port is not discovered and the specified one is used
# port: 8080
# -- only the pods matching this selector are taken into account during autodiscovery
# selector: "app.kubernetes.io/name=kube-state-metrics"
# -- only the pods matching this namespace taken into account during autodiscovery
# namespace: "ksm-namespace"
# -- if specified autodiscovery is not performed and the specified URL is used
# staticUrl: "http://test.io:8080/metrics"
# -- Label selector that will be used to automatically discover an instance of kube-state-metrics running in the cluster.
selector: "app.kubernetes.io/name=kube-state-metrics"
# -- Scheme to use to connect to kube-state-metrics. Supported values are `http` and `https`.
scheme: "http"
# -- Restrict autodiscovery of the kube-state-metrics endpoint to those using a specific port. If empty or `0`, all endpoints are considered regardless of their port (recommended).
# port: 8080
# -- Restrict autodiscovery of the kube-state-metrics service to a particular namespace.
# @default -- All namespaces are searched (recommended).
# namespace: "ksm-namespace"

# controlPlane -- Configuration for the control plane scraper.
# @default -- See `values.yaml`
Expand Down

0 comments on commit 5313cb2

Please sign in to comment.