generate

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2020 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(t machine.Type, in *Input) (c *v1alpha1.Config, err error)

Config returns the talos config for a given node type. nolint: gocyclo

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.

func Talosconfig

func Talosconfig(in *Input, opts ...GenOption) (*config.Config, error)

Talosconfig returns the talos admin Talos config.

Types

type Certs

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

func WithAdditionalSubjectAltNames(sans []string) GenOption

WithAdditionalSubjectAltNames specifies additional SANs.

func WithClusterCNIConfig added in v0.6.0

func WithClusterCNIConfig(config *v1alpha1.CNIConfig) GenOption

WithClusterCNIConfig specifies custom cluster CNI config.

func WithDNSDomain added in v0.4.0

func WithDNSDomain(dnsDomain string) GenOption

WithDNSDomain specifies domain name to use in Talos cluster.

func WithDebug added in v0.4.0

func WithDebug(enable bool) GenOption

WithDebug enables verbose logging to console for all services.

func WithEndpointList added in v0.4.0

func WithEndpointList(endpoints []string) GenOption

WithEndpointList specifies endpoints to use when acessing Talos cluster.

func WithInstallDisk added in v0.4.0

func WithInstallDisk(disk string) GenOption

WithInstallDisk specifies install disk to use in Talos cluster.

func WithInstallExtraKernelArgs added in v0.6.0

func WithInstallExtraKernelArgs(args []string) GenOption

WithInstallExtraKernelArgs specifies extra kernel arguments to pass to the installer.

func WithInstallImage added in v0.4.0

func WithInstallImage(imageRef string) GenOption

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

func WithPersist(enable bool) GenOption

WithPersist enables persistence of machine config across reboots.

func WithRegistryMirror added in v0.4.0

func WithRegistryMirror(host string, endpoints ...string) GenOption

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

func (i *Input) GetAPIServerEndpoint(port string) string

GetAPIServerEndpoint returns the formatted host:port of the API server endpoint.

func (*Input) GetAPIServerSANs

func (i *Input) GetAPIServerSANs() []string

GetAPIServerSANs returns the formatted list of Subject Alt Name addresses for the API Server.

func (*Input) GetControlPlaneEndpoint

func (i *Input) GetControlPlaneEndpoint() string

GetControlPlaneEndpoint returns the formatted host:port of the canonical controlplane address, defaulting to the first master IP.

type Secrets

type Secrets struct {
	BootstrapToken         string
	AESCBCEncryptionSecret string
}

Secrets holds the senesitve kubeadm data.

type TrustdInfo

type TrustdInfo struct {
	Token string
}

TrustdInfo holds the trustd credentials.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL