blob: 9ff1c43c37725e60fa819f2cf6f549e6cda61fb6 [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";
22
Serge Bazanski0ed2f962021-03-15 16:39:30 +010023// NodeParameters is the data with which a Node is set booted. It contains the
24// configuration required for a node to either bootstrap a new cluster, or
25// register into an existing one.
26// It is serialized into a proto message and supplied to Metropolis in an
27// implementation-specific way (currently: either on ESP partition or via qemu
28// fw_cfg).
29message NodeParameters {
Serge Bazanski516d3002021-10-01 00:05:41 +020030 // ClusterBootstrap configures the node to attempt to create a new cluster
31 // from scratch. Further nodes can become part of the cluster by being
32 // configured with ClusterRegister, which should contain data retrieved from
33 // the newly bootstrapped cluster by its operator.
Serge Bazanski0ed2f962021-03-15 16:39:30 +010034 message ClusterBootstrap {
Serge Bazanski516d3002021-10-01 00:05:41 +020035 // owner_public_key is a raw Ed25519 public whose corresponding private
36 // key can be used to prove ownership of the cluster and retrieve
37 // management credentials for the cluster via an AAA.Escrow call.
Serge Bazanski72068da2021-03-16 13:15:45 +010038 bytes owner_public_key = 1;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010039 }
Serge Bazanski516d3002021-10-01 00:05:41 +020040 // ClusterRegister configures the node to attempt to register into an
41 // existing cluster, ie. contact an existing running cluster and become
42 // its member.
Serge Bazanski0ed2f962021-03-15 16:39:30 +010043 message ClusterRegister {
Serge Bazanski516d3002021-10-01 00:05:41 +020044 // cluster_directory is a directory (mapping of names into IP addresses
45 // and public keys) of existing nodes in the cluster. It's used as the
46 // initial contact point of the already running cluster that the node
47 // should register into. It can be retrieved by an operator from
48 // a running cluster via Management.GetClusterInfo.
49 metropolis.proto.common.ClusterDirectory cluster_directory = 1;
50 // register_ticket is the opaque Register Ticket required from a node to
51 // begin registering it into a cluster. It can be retrieved by an
52 // operator from a running cluster via Management.GetRegisterTicket.
53 bytes register_ticket = 2;
Serge Bazanskifbd38e22021-10-08 14:41:16 +020054 // ca_certificate is the DER-encoded x509 CA of the cluster that the
Serge Bazanski516d3002021-10-01 00:05:41 +020055 // node should expect when contacting nodes in cluster_directory and
Serge Bazanskifbd38e22021-10-08 14:41:16 +020056 // attempting to register into a cluster. It can be retrieved by
57 // an operator from a running cluster via Management.GetClusterInfo.
58 bytes ca_certificate = 3;
Serge Bazanski0ed2f962021-03-15 16:39:30 +010059 }
60 oneof cluster {
61 ClusterBootstrap cluster_bootstrap = 1;
62 ClusterRegister cluster_register = 2;
63 }
64}