cozystack/packages/apps/nats
Andrei Kvapil 2e61810547
refactor: replace Helm lookup with valuesFrom mechanism
Replace Helm lookup functions with FluxCD valuesFrom mechanism for
reading cluster and namespace configuration.

Changes:
- Create Secret cozystack-values in each namespace with values.yaml key
  containing _cluster and _namespace configuration as nested YAML
- Configure HelmReleases to read from this Secret via valuesFrom
  (valuesKey defaults to values.yaml, so it can be omitted)
- Update cozy-lib helpers to access config via .Values._cluster
- Add default values for required _cluster keys to ensure all fields exist
- Update Go code (cozystack-api and helm reconciler) to use new format

This eliminates the need for Helm lookup functions while maintaining
the same configuration interface for charts.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-01-05 16:10:55 +01:00
..
charts Use library chart for resource management 2025-06-04 09:05:21 +03:00
logos Update dashboard icons (#274) 2024-08-12 14:47:11 +02:00
templates refactor: replace Helm lookup with valuesFrom mechanism 2026-01-05 16:10:55 +01:00
.helmignore Add NATS (#224) 2024-07-22 23:31:56 +02:00
Chart.yaml Remove versions_map logic 2025-09-24 12:32:37 +02:00
Makefile [cozystack-api] Implement TenantNamespace, TenantModules, TenantSecret and TenantSecretsTable resources 2025-09-24 18:27:54 +02:00
README.md [dx] JSDoc compatible syntax for values.yaml 2025-10-29 08:57:26 +05:00
values.schema.json [dx] JSDoc compatible syntax for values.yaml 2025-10-29 08:57:26 +05:00
values.yaml [dx] JSDoc compatible syntax for values.yaml 2025-10-29 08:57:26 +05:00

Managed NATS Service

NATS is an open-source, simple, secure, and high performance messaging system. It provides a data layer for cloud native applications, IoT messaging, and microservices architectures.

Parameters

Common parameters

Name Description Type Value
replicas Number of replicas. int 2
resources Explicit CPU and memory configuration for each NATS replica. When omitted, the preset defined in resourcesPreset is applied. object {}
resources.cpu CPU available to each replica. quantity ""
resources.memory Memory (RAM) available to each replica. quantity ""
resourcesPreset Default sizing preset used when resources is omitted. string nano
storageClass StorageClass used to store the data. string ""
external Enable external access from outside the cluster. bool false

Application-specific parameters

Name Description Type Value
users Users configuration map. map[string]object {}
users[name].password Password for the user. string ""
jetstream Jetstream configuration. object {}
jetstream.enabled Enable or disable Jetstream for persistent messaging in NATS. bool true
jetstream.size Jetstream persistent storage size. quantity 10Gi
config NATS configuration. object {}
config.merge Additional configuration to merge into NATS config. *object {}
config.resolver Additional resolver configuration to merge into NATS config. *object {}

Parameter examples and reference

resources and resourcesPreset

resources sets explicit CPU and memory configurations for each replica. When left empty, the preset defined in resourcesPreset is applied.

resources:
  cpu: 4000m
  memory: 4Gi

resourcesPreset sets named CPU and memory configurations for each replica. This setting is ignored if the corresponding resources value is set.

Preset name CPU memory
nano 250m 128Mi
micro 500m 256Mi
small 1 512Mi
medium 1 1Gi
large 2 2Gi
xlarge 4 4Gi
2xlarge 8 8Gi