Documentation ¶
Index ¶
- func FlagsForControllerConfig(name, prefix string, l *log.Config, c *ControllerConfig) *pflag.FlagSet
- func FlagsForKubeClient(prefix string, c *KubeClientConfig) *pflag.FlagSet
- func FlagsForLeaderElection(name, prefix string, c *LeaderElectionConfig) *pflag.FlagSet
- func FlagsForLeaderElectionLease(prefix string, c *LeaderElectionLeaseConfig) *pflag.FlagSet
- func FlagsForLeaderElectionLock(name, prefix string, c *LeaderElectionLockConfig) *pflag.FlagSet
- func FlagsForMetrics(prefix string, c *MetricsConfig) *pflag.FlagSet
- func FlagsForPProfConfig(prefix string, c *PProfConfig) *pflag.FlagSet
- func FlagsForTLSConfig(prefix string, config *TLSConfig) *pflag.FlagSet
- func FlagsForTracing(prefix string, c *TracingConfig) *pflag.FlagSet
- type ControllerConfig
- type KubeClientConfig
- type KubeClientRateLimitConfig
- type LeaderElectionConfig
- type LeaderElectionLeaseConfig
- type LeaderElectionLockConfig
- type MetricsConfig
- type PProfConfig
- type TLSConfig
- type TLSPreSharedKeyConfig
- type TracingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlagsForKubeClient ¶
func FlagsForKubeClient(prefix string, c *KubeClientConfig) *pflag.FlagSet
func FlagsForLeaderElection ¶
func FlagsForLeaderElection(name, prefix string, c *LeaderElectionConfig) *pflag.FlagSet
func FlagsForLeaderElectionLease ¶
func FlagsForLeaderElectionLease(prefix string, c *LeaderElectionLeaseConfig) *pflag.FlagSet
func FlagsForLeaderElectionLock ¶
func FlagsForLeaderElectionLock(name, prefix string, c *LeaderElectionLockConfig) *pflag.FlagSet
func FlagsForMetrics ¶
func FlagsForMetrics(prefix string, c *MetricsConfig) *pflag.FlagSet
func FlagsForPProfConfig ¶
func FlagsForPProfConfig(prefix string, c *PProfConfig) *pflag.FlagSet
func FlagsForTracing ¶
func FlagsForTracing(prefix string, c *TracingConfig) *pflag.FlagSet
Types ¶
type ControllerConfig ¶
type ControllerConfig struct { Log log.ConfigSet `json:"log" yaml:"log"` KubeClient KubeClientConfig `json:"kubeClient" yaml:"kubeClient"` Metrics MetricsConfig `json:"metrics" yaml:"metrics"` Tracing TracingConfig `json:"tracing" yaml:"tracing"` LeaderElection LeaderElectionConfig `json:"leaderElection" yaml:"leaderElection"` PProf PProfConfig `json:"pprof" yaml:"pprof"` }
type KubeClientConfig ¶
type KubeClientConfig struct { // Fake to create a fake client instead of creating real kubernetes client Fake bool `json:"fake" yaml:"fake"` KubeconfigPath string `json:"kubeconfig" yaml:"kubeconfig"` RateLimit KubeClientRateLimitConfig `json:"rateLimit" yaml:"rateLimit"` }
func (*KubeClientConfig) NewKubeClient ¶
func (c *KubeClientConfig) NewKubeClient( kubeconfig *rest.Config, applyRateLimitConfig bool, ) (client kubernetes.Interface, _ *rest.Config, err error)
NewKubeClient creates a kubernetes client with/without existing kubeconfig if nil kubeconfig was provided, then will retrieve kubeconfig from configured path and will fallback to in cluster kubeconfig you can choose whether rate limit config is applied, if not, will use default rate limit config
type LeaderElectionConfig ¶
type LeaderElectionConfig struct { Identity string `json:"identity" yaml:"identity"` Lock LeaderElectionLockConfig `json:"lock" yaml:"lock"` Lease LeaderElectionLeaseConfig `json:"lease" yaml:"lease"` }
func (*LeaderElectionConfig) CreateElector ¶
func (c *LeaderElectionConfig) CreateElector( name string, kubeClient kubernetes.Interface, eventRecorder record.EventRecorder, onElected func(context.Context), onEjected func(), onNewLeader func(identity string), ) (*leaderelection.LeaderElector, error)
type LeaderElectionLeaseConfig ¶
type LeaderElectionLeaseConfig struct { Expiration time.Duration `json:"expiration" yaml:"expiration"` RenewDeadline time.Duration `json:"renewDeadline" yaml:"renewDeadline"` RenewInterval time.Duration `json:"renewInterval" yaml:"renewInterval"` ExpiryToleration time.Duration `json:"expiryToleration" yaml:"expiryToleration"` }
type MetricsConfig ¶
type MetricsConfig struct { // Enabled metrics collection Enabled bool `json:"enabled" yaml:"enabled"` // Endpoint address for metrics/tracing collection, // for prometheus, it's a listen address (SHOULD NOT be empty or use random port (:0)) // for otlp, it's the otlp collector address Endpoint string `json:"listen" yaml:"listen"` // Format of exposed metrics Format string `json:"format" yaml:"format"` // HTTPPath for metrics collection HTTPPath string `json:"httpPath" yaml:"httpPath"` // TLS config for client/server TLS TLSConfig `json:"tls" yaml:"tls"` }
func (*MetricsConfig) RegisterIfEnabled ¶
type PProfConfig ¶
type PProfConfig struct { Enabled bool `json:"enabled" yaml:"enabled"` Listen string `json:"listen" yaml:"listen"` HTTPPath string `json:"httpPath" yaml:"httpPath"` MutexProfileFraction int `json:"mutexProfileFraction" yaml:"mutexProfileFraction"` BlockProfileRate int `json:"blockProfileRate" yaml:"blockProfileRate"` }
func (*PProfConfig) RunIfEnabled ¶
func (c *PProfConfig) RunIfEnabled() error
type TLSConfig ¶
type TLSConfig struct { Enabled bool `json:"enabled" yaml:"enabled"` CaCert string `json:"caCert" yaml:"caCert"` Cert string `json:"cert" yaml:"cert"` Key string `json:"key" yaml:"key"` CaCertData string `json:"caCertData" yaml:"caCertData"` CertData string `json:"certData" yaml:"certData"` KeyData string `json:"keyData" yaml:"keyData"` ServerName string `json:"serverName" yaml:"serverName"` InsecureSkipVerify bool `json:"insecureSkipVerify" yaml:"insecureSkipVerify"` // write tls session shared key to this file KeyLogFile string `json:"keyLogFile" yaml:"keyLogFile"` CipherSuites []string `json:"cipherSuites" yaml:"cipherSuites"` // options for dtls AllowInsecureHashes bool `json:"allowInsecureHashes" yaml:"allowInsecureHashes"` }
nolint:maligned
type TLSPreSharedKeyConfig ¶
type TracingConfig ¶
type TracingConfig struct { // Enabled tracing stats Enabled bool `json:"enabled" yaml:"enabled"` // Format of exposed tracing stats Format string `json:"format" yaml:"format"` // EndpointType the type of collector (used for jaeger), can be one of [agent, collector] EndpointType string `json:"endpointType" yaml:"endpointType"` // Endpoint to report tracing stats Endpoint string `json:"endpoint" yaml:"endpoint"` // SampleRate SampleRate float64 `json:"sampleRate" yaml:"sampleRate"` // ReportedServiceName used when reporting tracing stats ReportedServiceName string `json:"serviceName" yaml:"serviceName"` // TLS config for client/server TLS TLSConfig `json:"tls" yaml:"tls"` }
func (*TracingConfig) RegisterIfEnabled ¶
Click to show internal directories.
Click to hide internal directories.