talos
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5package provision
6
7import (
8"net/netip"
9
10"github.com/google/uuid"
11
12"github.com/siderolabs/talos/pkg/machinery/config/machine"
13)
14
15// Cluster describes the provisioned Cluster.
16type Cluster interface {
17// Provisioner returns name of the provisioner used to build the cluster.
18Provisioner() string
19// StatePath returns path to the state directory of the cluster.
20StatePath() (string, error)
21// Info returns running cluster information.
22Info() ClusterInfo
23}
24
25// ClusterInfo describes the cluster.
26type ClusterInfo struct {
27ClusterName string
28
29Network NetworkInfo
30Nodes []NodeInfo
31
32// ExtraNodes are not part of the cluster.
33ExtraNodes []NodeInfo
34
35// KubernetesEndpoint is the endpoint of the Kubernetes API server.
36KubernetesEndpoint string
37}
38
39// NetworkInfo describes cluster network.
40type NetworkInfo struct {
41Name string
42CIDRs []netip.Prefix
43GatewayAddrs []netip.Addr
44MTU int
45NoMasqueradeCIDRs []netip.Prefix
46}
47
48// NodeInfo describes a node.
49type NodeInfo struct {
50ID string
51UUID uuid.UUID
52Name string
53Type machine.Type
54
55// Share of CPUs, in 1e-9 fractions
56NanoCPUs int64
57// Memory limit in bytes
58Memory int64
59// Disk (volume) size in bytes, if applicable
60DiskSize uint64
61
62IPs []netip.Addr
63
64APIPort int
65TPM2StateDir string
66}
67