Skip to content

Commit b667b8d

Browse files
[nr-k8s-otel-collector] Rendered examples instructions + updates. (#1709)
<!-- 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: Adds instructions for using the rendered yaml files. * Moves the rendered namespace to `newrelic` instead of `default`. * Runs the integration on Pull requests instead of merges to master. + This is necessary since all changes to main needs a 🟢 to be applied. * uses a symbolic link for the values.yaml so we don't have to maintain a separate values.yaml for rendering these files. #### 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 - [ ] Title of the PR starts with chart name (e.g. `[mychartname]`) --------- Co-authored-by: Daniel Budziwojski <[email protected]>
1 parent b7c6114 commit b667b8d

19 files changed

+90
-212
lines changed

.github/workflows/run-makefile.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: Run Makefile
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches-ignore:
6+
- '**master'
7+
- '**main'
78
paths:
89
- 'charts/nr-k8s-otel-collector/**'
910

@@ -13,7 +14,9 @@ jobs:
1314

1415
steps:
1516
- name: Checkout code
16-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1720

1821
- name: Set up Helm
1922
uses: azure/setup-helm@v3

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ generate-examples:
1313
VALUES=$$(find $${EXAMPLES_DIR}/$${example} -name *values.yaml); \
1414
rm -rf "$${EXAMPLES_DIR}/$${example}/rendered"; \
1515
for value in $${VALUES}; do \
16-
helm template example charts/$${chart_name} --namespace default --values $${value} --output-dir "$${EXAMPLES_DIR}/$${example}/rendered"; \
16+
helm template example charts/$${chart_name} --namespace newrelic --set licenseKey='<NR_licenseKey>' --set cluster='<cluser_name>' --values $${value} --output-dir "$${EXAMPLES_DIR}/$${example}/rendered"; \
1717
mv $${EXAMPLES_DIR}/$${example}/rendered/$${chart_name}/templates/* "$${EXAMPLES_DIR}/$${example}/rendered"; \
1818
SUBCHARTS_DIR=$${EXAMPLES_DIR}/$${example}/rendered/$${chart_name}/charts; \
1919
if [ -d "$${SUBCHARTS_DIR}" ]; then \
@@ -39,7 +39,7 @@ check-examples:
3939
for value in $${VALUES}; do \
4040
make install-helm-dependencies -C charts/$${chart_name}; \
4141
helm dependency build charts/$${chart_name}; \
42-
helm template example charts/$${chart_name} --namespace default --values $${value} --output-dir "${TMP_DIRECTORY}/$${example}"; \
42+
helm template example charts/$${chart_name} --namespace newrelic --set licenseKey='<NR_licenseKey>' --set cluster='<cluser_name>' --values $${value} --output-dir "${TMP_DIRECTORY}/$${example}"; \
4343
SUBCHARTS_DIR=${TMP_DIRECTORY}/$${example}/$${chart_name}/charts; \
4444
SUBCHARTS=$$(find $${SUBCHARTS_DIR} -maxdepth 1 -mindepth 1 -type d -exec basename \{\} \;); \
4545
for subchart in $${SUBCHARTS}; do \

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.8.13
20+
version: 0.8.14
2121

2222
dependencies:
2323
- name: common-library

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,41 @@ If using GKE Autopilot, please set the following configuration in your values.ya
6868
gkeAutopilot: true
6969
```
7070

71+
## Helmless installation
72+
In the event that you cannot use helm to install this chart we have provided rendered files for you.
73+
The rendered files can be found under [examples/k8s/rendered](examples/k8s/rendered).
74+
Copy the contents of [examples/k8s/rendered](examples/k8s/rendered) to your local workspace.
75+
There's a couple of values you'll need to plug in first, but after you make some quick edits you'll be able to deploy these K8s files as you normally would.
76+
77+
Update the license key in [secret.yaml](examples/k8s/rendered/secret.yaml).
78+
Ensure that you have encoded your license key in base64
79+
```yaml
80+
data:
81+
licenseKey: <Your Base64 encoded License key>
82+
```
83+
84+
You will also have to manually update your cluster name in [daemonset-configmap.yaml](examples/k8s/rendered/daemonset-configmap.yaml), and [deployment-configmap.yaml](examples/k8s/rendered/deployment-configmap.yaml).
85+
Look for uses of `k8s.cluster.name` and replace `<cluster_name>` with your cluster's name.
86+
```yaml
87+
- key: k8s.cluster.name
88+
action: upsert
89+
value: <cluster_name>
90+
```
91+
92+
After these required fields are updated you can use the yamls to install this project onto your cluster with your preferred method.
93+
94+
### Install the chart with kubectl
95+
```bash
96+
kubectl create namespace newrelic
97+
kubectl apply -n newrelic -R -f rendered
98+
```
99+
100+
### Uninstall the chart with kubectl
101+
```bash
102+
kubectl delete -R -f rendered
103+
kubectl delete namespaces newrelic
104+
```
105+
71106
## Values
72107

73108
| Key | Type | Default | Description |

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.0.3
12-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
12+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
1313
rules:
1414
- apiGroups:
1515
- ""

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ metadata:
99
app.kubernetes.io/managed-by: Helm
1010
app.kubernetes.io/name: nr-k8s-otel-collector
1111
app.kubernetes.io/version: 1.0.3
12-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
12+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
1313
subjects:
1414
- kind: ServiceAccount
1515
name: example-nr-k8s-otel-collector
16-
namespace: default
16+
namespace: newrelic
1717
roleRef:
1818
kind: ClusterRole
1919
name: example-nr-k8s-otel-collector

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
# Source: nr-k8s-otel-collector/templates/daemonset-configmap.yaml
3-
apiVersion: v1
3+
apiVersion: v1
44
kind: ConfigMap
55
metadata:
66
name: example-nr-k8s-otel-collector-daemonset-config
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
app.kubernetes.io/instance: example
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.0.3
13-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
13+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
1414
data:
1515
daemonset-config.yaml: |
1616
receivers:
@@ -459,13 +459,13 @@ data:
459459
# We set the cluster name to what the customer specified in the helm chart
460460
- key: k8s.cluster.name
461461
action: upsert
462-
value: DEMO_CLUSTER
462+
value: <cluser_name>
463463
- key: newrelicOnly
464464
action: upsert
465465
value: 'true'
466466
- key: "newrelic.chart.version"
467467
action: upsert
468-
value: 0.8.9
468+
value: 0.8.12
469469
- key: service.name
470470
action: delete
471471
- key: service_name
@@ -590,7 +590,7 @@ data:
590590
- k8s.node.name
591591
- k8s.pod.start_time
592592
pod_association:
593-
- sources:
593+
- sources:
594594
- from: resource_attribute
595595
name: k8s.pod.uid
596596
@@ -624,6 +624,7 @@ data:
624624
- kubeletstats
625625
- prometheus
626626
processors:
627+
- memory_limiter
627628
- metricstransform/ldm
628629
- metricstransform/kubeletstats
629630
- metricstransform/cadvisor
@@ -648,7 +649,6 @@ data:
648649
- resource/low_data_mode_inator
649650
- attributes/self
650651
- k8sattributes
651-
- memory_limiter
652652
- cumulativetodelta
653653
- batch
654654
exporters:
@@ -657,6 +657,7 @@ data:
657657
receivers:
658658
- filelog
659659
processors:
660+
- memory_limiter
660661
- transform/truncate
661662
- resource
662663
- k8sattributes

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ apiVersion: apps/v1
44
kind: DaemonSet
55
metadata:
66
name: example-nr-k8s-otel-collector-daemonset
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
app.kubernetes.io/instance: example
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.0.3
13-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
14-
spec:
13+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
14+
spec:
1515
selector:
1616
matchLabels:
1717
app.kubernetes.io/instance: example
@@ -24,31 +24,31 @@ spec:
2424
app.kubernetes.io/name: nr-k8s-otel-collector
2525
component: daemonset
2626
annotations:
27-
checksum/config: e8edfd79b4ef3661b44f3399f42c6b8374dbce6c016e11b36109b094cad39457
27+
checksum/config: 8046db691ebcb15a77d39e8fb1898aedc4b122c7a1fb4d8c464202fae6ac12a7
2828
spec:
2929
serviceAccountName: example-nr-k8s-otel-collector
3030
containers:
3131
- name: otel-collector-daemonset
3232
securityContext:
3333
privileged: true
34-
image: "newrelic/nr-otel-collector:0.8.3"
34+
image: "newrelic/nrdot-collector-k8s:1.0.3"
3535
imagePullPolicy: IfNotPresent
3636
args: ["--config", "/config/daemonset-config.yaml", "--feature-gates","receiver.kubeletstats.enableCPUUsageMetrics"]
3737
resources:
3838
{}
3939
env:
4040
- name: HOST_IP
41-
valueFrom:
41+
valueFrom:
4242
fieldRef:
43-
fieldPath: status.hostIP
44-
- name: OTEL_EXPORTER_OTLP_ENDPOINT
43+
fieldPath: status.hostIP
44+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
4545
value: "http://$(HOST_IP):55680"
4646
- name: POD_NAME
4747
valueFrom:
4848
fieldRef:
4949
fieldPath: metadata.name
5050
- name: POD_UID
51-
valueFrom:
51+
valueFrom:
5252
fieldRef:
5353
fieldPath: metadata.uid
5454
- name: KUBE_NODE_NAME

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ apiVersion: v1
44
kind: ConfigMap
55
metadata:
66
name: example-nr-k8s-otel-collector-deployment-config
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
app.kubernetes.io/instance: example
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.0.3
13-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
13+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
1414
data:
1515
deployment-config.yaml: |
1616
receivers:
@@ -383,13 +383,13 @@ data:
383383
# We set the cluster name to what the customer specified in the helm chart
384384
- key: k8s.cluster.name
385385
action: upsert
386-
value: DEMO_CLUSTER
386+
value: <cluser_name>
387387
- key: newrelicOnly
388388
action: upsert
389389
value: 'true'
390390
- key: "newrelic.chart.version"
391391
action: upsert
392-
value: 0.8.9
392+
value: 0.8.12
393393
- key: service.name
394394
action: delete
395395
- key: service_name
@@ -408,13 +408,13 @@ data:
408408
value: "kubernetes"
409409
- key: k8s.cluster.name
410410
action: upsert
411-
value: DEMO_CLUSTER
411+
value: <cluser_name>
412412
- key: newrelicOnly
413413
action: upsert
414414
value: 'true'
415415
- key: "newrelic.chart.version"
416416
action: upsert
417-
value: 0.8.9
417+
value: 0.8.12
418418
419419
transform/events:
420420
log_statements:
@@ -568,6 +568,7 @@ data:
568568
receivers:
569569
- prometheus/ksm
570570
processors:
571+
- memory_limiter
571572
- metricstransform/kube_pod_status_phase
572573
- filter/exclude_zero_value_kube_node_status_condition
573574
- filter/exclude_zero_value_kube_persistentvolumeclaim_status_phase
@@ -590,6 +591,7 @@ data:
590591
receivers:
591592
- prometheus/controlplane
592593
processors:
594+
- memory_limiter
593595
- metricstransform/k8s_cluster_info
594596
- metricstransform/ldm
595597
- metricstransform/k8s_cluster_info_ldm
@@ -600,7 +602,6 @@ data:
600602
- resource/metrics
601603
- attributes/self
602604
- k8sattributes
603-
- memory_limiter
604605
- cumulativetodelta
605606
- batch
606607
exporters:
@@ -609,6 +610,7 @@ data:
609610
receivers:
610611
- k8s_events
611612
processors:
613+
- memory_limiter
612614
- transform/events
613615
- resource/events
614616
- batch

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ apiVersion: apps/v1
44
kind: Deployment
55
metadata:
66
name: example-nr-k8s-otel-collector-deployment
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
app.kubernetes.io/instance: example
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.0.3
13-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
13+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
1414
spec:
1515
replicas: 1
1616
minReadySeconds: 5
@@ -26,12 +26,12 @@ spec:
2626
app.kubernetes.io/name: nr-k8s-otel-collector
2727
component: deployment
2828
annotations:
29-
checksum/config: d53bb22046dc8c2ef5d0d9cb9fff42ce6cea0f69df0ab5a5e4200b5bff6b95cd
29+
checksum/config: fa5ac66a7144336872fe12ab075a6c8ab3f8ef2bcf17e37d1c82f71c48b47a92
3030
spec:
3131
serviceAccountName: example-nr-k8s-otel-collector
3232
containers:
3333
- name: otel-collector-deployment
34-
image: "newrelic/nr-otel-collector:0.8.3"
34+
image: "newrelic/nrdot-collector-k8s:1.0.3"
3535
imagePullPolicy: IfNotPresent
3636
args: ["--config", "/config/deployment-config.yaml"]
3737
resources:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ roleRef:
1919
subjects:
2020
- kind: ServiceAccount
2121
name: example-kube-state-metrics
22-
namespace: default
22+
namespace: newrelic

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: apps/v1
44
kind: Deployment
55
metadata:
66
name: example-kube-state-metrics
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
helm.sh/chart: kube-state-metrics-5.18.0
1010
app.kubernetes.io/managed-by: Helm

charts/nr-k8s-otel-collector/examples/k8s/rendered/kube-state-metrics/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apiVersion: v1
44
kind: Service
55
metadata:
66
name: example-kube-state-metrics
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
helm.sh/chart: kube-state-metrics-5.18.0
1010
app.kubernetes.io/managed-by: Helm

charts/nr-k8s-otel-collector/examples/k8s/rendered/kube-state-metrics/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ metadata:
1212
app.kubernetes.io/instance: example
1313
app.kubernetes.io/version: "2.11.0"
1414
name: example-kube-state-metrics
15-
namespace: default
15+
namespace: newrelic

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ apiVersion: v1
44
kind: Secret
55
metadata:
66
name: example-nr-k8s-otel-collector-license
7-
namespace: default
7+
namespace: newrelic
88
labels:
99
app.kubernetes.io/instance: example
1010
app.kubernetes.io/managed-by: Helm
1111
app.kubernetes.io/name: nr-k8s-otel-collector
1212
app.kubernetes.io/version: 1.0.3
13-
helm.sh/chart: nr-k8s-otel-collector-0.8.9
13+
helm.sh/chart: nr-k8s-otel-collector-0.8.12
1414
data:
15-
licenseKey: REVNT19MSUNFTlNFX0tFWQ==
15+
licenseKey: PE5SX2xpY2Vuc2VLZXk+

0 commit comments

Comments
 (0)