Skip to content

Commit ab9907e

Browse files
[nr-k8s-otel-collector] Adding registry and imagePullSecrets configuration (#2000)
<!-- Thank you for contributing to New Relic's Helm charts. Before you submit this PR we'd like to make sure you are aware of our technical requirements: * https://github.com/newrelic-experimental/helm-charts/blob/master/CONTRIBUTING.md#technical-requirements For a quick overview across what we will look at reviewing your PR, please read our review guidelines: * https://github.com/newrelic-experimental/helm-charts/blob/master/REVIEW_GUIDELINES.md Following our best practices right from the start will accelerate the review process and help get your PR merged quicker. When updates to your PR are requested, please add new commits and do not squash the history. This will make it easier to identify new changes. The PR will be squashed anyways when it is merged. Thanks. For fast feedback, please @-mention maintainers that are listed in the Chart.yaml file. Please make sure you test your changes before you push them. Once pushed, a Github Action will run across your changes and do some initial checks and linting. These checks run very quickly. Please check the results. We would like these checks to pass before we even continue reviewing your changes. --> #### Is this a new chart No #### What this PR does / why we need it: Adding image configuration based on the `nri-bundle` chart to use the same standard (https://github.com/newrelic/helm-charts/blob/master/charts/nri-bundle/values.yaml#L100). With the recent addition of the `kubectl` image we needed to be able to configure the registry of images as mandated within our organisation. This is making use of the NewRelic Common library to achieve this. This will be a breaking change for people configuring their image repository using the `image` section of the current chart (replaced by `images` section in this PR). Added imagePullSecrets support for authenticated registries as well. #### Which issue this PR fixes *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)* - fixes # #### Special notes for your reviewer: #### Checklist [Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] - [x] Chart Version bumped - [x] Variables are documented in the README.md - [x] Title of the PR starts with chart name (e.g. `[mychartname]`) # Release Notes to Publish (nr-k8s-otel-collector) If this PR contains changes in `nr-k8s-otel-collector`, please complete the following section. All other charts should ignore this section. <!--BEGIN-RELEASE-NOTES--> ## 🚨 Upcoming Breaking Changes * Removed `image` configuration in favor of `images` section. The following config is deprecated and will be removed in a future release. * 'image.repository' has been replaced with 'images.collector.repository'. * 'image.tag' has been replaced with 'images.collector.tag'. * 'image.pullPolicy' has been replaced with 'images.collector.pullPolicy'. ## 🚀 What's Changed * Added images configuration with registry support for both `collector` and `kubectl` images via `images` configuration. * Added imagePullSecrets support for authenticated registries. <!--END-RELEASE-NOTES--> --------- Co-authored-by: Daniel Budziwojski <[email protected]>
1 parent 433d5c3 commit ab9907e

19 files changed

+244
-38
lines changed

charts/nr-k8s-otel-collector/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type: application
1717
# This is the chart version. This version number should be incremented each time you make changes
1818
# to the chart and its templates, including the app version.
1919
# Versions are expected to follow Semantic Versioning (https://semver.org/)
20-
version: 0.9.6
20+
version: 0.9.7
2121

2222

2323
dependencies:

charts/nr-k8s-otel-collector/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,10 @@ to export data to this connector which can then be connected to the New Relic ma
161161
| deployment.tolerations | list | `[]` | Sets deployment pod tolerations. Overrides `tolerations` and `global.tolerations` |
162162
| dnsConfig | object | `{}` | Sets pod's dnsConfig. Can be configured also with `global.dnsConfig` |
163163
| exporters | string | `nil` | Define custom exporters here. See: https://opentelemetry.io/docs/collector/configuration/#exporters |
164-
| image.pullPolicy | string | `"IfNotPresent"` | The pull policy is defaulted to IfNotPresent, which skips pulling an image if it already exists. If pullPolicy is defined without a specific value, it is also set to Always. |
165-
| image.repository | string | `"newrelic/nrdot-collector-k8s"` | OTel collector image to be deployed. You can use your own collector as long it accomplish the following requirements mentioned below. |
166-
| image.tag | string | `"1.5.0"` | Overrides the image tag whose default is the chart appVersion. |
164+
| images | object | `{"collector":{"pullPolicy":"IfNotPresent","registry":"","repository":"newrelic/nrdot-collector-k8s","tag":"1.5.0"},"kubectl":{"pullPolicy":"IfNotPresent","registry":"","repository":"bitnami/kubectl","tag":"latest"},"pullSecrets":[]}` | Images used by the chart. |
165+
| images.collector | object | `{"pullPolicy":"IfNotPresent","registry":"","repository":"newrelic/nrdot-collector-k8s","tag":"1.5.0"}` | Image for the OpenTelemetry Collector. |
166+
| images.kubectl | object | `{"pullPolicy":"IfNotPresent","registry":"","repository":"bitnami/kubectl","tag":"latest"}` | Image for the initContainer that retrieves node allocatable resources. |
167+
| images.pullSecrets | list | `[]` | The secrets that are needed to pull images from a custom registry. |
167168
| kube-state-metrics.enableResourceQuotaSamples | bool | `false` | Enable resource quota data exporting |
168169
| kube-state-metrics.enabled | bool | `true` | Install the [`kube-state-metrics` chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics) from the stable helm charts repository. This is mandatory if `infrastructure.enabled` is set to `true` and the user does not provide its own instance of KSM version >=1.8 and <=2.0. Note, kube-state-metrics v2+ disables labels/annotations metrics by default. You can enable the target labels/annotations metrics to be monitored by using the metricLabelsAllowlist/metricAnnotationsAllowList options described [here](https://github.com/prometheus-community/helm-charts/blob/159cd8e4fb89b8b107dcc100287504bb91bf30e0/charts/kube-state-metrics/values.yaml#L274) in your Kubernetes clusters. |
169170
| kube-state-metrics.metricAnnotationsAllowList | list | `["pods=[*]", "namespaces=[*]", "deployments=[*]"]` | List of Kubernetes annotation keys that will be used in the resources' annotations metric. By default, kube-state-metrics v2+ does not expose annotations as metric labels. This option allows you to specify which annotations should be exposed as metric dimensions. Each entry is formatted as "resource=[annotation1,annotation2,...]". Use "*" to include all annotations for a resource type. Example: ["pods=[description,owner]", "namespaces=[description]", "deployments=[change-id,jira-ticket]"] |

charts/nr-k8s-otel-collector/collector.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,5 +395,3 @@ EU
395395
headers:
396396
api-key: <<NR api key>
397397
```
398-
399-

charts/nr-k8s-otel-collector/examples/k8s/rendered/clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app.kubernetes.io/managed-by: Helm
1010
app.kubernetes.io/name: nr-k8s-otel-collector
1111
app.kubernetes.io/version: 1.2.0
12-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
12+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1313
rules:
1414
- apiGroups:
1515
- ""

charts/nr-k8s-otel-collector/examples/k8s/rendered/clusterrolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
app.kubernetes.io/managed-by: Helm
1010
app.kubernetes.io/name: nr-k8s-otel-collector
1111
app.kubernetes.io/version: 1.2.0
12-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
12+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1313
subjects:
1414
- kind: ServiceAccount
1515
name: nr-k8s-otel-collector

charts/nr-k8s-otel-collector/examples/k8s/rendered/daemonset-configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.2.0
13-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
13+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1414
data:
1515
daemonset-config.yaml: |
1616
receivers:
@@ -605,7 +605,7 @@ data:
605605
value: <cluser_name>
606606
- key: "newrelic.chart.version"
607607
action: upsert
608-
value: 0.9.6
608+
value: 0.9.7
609609
- key: newrelic.entity.type
610610
action: upsert
611611
value: "k8s"

charts/nr-k8s-otel-collector/examples/k8s/rendered/daemonset.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.2.0
13-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
13+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1414
spec:
1515
selector:
1616
matchLabels:
@@ -24,12 +24,13 @@ spec:
2424
app.kubernetes.io/name: nr-k8s-otel-collector
2525
component: daemonset
2626
annotations:
27-
checksum/config: 6c393dbeeeb8b55c3da8659d412cfe48444e0047f0988787e14afd0292e00dc4
27+
checksum/config: dddebd4fdd4de1850611c50ea1e781a30c5fe67156ef3d602cc64f03501a01d1
2828
spec:
2929
serviceAccountName: nr-k8s-otel-collector
3030
initContainers:
3131
- name: get-cpu-allocatable
32-
image: bitnami/kubectl:latest
32+
image: "bitnami/kubectl:latest"
33+
imagePullPolicy: IfNotPresent
3334
command:
3435
- sh
3536
- -c

charts/nr-k8s-otel-collector/examples/k8s/rendered/deployment-configmap.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.2.0
13-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
13+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1414
data:
1515
deployment-config.yaml: |
1616
receivers:
@@ -516,7 +516,7 @@ data:
516516
value: <cluser_name>
517517
- key: "newrelic.chart.version"
518518
action: upsert
519-
value: 0.9.6
519+
value: 0.9.7
520520
- key: newrelic.entity.type
521521
action: upsert
522522
value: "k8s"
@@ -534,7 +534,7 @@ data:
534534
value: <cluser_name>
535535
- key: "newrelic.chart.version"
536536
action: upsert
537-
value: 0.9.6
537+
value: 0.9.7
538538
539539
transform/events:
540540
log_statements:

charts/nr-k8s-otel-collector/examples/k8s/rendered/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.2.0
13-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
13+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1414
spec:
1515
replicas: 1
1616
minReadySeconds: 5
@@ -26,7 +26,7 @@ spec:
2626
app.kubernetes.io/name: nr-k8s-otel-collector
2727
component: deployment
2828
annotations:
29-
checksum/config: ca6b21baf629a91df39d33fe47590c1664987620a0efb9c0f2c797c8a3fb5dd1
29+
checksum/config: 23c604532ee14493c0650bc5467c280096f3d3caec1c54961821e7728422ba9e
3030
spec:
3131
serviceAccountName: nr-k8s-otel-collector
3232
containers:

charts/nr-k8s-otel-collector/examples/k8s/rendered/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ metadata:
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.2.0
13-
helm.sh/chart: nr-k8s-otel-collector-0.9.6
13+
helm.sh/chart: nr-k8s-otel-collector-0.9.7
1414
data:
1515
licenseKey: PE5SX2xpY2Vuc2VLZXk+

0 commit comments

Comments
 (0)