Documentation
¶
Overview ¶
Package kubeconfig provides Kubernetes config file generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidKubeconfig = errors.New("kubeconfig doesn't match the structure generated by Talos")
ErrInvalidKubeconfig is returned when the kubeconfig doesn't match the structure Talos generates.
Functions ¶
func Generate ¶
func Generate(in *GenerateInput, out io.Writer) error
Generate a kubeconfig for the cluster from the given Input.
func GenerateAdmin ¶
func GenerateAdmin(config GenerateAdminInput, out io.Writer) error
GenerateAdmin generates admin kubeconfig for the cluster.
func LoadAndValidate ¶ added in v1.13.10
func LoadAndValidate(data []byte) (*clientcmdapi.Config, error)
LoadAndValidate parses the kubeconfig and validates it with Validate.
This should be used for any kubeconfig which comes back over the Talos API before it is used to build a Kubernetes client or written to the operator's filesystem.
func Validate ¶ added in v1.13.10
func Validate(config *clientcmdapi.Config) error
Validate checks that the kubeconfig matches exactly the structure Generate produces: a single cluster with the server URL and the server CA, a single user with a client certificate and key, and a single context tying them together.
Types ¶
type GenerateAdminInput ¶
type GenerateAdminInput interface {
Name() string
Endpoint() *url.URL
IssuingCA() *x509.PEMEncodedCertificateAndKey
AcceptedCAs() []*x509.PEMEncodedCertificate
AdminKubeconfig() config.AdminKubeconfig
}
GenerateAdminInput is the interface for the GenerateAdmin function.
This interface is implemented by config.Cluster().
type GenerateInput ¶
type GenerateInput struct {
ClusterName string
IssuingCA *x509.PEMEncodedCertificateAndKey
AcceptedCAs []*x509.PEMEncodedCertificate
CertificateLifetime time.Duration
CommonName string
Organization string
Endpoint string
Username string
ContextName string
}
GenerateInput are input parameters for Generate.