Skip to content

Remove NACK Consumer k8s resource and update to LastPerSubject delivery#15

Merged
emsearcy merged 2 commits intomainfrom
feature/update-nack-consumer-config
Dec 4, 2025
Merged

Remove NACK Consumer k8s resource and update to LastPerSubject delivery#15
emsearcy merged 2 commits intomainfrom
feature/update-nack-consumer-config

Conversation

@emsearcy
Copy link
Contributor

@emsearcy emsearcy commented Dec 4, 2025

Summary

Addresses LFXV2-868: Remove the NACK Consumer configuration from k8s/helm and let it be created by the service on startup when missing so that we can create it in LastPerSubject mode.

Changes Made

  • Removed k8s/helm resource: Deleted charts/lfx-v1-sync-helper/templates/nats-consumer.yaml
  • Updated resource configuration in main.go: Modified consumer creation code to use LastPerSubjectPolicy instead of DeliverAllPolicy
  • Upgraded helm chart version: Bumped from 0.3.3 to 0.3.4
  • Removed consumer configuration: Cleaned up values.yaml by removing the entire nats.consumer section

Technical Details

  • The Consumer resource will now be created programmatically by the service on startup using CreateOrUpdateConsumer()
  • Changed from DeliverAllPolicy to DeliverLastPerSubjectPolicy to improve message delivery efficiency
  • Removed all NACK-based consumer configuration since it will be managed entirely by the application code

Testing

  • ✅ Go code compiles successfully
  • ✅ Helm chart templates validate without errors

Post-Merge Steps

After merging and releasing:

  1. Deploy the updated service
  2. Manually delete the Consumer resource from NATS if it is not deleted when the k8s resource is deleted
  3. Restart the service to recreate the resource with the new LastPerSubject mode

Related to: LFXV2-868

- Remove k8s/helm Consumer resource template and configuration
- Update main.go consumer creation to use LastPerSubject deliver policy
- Upgrade helm chart version to 0.3.4
- Consumer will now be created by service on startup when missing

🤖 Generated with [GitHub Copilot](https://github.com/features/copilot) (via Zed)

Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
Copilot AI review requested due to automatic review settings December 4, 2025 18:25
@emsearcy emsearcy requested a review from a team as a code owner December 4, 2025 18:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates NATS consumer management from Kubernetes/Helm declarative resources to programmatic creation in application code, enabling the use of DeliverLastPerSubjectPolicy for more efficient KV bucket message processing.

  • Removes Kubernetes-managed NATS consumer resource and transitions to application-managed consumer creation
  • Updates consumer delivery policy from DeliverAllPolicy to DeliverLastPerSubjectPolicy for improved efficiency with KV workloads
  • Bumps Helm chart version to 0.3.4

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
v1-sync-helper/main.go Updated consumer configuration to use DeliverLastPerSubjectPolicy and removed commented code
charts/lfx-v1-sync-helper/values.yaml Removed nats.consumer configuration section (lines 103-130)
charts/lfx-v1-sync-helper/templates/nats-consumer.yaml Deleted entire Kubernetes Consumer resource template
charts/lfx-v1-sync-helper/Chart.yaml Bumped chart version from 0.3.3 to 0.3.4

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Helps `nats consumer ls` fit in a smaller terminal window without
truncating stats.

Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
@emsearcy emsearcy force-pushed the feature/update-nack-consumer-config branch from 7e4b82a to 0e115c3 Compare December 4, 2025 18:34
@emsearcy
Copy link
Contributor Author

emsearcy commented Dec 4, 2025

force-pushed due to missing signoff

@emsearcy emsearcy merged commit 6dadc76 into main Dec 4, 2025
3 checks passed
@emsearcy emsearcy deleted the feature/update-nack-consumer-config branch December 4, 2025 18:38
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.

3 participants