Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NatsBoxReconciler ¶
NatsBoxReconciler reconciles a NatsBox object.
func (*NatsBoxReconciler) Reconcile ¶
Reconcile fetches the NatsBox, applies controller-side defaults, builds the rendered contexts Secret + Deployment, and server-side-applies them. Status is patched from the live Deployment's replica counts.
func (*NatsBoxReconciler) SetupWithManager ¶
func (r *NatsBoxReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the controller and declares Owns on the Deployment and the contexts Secret so changes trigger reconcile.
type NatsClusterReconciler ¶
type NatsClusterReconciler struct {
client.Client
Scheme *runtime.Scheme
// EnableNackIntegration controls whether the reconciler creates NACK
// `jetstream.nats.io/v1beta2` Account CRs for auth.jwt.accounts[]
// entries with userCreds set, and whether SetupWithManager registers
// an Owns watch on NACK Account. When false, the integration is fully
// skipped — the condition is not stamped, the watch is not registered,
// and the operator does not touch the NACK API group at all. Resolved
// from the --nack-integration flag in main.go (auto / enabled / disabled).
EnableNackIntegration bool
}
NatsClusterReconciler reconciles a NatsCluster object.
func (*NatsClusterReconciler) Reconcile ¶
func (r *NatsClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is the main reconcile loop. It fetches the NatsCluster, applies controller-side defaults, builds every owned resource from the defaulted spec, and server-side-applies them. Status is then patched from the live StatefulSet's replica counts.
func (*NatsClusterReconciler) SetupWithManager ¶
func (r *NatsClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the controller to the manager and declares the owned resource types so changes to them trigger reconciles for the parent NatsCluster. PodMonitor is intentionally not in the Owns list — the operator owns it via SSA but doesn't need to react to its events.
The NACK Account ownership is only registered when EnableNackIntegration is true. controller-runtime's informer does NOT tolerate missing CRDs gracefully: a missing kind floods the operator logs with "no matches for kind" errors on every polling interval. The --nack-integration flag in main.go auto-detects the CRD at startup (or lets the user force the mode), and the reconciler only calls Owns() here when the integration is actually supposed to run.
Source Files
¶
- build_auth_secret.go
- build_client_service.go
- build_configmap.go
- build_headless_service.go
- build_ingress.go
- build_nack_account.go
- build_natsbox_deployment.go
- build_natsbox_secret.go
- build_pdb.go
- build_podmonitor.go
- build_serviceaccount.go
- build_statefulset.go
- defaults.go
- labels.go
- naming.go
- natsbox_controller.go
- natsbox_helpers.go
- natscluster_controller.go
- natsconf.go
- ssa.go