blob: e7fc38c18caeb612b37484323f0866e6b8d49c2b [file] [log] [blame]
Serge Bazanski0ed2f962021-03-15 16:39:30 +01001// Copyright 2020 The Monogon Project Authors.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17syntax = "proto3";
18package metropolis.proto.api;
19option go_package = "source.monogon.dev/metropolis/proto/api";
20
Serge Bazanski516d3002021-10-01 00:05:41 +020021import "metropolis/proto/common/common.proto";
Tim Windelschmidt10ef8f92024-08-13 15:35:10 +020022import "osbase/net/proto/net.proto";
Serge Bazanski516d3002021-10-01 00:05:41 +020023
Serge Bazanski0ed2f962021-03-15 16:39:30 +010024// NodeParameters is the data with which a Node is set booted. It contains the
25// configuration required for a node to either bootstrap a new cluster, or
26// register into an existing one.
27// It is serialized into a proto message and supplied to Metropolis in an
28// implementation-specific way (currently: either on ESP partition or via qemu
29// fw_cfg).
30message NodeParameters {
Serge Bazanski516d3002021-10-01 00:05:41 +020031 // ClusterBootstrap configures the node to attempt to create a new cluster
32 // from scratch. Further nodes can become part of the cluster by being
33 // configured with ClusterRegister, which should contain data retrieved from
34 // the newly bootstrapped cluster by its operator.
Serge Bazanski0ed2f962021-03-15 16:39:30 +010035 message ClusterBootstrap {
Serge Bazanski516d3002021-10-01 00:05:41 +020036 // owner_public_key is a raw Ed25519 public whose corresponding private
37 // key can be used to prove ownership of the cluster and retrieve
38 // management credentials for the cluster via an AAA.Escrow call.
Serge Bazanski72068da2021-03-16 13:15:45 +010039 bytes owner_public_key = 1;
Serge Bazanski5df62ba2023-03-22 17:56:46 +010040
Serge Bazanski11198c82024-05-22 14:11:01 +020041 reserved 2;
42
Serge Bazanski5df62ba2023-03-22 17:56:46 +010043 // If not set, defaults to:
44 // - TPM mode: REQUIRED
45 common.ClusterConfiguration initial_cluster_configuration = 3;
Serge Bazanski11198c82024-05-22 14:11:01 +020046
47 // Labels that the first node will start out with. The given labels must
48 // be valid (see NodeLabels for more details). Invalid labels will be
49 // discarded.
50 metropolis.proto.common.NodeLabels labels = 4;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010051 }
Serge Bazanski516d3002021-10-01 00:05:41 +020052 // ClusterRegister configures the node to attempt to register into an
53 // existing cluster, ie. contact an existing running cluster and become
54 // its member.
Serge Bazanski0ed2f962021-03-15 16:39:30 +010055 message ClusterRegister {
Serge Bazanski516d3002021-10-01 00:05:41 +020056 // cluster_directory is a directory (mapping of names into IP addresses
57 // and public keys) of existing nodes in the cluster. It's used as the
58 // initial contact point of the already running cluster that the node
59 // should register into. It can be retrieved by an operator from
60 // a running cluster via Management.GetClusterInfo.
61 metropolis.proto.common.ClusterDirectory cluster_directory = 1;
62 // register_ticket is the opaque Register Ticket required from a node to
63 // begin registering it into a cluster. It can be retrieved by an
64 // operator from a running cluster via Management.GetRegisterTicket.
65 bytes register_ticket = 2;
Serge Bazanskifbd38e22021-10-08 14:41:16 +020066 // ca_certificate is the DER-encoded x509 CA of the cluster that the
Serge Bazanski516d3002021-10-01 00:05:41 +020067 // node should expect when contacting nodes in cluster_directory and
Serge Bazanskifbd38e22021-10-08 14:41:16 +020068 // attempting to register into a cluster. It can be retrieved by
69 // an operator from a running cluster via Management.GetClusterInfo.
70 bytes ca_certificate = 3;
Serge Bazanski30e30b32024-05-22 14:11:56 +020071
72 // Labels that the new node will start out with. The given labels must
73 // be valid (see NodeLabels for more details). Invalid labels will be
74 // discarded.
75 metropolis.proto.common.NodeLabels labels = 4;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010076 }
77 oneof cluster {
78 ClusterBootstrap cluster_bootstrap = 1;
79 ClusterRegister cluster_register = 2;
80 }
Lorenz Brun85ad26a2023-03-27 17:00:00 +020081
82 // Optional network configuration when autoconfiguration is not possible or
83 // desirable. If unset, autoconfiguration (ie. DHCP) is used.
Tim Windelschmidt10ef8f92024-08-13 15:35:10 +020084 osbase.net.proto.Net network_config = 4;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010085}