blob: 74d314aaff85eafe5aced25329d9ad835419e53b [file] [log] [blame]
Serge Bazanskiefdb6e92020-07-13 17:19:27 +02001// 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 smalltown.core.proto.api;
19option go_package = "git.monogon.dev/source/nexantic.git/core/proto/api";
20
21import "core/proto/api/enrolment.proto";
22
23// NodeDebugService exposes debug and testing endpoints that allow introspection into a running Smalltown instance.
24// It is not authenticated and will be disabled in production. It is currently consumed by core/cmd/dbg and
25// by tests. For exact documentation of the available parameters please look at core/internal/node/debug.go.
26service NodeDebugService {
27 // GetDebugKubeconfig issues kubeconfigs with arbitrary identities and groups for debugging
28 rpc GetDebugKubeconfig(GetDebugKubeconfigRequest) returns (GetDebugKubeconfigResponse);
29 // GetComponentLogs dumps various log ringbuffers for binaries that we run.
30 rpc GetComponentLogs(GetComponentLogsRequest) returns (GetComponentLogsResponse);
Serge Bazanski57b43752020-07-13 19:17:48 +020031 // GetGoldenTicket requests a 'golden ticket' which can be used to enroll any node into the cluster.
32 // This bypasses integrity checks.
33 rpc GetGoldenTicket(GetGoldenTicketRequest) returns (GetGoldenTicketResponse);
Serge Bazanskiefdb6e92020-07-13 17:19:27 +020034}
35
36
37message GetDebugKubeconfigRequest {
38 string id = 1; // Kubernetes identity (user)
39 repeated string groups = 2; // Kubernetes groups
40}
41
42message GetDebugKubeconfigResponse {
43 string debug_kubeconfig = 1;
44}
45
46message GetComponentLogsRequest {
47 // For supported paths see core/internal/node/debug.go
48 repeated string component_path = 1;
49 uint32 tail_lines = 2; // 0 = whole ring buffer
50}
51
52message GetComponentLogsResponse {
53 repeated string line = 1;
54}
Serge Bazanski57b43752020-07-13 19:17:48 +020055
56message GetGoldenTicketRequest {
57 // IP address at which the new node will run.
58 string external_ip = 1;
59}
60
61message GetGoldenTicketResponse {
62 // Ticket to use in the new node's EnrolmentConfig.
63 GoldenTicket ticket = 1;
64}