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

chart: add -scraper suffix to pod names #429

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion charts/newrelic-infrastructure/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ dependencies:
repository: https://helm-charts.newrelic.com
version: 1.0.4
digest: sha256:6aeb4d18a5b6c9ee130a010b6f71f6af3a003d52d90e17a64ef58e6649e0388f
generated: "2022-05-05T18:29:49.912421427Z"
generated: "2022-05-13T14:57:16.114864693+02:00"
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.6.2
version: 3.7.0
appVersion: 3.3.1

dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- /* Naming helpers*/ -}}
{{- define "nriKubernetes.controlplane.fullname" -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "controlplane") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "controlplane-scraper") -}}
{{- end -}}

{{- define "nriKubernetes.controlplane.fullname.agent" -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "agent-controlplane") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "controlplane-agent") -}}
{{- end -}}
4 changes: 2 additions & 2 deletions charts/newrelic-infrastructure/templates/ksm/_naming.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- /* Naming helpers*/ -}}
{{- define "nriKubernetes.ksm.fullname" -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm-scraper") -}}
{{- end -}}

{{- define "nriKubernetes.ksm.fullname.agent" -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "agent-ksm") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm-agent") -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I would prefer kubelet-node-scraper because the v2 of this integration named these pods as node.

Suggested change
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm-agent") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet-node-scraper") -}}

{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- /* Naming helpers*/ -}}
{{- define "nriKubernetes.kubelet.fullname" -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet-node-scraper") -}}
{{- end -}}

{{- define "nriKubernetes.kubelet.fullname.agent" -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "agent-kubelet") -}}
{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet-node-agent") -}}
{{- end -}}

{{- define "nriKubernetes.kubelet.fullname.integrations" -}}
Expand Down
12 changes: 6 additions & 6 deletions charts/newrelic-infrastructure/tests/podName_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ tests:
asserts:
- equal:
path: metadata.name
value: RELEASE-NAME-nrk8s-ksm
value: RELEASE-NAME-nrk8s-ksm-scraper
template: templates/ksm/deployment.yaml
- equal:
path: metadata.name
value: RELEASE-NAME-nrk8s-controlplane
value: RELEASE-NAME-nrk8s-controlplane-scraper
template: templates/controlplane/daemonset.yaml
- equal:
path: metadata.name
value: RELEASE-NAME-nrk8s-kubelet
value: RELEASE-NAME-nrk8s-kubelet-node-scraper
template: templates/kubelet/daemonset.yaml
- it: name is overridden as expected
set:
Expand All @@ -38,13 +38,13 @@ tests:
asserts:
- equal:
path: metadata.name
value: fno-ksm
value: fno-ksm-scraper
template: templates/ksm/deployment.yaml
- equal:
path: metadata.name
value: fno-controlplane
value: fno-controlplane-scraper
template: templates/controlplane/daemonset.yaml
- equal:
path: metadata.name
value: fno-kubelet
value: fno-kubelet-node-scraper
template: templates/kubelet/daemonset.yaml