2019-12-23 20:52:04 +00:00
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package provision
import (
2022-11-01 12:51:16 +04:00
"net/netip"
2019-12-23 20:52:04 +00:00
2020-08-07 22:08:15 +03:00
"github.com/google/uuid"
2023-05-25 17:14:01 +04:00
"github.com/siderolabs/talos/pkg/machinery/config/machine"
2019-12-23 20:52:04 +00:00
)
// Cluster describes the provisioned Cluster.
type Cluster interface {
2020-01-17 22:25:15 +00:00
// Provisioner returns name of the provisioner used to build the cluster.
Provisioner ( ) string
// StatePath returns path to the state directory of the cluster.
StatePath ( ) ( string , error )
// Info returns running cluster information.
2019-12-23 20:52:04 +00:00
Info ( ) ClusterInfo
}
// ClusterInfo describes the cluster.
type ClusterInfo struct {
ClusterName string
Network NetworkInfo
Nodes [ ] NodeInfo
2020-08-07 22:08:15 +03:00
// ExtraNodes are not part of the cluster.
ExtraNodes [ ] NodeInfo
2024-03-08 21:57:26 +03:00
// KubernetesEndpoint is the endpoint of the Kubernetes API server.
KubernetesEndpoint string
2019-12-23 20:52:04 +00:00
}
// NetworkInfo describes cluster network.
type NetworkInfo struct {
2024-04-23 13:04:39 +02:00
Name string
CIDRs [ ] netip . Prefix
GatewayAddrs [ ] netip . Addr
MTU int
NoMasqueradeCIDRs [ ] netip . Prefix
2019-12-23 20:52:04 +00:00
}
// NodeInfo describes a node.
type NodeInfo struct {
ID string
2020-08-07 22:08:15 +03:00
UUID uuid . UUID
2019-12-23 20:52:04 +00:00
Name string
2020-07-28 21:48:26 +03:00
Type machine . Type
2019-12-23 20:52:04 +00:00
2020-01-17 22:25:15 +00:00
// Share of CPUs, in 1e-9 fractions
NanoCPUs int64
// Memory limit in bytes
Memory int64
// Disk (volume) size in bytes, if applicable
2020-10-29 19:19:31 +03:00
DiskSize uint64
2020-01-17 22:25:15 +00:00
2022-11-01 12:51:16 +04:00
IPs [ ] netip . Addr
2020-09-14 23:42:54 +03:00
2023-06-05 23:49:45 +05:30
APIPort int
TPM2StateDir string
2019-12-23 20:52:04 +00:00
}