blob: 3a4a5cd0c37afcc4d8c2d368bcd29b470f1d61dd [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";
Lorenz Brun85ad26a2023-03-27 17:00:00 +020022import "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 Bazanski0ed2f962021-03-15 16:39:30 +010040 }
Serge Bazanski516d3002021-10-01 00:05:41 +020041 // ClusterRegister configures the node to attempt to register into an
42 // existing cluster, ie. contact an existing running cluster and become
43 // its member.
Serge Bazanski0ed2f962021-03-15 16:39:30 +010044 message ClusterRegister {
Serge Bazanski516d3002021-10-01 00:05:41 +020045 // cluster_directory is a directory (mapping of names into IP addresses
46 // and public keys) of existing nodes in the cluster. It's used as the
47 // initial contact point of the already running cluster that the node
48 // should register into. It can be retrieved by an operator from
49 // a running cluster via Management.GetClusterInfo.
50 metropolis.proto.common.ClusterDirectory cluster_directory = 1;
51 // register_ticket is the opaque Register Ticket required from a node to
52 // begin registering it into a cluster. It can be retrieved by an
53 // operator from a running cluster via Management.GetRegisterTicket.
54 bytes register_ticket = 2;
Serge Bazanskifbd38e22021-10-08 14:41:16 +020055 // ca_certificate is the DER-encoded x509 CA of the cluster that the
Serge Bazanski516d3002021-10-01 00:05:41 +020056 // node should expect when contacting nodes in cluster_directory and
Serge Bazanskifbd38e22021-10-08 14:41:16 +020057 // attempting to register into a cluster. It can be retrieved by
58 // an operator from a running cluster via Management.GetClusterInfo.
59 bytes ca_certificate = 3;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010060 }
61 oneof cluster {
62 ClusterBootstrap cluster_bootstrap = 1;
63 ClusterRegister cluster_register = 2;
64 }
Lorenz Brun85ad26a2023-03-27 17:00:00 +020065
66 // Optional network configuration when autoconfiguration is not possible or
67 // desirable. If unset, autoconfiguration (ie. DHCP) is used.
68 net.proto.Net network_config = 4;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010069}