Documentation
¶
Index ¶
- Constants
- 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 WithDNSDomain(dnsDomain string) GenOption
- func WithDebug(enable bool) GenOption
- func WithEndpointList(endpoints []string) GenOption
- func WithInstallDisk(disk string) GenOption
- func WithInstallImage(imageRef string) GenOption
- func WithNetworkConfig(network *v1alpha1.NetworkConfig) GenOption
- func WithRegistryMirror(host string, endpoints ...string) GenOption
- type GenOptions
- type Input
- type Secrets
- type TrustdInfo
Constants ¶
const DefaultIPv4PodNet = "10.244.0.0/16"
DefaultIPv4PodNet is the network to be used for kubernetes Pods when using IPv4-based master nodes
const DefaultIPv4ServiceNet = "10.96.0.0/12"
DefaultIPv4ServiceNet is the network to be used for kubernetes Services when using IPv4-based master nodes
const DefaultIPv6PodNet = "fc00:db8:10::/56"
DefaultIPv6PodNet is the network to be used for kubernetes Pods when using IPv6-based master nodes
const DefaultIPv6ServiceNet = "fc00:db8:20::/112"
DefaultIPv6ServiceNet is the network to be used for kubernetes Services when using IPv6-based master nodes
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 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 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 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 AdditionalSubjectAltNames []string NetworkConfig *v1alpha1.NetworkConfig RegistryMirrors map[string]machine.RegistryMirrorConfig DNSDomain string Debug 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 NetworkConfig *v1alpha1.NetworkConfig RegistryMirrors map[string]machine.RegistryMirrorConfig Debug bool }
Input holds info about certs, ips, and node type.
nolint: maligned
func NewInput ¶
func NewInput(clustername string, endpoint string, 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