mirror of
https://github.com/lingble/talos.git
synced 2025-12-09 17:15:22 +00:00
This adds more methods to the Cluster interface that allows for more granular control of the cluster network settings. Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
/* 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 cluster
|
|
|
|
import (
|
|
"github.com/talos-systems/talos/pkg/config/machine"
|
|
"github.com/talos-systems/talos/pkg/crypto/x509"
|
|
)
|
|
|
|
// Cluster defines the requirements for a config that pertains to cluster
|
|
// related options.
|
|
type Cluster interface {
|
|
Version() string
|
|
IPs() []string
|
|
Token() Token
|
|
CertSANs() []string
|
|
CA() *x509.PEMEncodedCertificateAndKey
|
|
AESCBCEncryptionSecret() string
|
|
Config(machine.Type) (string, error)
|
|
Etcd() Etcd
|
|
Network() Network
|
|
}
|
|
|
|
// Network defines the requirements for a config that pertains to cluster
|
|
// network options.
|
|
type Network interface {
|
|
CNI() string
|
|
PodCIDR() string
|
|
ServiceCIDR() string
|
|
}
|
|
|
|
// Etcd defines the requirements for a config that pertains to etcd related
|
|
// options.
|
|
type Etcd interface {
|
|
Image() string
|
|
CA() *x509.PEMEncodedCertificateAndKey
|
|
}
|
|
|
|
// Token defines the requirements for a config that pertains to Kubernetes
|
|
// bootstrap token.
|
|
type Token interface {
|
|
ID() string
|
|
Secret() string
|
|
}
|