Documentation
¶
Overview ¶
Package siderolink provides the function for encoding machine join configs and kernel args.
Index ¶
- Variables
- func GetListenHost() string
- func SupportsSecureJoinTokens(talosVersion string) bool
- type JoinConfigOption
- func WithEventSinkPort(value int) JoinConfigOption
- func WithGRPCTunnel(value bool) JoinConfigOption
- func WithJoinToken(token string) JoinConfigOption
- func WithJoinTokenVersion(version string) JoinConfigOption
- func WithLogServerPort(value int) JoinConfigOption
- func WithMachine(machine *omni.Machine) JoinConfigOption
- func WithMachineAPIURL(value string) JoinConfigOption
- func WithMachineRequestID(id string) JoinConfigOption
- func WithProvider(provider *infra.Provider) JoinConfigOption
- func WithoutMachineAPIURL() JoinConfigOption
- type JoinConfigOptions
- type JoinOptions
Constants ¶
This section is empty.
Variables ¶
var MinSupportedSecureTokensVersion = semver.MustParse("1.6.0")
MinSupportedSecureTokensVersion is 1.6.0. Below 1.6.0 Talos doesn't properly report node unique tokens to Omni.
Functions ¶
func GetListenHost ¶
func GetListenHost() string
GetListenHost returns the default Omni wireguard peer endpoint inside the virtual network.
func SupportsSecureJoinTokens ¶ added in v1.1.0
SupportsSecureJoinTokens checks if the Talos version supports secure join tokens.
Types ¶
type JoinConfigOption ¶
type JoinConfigOption func(*JoinConfigOptions)
JoinConfigOption is the additional options for the RenderJoinConfig function.
func WithEventSinkPort ¶
func WithEventSinkPort(value int) JoinConfigOption
WithEventSinkPort specifies event sink port. Without the port it will not render the EventSink config section.
func WithGRPCTunnel ¶
func WithGRPCTunnel(value bool) JoinConfigOption
WithGRPCTunnel overrides the gRPC tunnel config.
func WithJoinToken ¶
func WithJoinToken(token string) JoinConfigOption
WithJoinToken adds the join token to the machine API URL. Without the token it will try to use tokenless access to Omni.
func WithJoinTokenVersion ¶
func WithJoinTokenVersion(version string) JoinConfigOption
WithJoinTokenVersion sets the version of the join token.
If not set, it will default to jointoken.Version2.
func WithLogServerPort ¶
func WithLogServerPort(value int) JoinConfigOption
WithLogServerPort specifies log server port. Without the port it will not render the KmsgLog config section.
func WithMachine ¶
func WithMachine(machine *omni.Machine) JoinConfigOption
WithMachine renders the connection for the particular machine, it will take care of keeping the gRPC tunnel connection enabled, will populate the machine request ID if it's there.
func WithMachineAPIURL ¶
func WithMachineAPIURL(value string) JoinConfigOption
WithMachineAPIURL sets the machine API URL. Without the API URL it will not render the SideroLink config section.
func WithMachineRequestID ¶
func WithMachineRequestID(id string) JoinConfigOption
WithMachineRequestID renders the connection with the machine request ID encoded into the join token.
func WithProvider ¶
func WithProvider(provider *infra.Provider) JoinConfigOption
WithProvider renders the join config for the provider.
func WithoutMachineAPIURL ¶
func WithoutMachineAPIURL() JoinConfigOption
WithoutMachineAPIURL allows generating the config without the SideroLinkAPI section.
type JoinConfigOptions ¶
type JoinConfigOptions struct {
// contains filtered or unexported fields
}
JoinConfigOptions is the struct with all optional args for the RenderJoinConfig function.
type JoinOptions ¶
type JoinOptions struct {
// contains filtered or unexported fields
}
JoinOptions is the intermediate struct used in the kernel args and the partial config generation.
func NewJoinOptions ¶
func NewJoinOptions(opts ...JoinConfigOption) (*JoinOptions, error)
NewJoinOptions creates the new JoinOptions.
func (*JoinOptions) GetKernelArgs ¶
func (opts *JoinOptions) GetKernelArgs() []string
GetKernelArgs creates the Talos kernel arguments from the JoinOptions.
func (*JoinOptions) RenderJoinConfig ¶
func (opts *JoinOptions) RenderJoinConfig(extraDocuments ...config.Document) ([]byte, error)
RenderJoinConfig creates the raw join config from the JoinOptions.