fix(vpcd): create IMDS subnet-veth KV bucket at 1 replica

InitBuckets was passed the OVN chassis count as the replica factor. When the
chassis count exceeds the NATS node count (single-node bare-metal: 1 node but
2 SBDB chassis), CreateKeyValue requested more replicas than JetStream could
satisfy, the create-or-open fallback returned "bucket not found", and vpcd
crash-looped — cascading to RunInstances ServerInternal. Create at 1 replica
like STS/IAM; the daemon's deferred upgradeJetStreamReplicas raises all KV_*
streams to cluster size when the cluster grows.
This commit is contained in:
joshsiv-mulga
2026-06-06 22:11:53 +10:00
parent 5aaf8c23d2
commit 92384cf7a7
+7 -4
View File
@@ -525,10 +525,13 @@ func launchService(cfg *Config) error {
return fmt.Errorf("get JetStream context: %w", err)
}
// IMDS per-subnet localport installer. Replicas track the chassis count so
// the subnet-veth bucket survives a node loss (create-or-open: awsgw inits the
// same bucket; first writer wins).
imdsVethKV, _, err := handlers_imds.InitBuckets(js, max(len(chassisNames), 1))
// IMDS per-subnet localport installer. Create the KV bucket at a single
// replica; the daemon's deferred upgradeJetStreamReplicas bumps all KV_*
// streams to the cluster size once the cluster is ready. Using the chassis
// count here requested more replicas than a single-node JetStream could
// satisfy (chassis count can exceed NATS node count), failing the create
// with "bucket not found".
imdsVethKV, _, err := handlers_imds.InitBuckets(js, 1)
if err != nil {
return fmt.Errorf("init imds buckets: %w", err)
}