Skip to content

feat: Add NodeExporter CRD controller for operator-managed node-exporter#363

Open
miconeilaws wants to merge 2 commits intomainfrom
feat/node-exporter-crd
Open

feat: Add NodeExporter CRD controller for operator-managed node-exporter#363
miconeilaws wants to merge 2 commits intomainfrom
feat/node-exporter-crd

Conversation

@miconeilaws
Copy link
Copy Markdown
Collaborator

Add a NodeExporter custom resource to the CloudWatch Agent Operator, following the exact DCGM/Neuron pattern. The operator reconciles NodeExporter CR instances into DaemonSet, ServiceAccount, ConfigMap, and Service Kubernetes objects.

Changes:

  • New CRD type: apis/v1alpha1/nodeexporter_types.go
  • New controller: controllers/nodeexporter_controller.go
  • New manifest builders: internal/manifests/nodeexporter/ (8 files)
  • New status handler: internal/status/nodeexporter/ (2 files)
  • Config/Version/Params integration for node-exporter image
  • Conditional controller registration (CRD existence check) for backwards compatibility with old Helm charts
  • Unit tests for all manifest builders (6 test files)

The controller registration is gated by a CRD existence check at startup, so the operator works correctly with older Helm charts that don't ship the NodeExporter CRD.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Add a NodeExporter custom resource to the CloudWatch Agent Operator,
following the exact DCGM/Neuron pattern. The operator reconciles
NodeExporter CR instances into DaemonSet, ServiceAccount, ConfigMap,
and Service Kubernetes objects.

Changes:
- New CRD type: apis/v1alpha1/nodeexporter_types.go
- New controller: controllers/nodeexporter_controller.go
- New manifest builders: internal/manifests/nodeexporter/ (8 files)
- New status handler: internal/status/nodeexporter/ (2 files)
- Config/Version/Params integration for node-exporter image
- Conditional controller registration (CRD existence check) for
  backwards compatibility with old Helm charts
- Unit tests for all manifest builders (6 test files)

The controller registration is gated by a CRD existence check at
startup, so the operator works correctly with older Helm charts that
don't ship the NodeExporter CRD.
- Fix in-place mutation of NodeExporter.Spec.Args map in container.go
- Remove broken scale subresource marker (.spec.replicas does not exist)
- Remove managementState printcolumn (.spec.managementState does not exist)
- Reuse rest config instead of calling GetConfigOrDie twice in main.go
- Remove stale 'daemonset, statefulset, and deployment mode' comments
- Simplify container args: remove redundant intermediate variable
- Fix Yoda condition in annotations.go
- Fix incorrect TypeMeta in configmap_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant