Documentation
¶
Overview ¶
Package ipxedust implements the iPXE tftp and http serving.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct {
// TFTPAddr is the TFTP server address:port.
TFTPAddr string `validate:"required,hostname_port"`
// TFTPTimeout is the timeout for serving individual TFTP requests.
TFTPTimeout time.Duration `validate:"required,gte=1s"`
// HTTPAddr is the HTTP server address:port.
HTTPAddr string `validate:"required,hostname_port"`
// HTTPTimeout is the timeout for serving individual HTTP requests.
HTTPTimeout time.Duration `validate:"required,gte=1s"`
// Log is the logging implementation.
Log logr.Logger
// LogLevel defines the logging level.
LogLevel string
// EnableTFTPSinglePort is a flag to enable single port mode for the TFTP server.
// A standard TFTP server implementation receives requests on port 69 and
// allocates a new high port (over 1024) dedicated to that request. In single
// port mode, the same port is used for transmit and receive. If the server
// is started on port 69, all communication will be done on port 69.
// This option is required when running in a container that doesn't bind to the hosts
// network because this type of dynamic port allocation is not generally supported.
//
// This option is specific to github.com/pin/tftp. The pin/tftp library says this option is
// experimental and "Enabling this will negatively impact performance". Please take this into
// consideration when using this option.
EnableTFTPSinglePort bool
}
Command represents the ipxe command.
func (*Command) RegisterFlags ¶
RegisterFlags registers a flag set for the ipxe command.
type Server ¶
type Server struct {
// TFTP holds the details specific for the TFTP server.
TFTP ServerSpec
// HTTP holds the details specific for the HTTP server.
HTTP ServerSpec
// Log is the logger to use.
Log logr.Logger
// EnableTFTPSinglePort is a flag to enable single port mode for the TFTP server.
// A standard TFTP server implementation receives requests on port 69 and
// allocates a new high port (over 1024) dedicated to that request. In single
// port mode, the same port is used for transmit and receive. If the server
// is started on port 69, all communication will be done on port 69.
// This option is required when running in a container that doesn't bind to the hosts
// network because this type of dynamic port allocation is not generally supported.
//
// This option is specific to github.com/pin/tftp. The pin/tftp library says this option is
// experimental and "Enabling this will negatively impact performance". Please take this into
// consideration when using this option.
EnableTFTPSinglePort bool
}
Server holds the details for configuring the iPXE service.
func (*Server) ListenAndServe ¶
ListenAndServe will listen and serve iPXE binaries over TFTP and HTTP.
Default TFTP listen address is ":69".
Default HTTP listen address is ":8080".
Default request timeout for both is 5 seconds.
Override the defaults by setting the Config struct fields. See binary/binary.go for the iPXE files that are served.
type ServerSpec ¶
type ServerSpec struct {
// Addr is the address:port to listen on for requests.
Addr netip.AddrPort
// Timeout is the timeout for serving individual requests.
Timeout time.Duration
// Disabled allows a server to be disabled. Useful, for example, to disable TFTP.
Disabled bool
// The patch to apply to the iPXE binary.
Patch []byte
}
ServerSpec holds details used to configure a server.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package binary handles embedding of the iPXE binaries.
|
Package binary handles embedding of the iPXE binaries. |
|
Package ihttp implements an HTTP server for iPXE binaries.
|
Package ihttp implements an HTTP server for iPXE binaries. |
|
Package itftp implements a TFTP server for iPXE binaries.
|
Package itftp implements a TFTP server for iPXE binaries. |
Click to show internal directories.
Click to hide internal directories.