Documentation
¶
Index ¶
- type Config
- func (c *Config) ControllerEnableHTTP2() bool
- func (c *Config) ControllerHealthProbeAddr() string
- func (c *Config) ControllerPort() int
- func (c *Config) ControllerRequeueInterval() time.Duration
- func (c *Config) EnableLeaderElection() bool
- func (c *Config) LogFormat() string
- func (c *Config) LogLevel() string
- func (c *Config) MetricsAddress() string
- func (c *Config) MetricsSecure() bool
- func (c *Config) PluginPath() string
- func (c *Config) String() string
- type Configurer
- type ControllerConfig
- type ControllerConfigurer
- type LogConfig
- type LogConfigurer
- type MetricsConfig
- type MetricsConfigurer
- type PluginConfig
- type PluginConfigurer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Metrics defines the metrics configurations
Metrics MetricsConfig `env:", prefix=EPHEMERAL_METRICS_"`
// Log defines the logs configurations
Log LogConfig `env:", prefix=EPHEMERAL_LOG_"`
// Controller defines the controller configurations
Controller ControllerConfig `env:", prefix=EPHEMERAL_CONTROLLER_"`
Plugin PluginConfig `env:", prefix=EPHEMERAL_PLUGIN_"`
}
Config defines all configurations available for this controller
func (*Config) ControllerEnableHTTP2 ¶
ControllerEnableHTTP2 acessor method
func (*Config) ControllerHealthProbeAddr ¶
ControllerHealthProbeAddr acessor method
func (*Config) ControllerRequeueInterval ¶
ControllerRequeueInterval acessor method
func (*Config) EnableLeaderElection ¶
EnableLeaderElection acessor method
func (*Config) MetricsAddress ¶
MetricsAddress acessor method
type Configurer ¶
type Configurer interface {
LogConfigurer
MetricsConfigurer
ControllerConfigurer
PluginConfigurer
}
Configurer defines the accessor methods for all configurations that can be provided externally to the ephemeral access controller process. The main purpose behind this interface is to ensure that externally provided configuration can not be changed once retrieved.
func ReadEnvConfigs ¶
func ReadEnvConfigs() (Configurer, error)
ReadEnvConfigs will read all environment variables as defined in the Config struct and return a Configurer interface which provides accessor methods for all configurations.
type ControllerConfig ¶
type ControllerConfig struct {
// Port The controller main port for routes such as pprof
Port int `env:"PORT, default=8081"`
// EnableLeaderElection Enable leader election for controller manager.
// Enabling this will ensure there is only one active controller manager.
EnableLeaderElection bool `env:"ENABLE_LEADER_ELECTION, default=false"`
// HealthProbeAddr The address the probe endpoint binds to.
HealthProbeAddr string `env:"HEALTH_PROBE_ADDR, default=:8082"`
// EnableHTTP2 If set, HTTP/2 will be enabled for the metrics and webhook
// servers.
EnableHTTP2 bool `env:"ENABLE_HTTP2, default=false"`
// RequeueInterval determines the interval the controller will requeue an
// AccessRequest.
// Valid time units are "ms", "s", "m", "h".
// Default: 3 minutes
RequeueInterval time.Duration `env:"REQUEUE_INTERVAL, default=3m"`
}
ControllerConfig defines the controller configurations
type ControllerConfigurer ¶
type ControllerConfigurer interface {
EnableLeaderElection() bool
ControllerPort() int
ControllerHealthProbeAddr() string
ControllerEnableHTTP2() bool
ControllerRequeueInterval() time.Duration
}
ControllerConfigurer defines the accessor methods for the controller's configurations.
type LogConfig ¶
type LogConfig struct {
// Level defines the log level.
// Possible values: debug, info, error
// Default: info
Level string `env:"LEVEL, default=info"`
// Format defines the log output format.
// Possible values: text, json
// Default: text
Format string `env:"FORMAT, default=text"`
}
LogConfig defines the log configurations
type LogConfigurer ¶
LogConfigurer defines the accessor methods for log configurations.
type MetricsConfig ¶
type MetricsConfig struct {
// Address The address the metric endpoint binds to.
// Can be set to 0 in order to disable the metrics server
Address string `env:"ADDR, default=:8090"`
// Secure If set the metrics endpoint is served securely.
Secure bool `env:"SECURE, default=false"`
}
MetricsConfig defines the metrics configurations
type MetricsConfigurer ¶
MetricsConfigurer defines the accessor methods for metrics configurations.
type PluginConfig ¶
type PluginConfig struct {
// Path must be the full path to the binary implementing the plugin interface
Path string `env:"PATH"`
}
PluginConfig defines the plugin configuration
type PluginConfigurer ¶
type PluginConfigurer interface {
PluginPath() string
}
PluginConfigurer defines the accessor methods for the plugin configurations.