Documentation
¶
Index ¶
- func Config(t machine.Type, in *Input) (c *v1alpha1.Config, err error)
- func NewAdminCertificateAndKey(crt, key []byte, loopback string) (p *x509.PEMEncodedCertificateAndKey, err error)
- func NewEtcdCA() (ca *x509.CertificateAuthority, err error)
- func NewKubernetesCA() (ca *x509.CertificateAuthority, err error)
- func NewTalosCA() (ca *x509.CertificateAuthority, err error)
- func Talosconfig(in *Input, opts ...GenOption) (*config.Config, error)
- type Certs
- type GenOption
- func WithAdditionalSubjectAltNames(sans []string) GenOption
- func WithClusterCNIConfig(config *v1alpha1.CNIConfig) GenOption
- func WithDNSDomain(dnsDomain string) GenOption
- func WithDebug(enable bool) GenOption
- func WithEndpointList(endpoints []string) GenOption
- func WithInstallDisk(disk string) GenOption
- func WithInstallExtraKernelArgs(args []string) GenOption
- func WithInstallImage(imageRef string) GenOption
- func WithNetworkConfig(network *v1alpha1.NetworkConfig) GenOption
- func WithPersist(enable bool) GenOption
- func WithRegistryMirror(host string, endpoints ...string) GenOption
- type GenOptions
- type Input
- type Secrets
- type TrustdInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdminCertificateAndKey ¶
func NewAdminCertificateAndKey(crt, key []byte, loopback string) (p *x509.PEMEncodedCertificateAndKey, err error)
NewAdminCertificateAndKey generates the admin Talos certifiate and key.
func NewEtcdCA ¶
func NewEtcdCA() (ca *x509.CertificateAuthority, err error)
NewEtcdCA generates a CA for the Etcd PKI.
func NewKubernetesCA ¶
func NewKubernetesCA() (ca *x509.CertificateAuthority, err error)
NewKubernetesCA generates a CA for the Kubernetes PKI.
func NewTalosCA ¶
func NewTalosCA() (ca *x509.CertificateAuthority, err error)
NewTalosCA generates a CA for the Talos PKI.
Types ¶
type Certs ¶
type Certs struct { Admin *x509.PEMEncodedCertificateAndKey Etcd *x509.PEMEncodedCertificateAndKey K8s *x509.PEMEncodedCertificateAndKey OS *x509.PEMEncodedCertificateAndKey }
Certs holds the base64 encoded keys and certificates.
type GenOption ¶ added in v0.4.0
type GenOption func(o *GenOptions) error
GenOption controls generate options specific to input generation.
func WithAdditionalSubjectAltNames ¶ added in v0.4.0
WithAdditionalSubjectAltNames specifies additional SANs.
func WithClusterCNIConfig ¶ added in v0.6.0
WithClusterCNIConfig specifies custom cluster CNI config.
func WithDNSDomain ¶ added in v0.4.0
WithDNSDomain specifies domain name to use in Talos cluster.
func WithEndpointList ¶ added in v0.4.0
WithEndpointList specifies endpoints to use when acessing Talos cluster.
func WithInstallDisk ¶ added in v0.4.0
WithInstallDisk specifies install disk to use in Talos cluster.
func WithInstallExtraKernelArgs ¶ added in v0.6.0
WithInstallExtraKernelArgs specifies extra kernel arguments to pass to the installer.
func WithInstallImage ¶ added in v0.4.0
WithInstallImage specifies install container image to use in Talos cluster.
func WithNetworkConfig ¶ added in v0.4.0
func WithNetworkConfig(network *v1alpha1.NetworkConfig) GenOption
WithNetworkConfig allows to pass network config to be used.
func WithPersist ¶ added in v0.5.0
WithPersist enables persistence of machine config across reboots.
func WithRegistryMirror ¶ added in v0.4.0
WithRegistryMirror configures registry mirror endpoint(s).
type GenOptions ¶ added in v0.4.0
type GenOptions struct { EndpointList []string InstallDisk string InstallImage string InstallExtraKernelArgs []string AdditionalSubjectAltNames []string NetworkConfig *v1alpha1.NetworkConfig CNIConfig *v1alpha1.CNIConfig RegistryMirrors map[string]config.RegistryMirrorConfig DNSDomain string Debug bool Persist bool }
GenOptions describes generate parameters.
func DefaultGenOptions ¶ added in v0.4.0
func DefaultGenOptions() GenOptions
DefaultGenOptions returns default options.
type Input ¶
type Input struct { Certs *Certs // ControlplaneEndpoint is the canonical address of the kubernetes control // plane. It can be a DNS name, the IP address of a load balancer, or // (default) the IP address of the first master node. It is NOT // multi-valued. It may optionally specify the port. ControlPlaneEndpoint string AdditionalSubjectAltNames []string AdditionalMachineCertSANs []string ClusterName string ServiceDomain string PodNet []string ServiceNet []string KubernetesVersion string Secrets *Secrets TrustdInfo *TrustdInfo ExternalEtcd bool InstallDisk string InstallImage string InstallExtraKernelArgs []string NetworkConfig *v1alpha1.NetworkConfig CNIConfig *v1alpha1.CNIConfig RegistryMirrors map[string]config.RegistryMirrorConfig Debug bool Persist bool }
Input holds info about certs, ips, and node type.
nolint: maligned
func NewInput ¶
func NewInput(clustername, endpoint, kubernetesVersion string, opts ...GenOption) (input *Input, err error)
NewInput generates the sensitive data required to generate all config types. nolint: dupl,gocyclo
func (*Input) GetAPIServerEndpoint ¶
GetAPIServerEndpoint returns the formatted host:port of the API server endpoint.
func (*Input) GetAPIServerSANs ¶
GetAPIServerSANs returns the formatted list of Subject Alt Name addresses for the API Server.
func (*Input) GetControlPlaneEndpoint ¶
GetControlPlaneEndpoint returns the formatted host:port of the canonical controlplane address, defaulting to the first master IP.