diff --git a/charts/newrelic-infrastructure/Chart.yaml b/charts/newrelic-infrastructure/Chart.yaml index d8d1ff4db..9aaaeff03 100644 --- a/charts/newrelic-infrastructure/Chart.yaml +++ b/charts/newrelic-infrastructure/Chart.yaml @@ -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: diff --git a/charts/newrelic-infrastructure/README.md b/charts/newrelic-infrastructure/README.md index 1aa1d72b8..3f6536e6f 100644 --- a/charts/newrelic-infrastructure/README.md +++ b/charts/newrelic-infrastructure/README.md @@ -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 @@ -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. | diff --git a/charts/newrelic-infrastructure/templates/ksm/scraper-configmap.yaml b/charts/newrelic-infrastructure/templates/ksm/scraper-configmap.yaml index a2f48a3a5..3314df9c7 100644 --- a/charts/newrelic-infrastructure/templates/ksm/scraper-configmap.yaml +++ b/charts/newrelic-infrastructure/templates/ksm/scraper-configmap.yaml @@ -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 -}} diff --git a/charts/newrelic-infrastructure/tests/configmap_ksm_scraper_test.yaml b/charts/newrelic-infrastructure/tests/configmap_ksm_scraper_test.yaml index bb4dc7b4e..224eda5ee 100644 --- a/charts/newrelic-infrastructure/tests/configmap_ksm_scraper_test.yaml +++ b/charts/newrelic-infrastructure/tests/configmap_ksm_scraper_test.yaml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/charts/newrelic-infrastructure/values.yaml b/charts/newrelic-infrastructure/values.yaml index db412db6a..ddd554d4b 100644 --- a/charts/newrelic-infrastructure/values.yaml +++ b/charts/newrelic-infrastructure/values.yaml @@ -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`