Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostname ¶
GetHostname returns OS's hostname if 'hostnameOverride' is empty; otherwise, return 'hostnameOverride'. Copied from Kubernetes' nodeutil to avoid a dependency to kubernetes/kubernetes.
Types ¶
type Auth ¶
type Auth interface {
authenticator.Request
authorizer.RequestAttributesGetter
authorizer.Authorizer
}
type AuthFlags ¶
AuthFlags are options for configuring server.Options.AuthFlags.
func (*AuthFlags) AuthOptions ¶
func (o *AuthFlags) AuthOptions(machinePoolName string) AuthOptions
AuthOptions produces the server.AuthOptions.
type AuthOptions ¶
type AuthOptions struct {
MachinePoolName string
Authentication AuthenticationOptions
Authorization AuthorizationOptions
}
type AuthenticationOptions ¶
type AuthenticationOptions struct {
ClientCAFile string
}
type AuthorizationOptions ¶
type AuthorizationOptions struct {
Anonymous bool
}
type Flags ¶
type Flags struct {
Serving ServingFlags
Auth AuthFlags
}
Flags couples together all options required to create server.Options.
func NewServerFlags ¶
func NewServerFlags() *Flags
func (*Flags) ServerOptions ¶
func (o *Flags) ServerOptions(machinePoolName string, machineRuntime irimachine.RuntimeService, log logr.Logger) Options
ServerOptions produces server.Options.
type MachinePoolRequestAttr ¶
type MachinePoolRequestAttr struct {
MachinePoolName string
}
func (MachinePoolRequestAttr) GetRequestAttributes ¶
func (m MachinePoolRequestAttr) GetRequestAttributes(u user.Info, req *http.Request) authorizer.Attributes
type Options ¶
type Options struct {
// MachineRuntime is the iri-machine runtime service.
MachineRuntime irimachine.RuntimeService
// Log is the logger to use in the server.
// If unset, a package-global router will be used.
Log logr.Logger
// HostnameOverride is an optional hostname override to supply for self-signed certificate generation.
HostnameOverride string
// Address is the address to listen on.
// Leave empty to auto-determine host / ephemeral port.
Address string
// CertDir is the directory that contains the server key and certificate.
// If not set, the server would look up the key and certificate in
// {TempDir}/ironcore-machinepool-server/serving-certs. The key and certificate
// must be named tls.key and tls.crt, respectively.
// If the files don't exist, a self-signed certificate is generated.
CertDir string
// Auth are options for authentication.
Auth AuthOptions
// DisableAuth will turn off authN/Z.
DisableAuth bool
StreamCreationTimeout time.Duration
StreamIdleTimeout time.Duration
ShutdownTimeout time.Duration
CacheTTL time.Duration
}
type ServingFlags ¶
type ServingFlags struct {
DisableAuth bool
HostnameOverride string
Address string
CertDir string
StreamCreationTimeout time.Duration
StreamIdleTimeout time.Duration
ShutdownTimeout time.Duration
}
ServingFlags are options for configuring the serving part of server.Options.
func NewServingOptions ¶
func NewServingOptions() *ServingFlags
func (*ServingFlags) BindFlags ¶
func (o *ServingFlags) BindFlags(fs *pflag.FlagSet)
BindFlags adds the flags to the pflag.FlagSet.
func (*ServingFlags) ServerOptions ¶
func (o *ServingFlags) ServerOptions(machineRuntime irimachine.RuntimeService, log logr.Logger, authOpts AuthOptions) Options
ServerOptions produces server.Options.
Click to show internal directories.
Click to hide internal directories.