generate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Talosconfig

func Talosconfig(in *Input) (string, error)

Talosconfig returns the talos admin Talos config.

func Userdata

func Userdata(t Type, in *Input) (string, error)

Userdata returns the talos userdata for a given node type.

Types

type CertStrings

type CertStrings struct {
	Crt string
	Key string
}

CertStrings holds the string representation of a certificate and key.

type Certs

type Certs struct {
	AdminCert string
	AdminKey  string
	OsCert    string
	OsKey     string
	K8sCert   string
	K8sKey    string
}

Certs holds the base64 encoded keys and certificates.

type Input

type Input struct {
	Certs             *Certs
	MasterIPs         []string
	Index             int
	ClusterName       string
	ServiceDomain     string
	PodNet            []string
	ServiceNet        []string
	Endpoints         string
	KubernetesVersion string
	KubeadmTokens     *KubeadmTokens
	TrustdInfo        *TrustdInfo
	InitToken         *token.Token
	IP                net.IP
}

Input holds info about certs, ips, and node type.

func NewInput

func NewInput(clustername string, masterIPs []string) (input *Input, err error)

NewInput generates the sensitive data required to generate all userdata types. nolint: gocyclo

type KubeadmTokens

type KubeadmTokens struct {
	BootstrapToken string
	CertKey        string
}

KubeadmTokens holds the senesitve kubeadm data.

type TrustdInfo

type TrustdInfo struct {
	Token string
}

TrustdInfo holds the trustd credentials.

type Type

type Type int

Type represents a userdata type.

const (
	// TypeInit indicates a userdata type should correspond to the kubeadm
	// InitConfiguration type.
	TypeInit Type = iota
	// TypeControlPlane indicates a userdata type should correspond to the
	// kubeadm JoinConfiguration type that has the ControlPlane field
	// defined.
	TypeControlPlane
	// TypeJoin indicates a userdata type should correspond to the kubeadm
	// JoinConfiguration type.
	TypeJoin
)

func (Type) String

func (t Type) String() string

Sring returns the string representation of Type.

Jump to

Keyboard shortcuts

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