talos/pkg/config/cluster/cluster.go
Spencer Smith 1368bfa451 chore: update bootkube config to include cluster name
This PR will add the new cluster name field to our bootkube options.
This allows for the generated kubeconfig to include the context-name for
the default context.

Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
2020-01-21 16:56:57 -05:00

74 lines
1.7 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 (
"net/url"
"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 {
Name() string
Endpoint() *url.URL
Token() Token
CertSANs() []string
SetCertSANs([]string)
CA() *x509.PEMEncodedCertificateAndKey
AESCBCEncryptionSecret() string
Config(machine.Type) (string, error)
Etcd() Etcd
Network() Network
LocalAPIServerPort() int
PodCheckpointer() PodCheckpointer
CoreDNS() CoreDNS
ExtraManifestURLs() []string
}
// Network defines the requirements for a config that pertains to cluster
// network options.
type Network interface {
CNI() CNI
PodCIDR() string
ServiceCIDR() string
}
// CNI defines the requirements for a config that pertains to Kubernetes
// cni.
type CNI interface {
Name() string
URLs() []string
}
// Etcd defines the requirements for a config that pertains to etcd related
// options.
type Etcd interface {
Image() string
CA() *x509.PEMEncodedCertificateAndKey
ExtraArgs() map[string]string
}
// Token defines the requirements for a config that pertains to Kubernetes
// bootstrap token.
type Token interface {
ID() string
Secret() string
}
// PodCheckpointer defines the requirements for a config that pertains to bootkube
// pod-checkpointer options.
type PodCheckpointer interface {
Image() string
}
// CoreDNS defines the requirements for a config that pertains to bootkube
// coredns options.
type CoreDNS interface {
Image() string
}