metropolis: implement cluster configuration
This adds a cluster configuration to Metropolis. We'll be keeping any
non-node-specific options there. The config is stored in etcd by the
curator.
An initial cluster configuration can be specified when bootstrapping a
cluster. By design the configuration is then immutable by default, but
we might add some purpose-specific management API calls to change some
values if needed.
We initialize the cluster configuration with a setting for node TPM
policy, 'TPMMode'. It's currently populated on cluster bootstrap, but
not used otherwise. That will come in a follow-up CR.
Change-Id: I44ddcd099c9ae68c20519c77e3fa77c894cf5a20
Reviewed-on: https://review.monogon.dev/c/monogon/+/1494
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/node/core/main.go b/metropolis/node/core/main.go
index a9bdc98..08eb39a 100644
--- a/metropolis/node/core/main.go
+++ b/metropolis/node/core/main.go
@@ -103,8 +103,10 @@
logger.Info("Starting Metropolis node init")
+ haveTPM := true
if err := tpm.Initialize(logger); err != nil {
- logger.Warningf("Failed to initialize TPM 2.0, attempting fallback to untrusted: %v", err)
+ logger.Warningf("Failed to initialize TPM 2.0: %v", err)
+ haveTPM = false
}
networkSvc := network.New(nil)
@@ -184,7 +186,7 @@
// Start cluster manager. This kicks off cluster membership machinery,
// which will either start a new cluster, enroll into one or join one.
- m := cluster.NewManager(root, networkSvc, rs, nodeParams)
+ m := cluster.NewManager(root, networkSvc, rs, nodeParams, haveTPM)
return m.Run(ctx)
}