Documentation ¶
Index ¶
- Variables
- func CheckK8sClientMinimumVersionOrDie(ctx context.Context, logger *zap.SugaredLogger)
- func ControllersAndWebhooksFromCtors(ctx context.Context, cmw *cminformer.InformedWatcher, ...) ([]*controller.Impl, []interface{})
- func EnableInjectionOrDie(ctx context.Context, cfg *rest.Config) context.Context
- func GetLeaderElectionConfig(ctx context.Context) (*leaderelection.Config, error)
- func GetLoggingConfig(ctx context.Context) (*logging.Config, error)
- func GetObservabilityConfig(ctx context.Context) (*metrics.ObservabilityConfig, error)
- func IsHADisabled(ctx context.Context) bool
- func Main(component string, ctors ...injection.ControllerConstructor)
- func MainNamed(ctx context.Context, component string, ...)
- func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, ...)
- func MainWithContext(ctx context.Context, component string, ...)
- func SecretFetcher(ctx context.Context) metrics.SecretFetcher
- func SetupConfigMapWatchOrDie(ctx context.Context, logger *zap.SugaredLogger) *cminformer.InformedWatcher
- func SetupLoggerOrDie(ctx context.Context, component string) (*zap.SugaredLogger, zap.AtomicLevel)
- func SetupObservabilityOrDie(ctx context.Context, component string, logger *zap.SugaredLogger, ...)
- func WatchLoggingConfigOrDie(ctx context.Context, cmw *cminformer.InformedWatcher, ...)
- func WatchObservabilityConfigOrDie(ctx context.Context, cmw *cminformer.InformedWatcher, ...)
- func WithHADisabled(ctx context.Context) context.Context
- func WithHealthProbesDisabled(ctx context.Context) context.Context
Constants ¶
This section is empty.
Variables ¶
var ( WebhookMainWithContext = MainWithContext WebhookMainWithConfig = MainWithConfig )
Legacy aliases for back-compat.
Functions ¶
func CheckK8sClientMinimumVersionOrDie ¶
func CheckK8sClientMinimumVersionOrDie(ctx context.Context, logger *zap.SugaredLogger)
CheckK8sClientMinimumVersionOrDie checks that the hosting Kubernetes cluster is at least the minimum allowable version or dies by calling log.Fatalw.
func ControllersAndWebhooksFromCtors ¶
func ControllersAndWebhooksFromCtors(ctx context.Context, cmw *cminformer.InformedWatcher, ctors ...injection.ControllerConstructor, ) ([]*controller.Impl, []interface{})
ControllersAndWebhooksFromCtors returns a list of the controllers and a list of the webhooks created from the given constructors.
func EnableInjectionOrDie ¶
EnableInjectionOrDie enables Knative Injection and starts the informers. Both Context and Config are optional. Deprecated: use injection.EnableInjectionOrDie
func GetLeaderElectionConfig ¶
func GetLeaderElectionConfig(ctx context.Context) (*leaderelection.Config, error)
GetLeaderElectionConfig gets the leader election config from the (in order): 1. provided context, 2. reading from the API server, 3. defaults (if not found).
func GetLoggingConfig ¶
GetLoggingConfig gets the logging config from the (in order): 1. provided context, 2. reading from the API server, 3. defaults (if not found). The context is expected to be initialized with injection.
func GetObservabilityConfig ¶
func GetObservabilityConfig(ctx context.Context) (*metrics.ObservabilityConfig, error)
GetObservabilityConfig gets the observability config from the (in order): 1. provided context, 2. reading from the API server, 3. defaults (if not found).
func IsHADisabled ¶
IsHADisabled checks the context for the desired to disabled leader elector.
func Main ¶
func Main(component string, ctors ...injection.ControllerConstructor)
Main runs the generic main flow with a new context. If any of the constructed controllers are AdmissionControllers or Conversion webhooks, then a webhook is started to serve them.
func MainNamed ¶
func MainNamed(ctx context.Context, component string, ctors ...injection.NamedControllerConstructor)
MainNamed runs the generic main flow for controllers and webhooks.
In addition to the MainWithConfig flow, it defines a `disabled-controllers` flag that allows disabling controllers by name.
func MainWithConfig ¶
func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, ctors ...injection.ControllerConstructor)
MainWithConfig runs the generic main flow for controllers and webhooks with the given config.
func MainWithContext ¶
func MainWithContext(ctx context.Context, component string, ctors ...injection.ControllerConstructor)
MainWithContext runs the generic main flow for controllers and webhooks. Use MainWithContext if you do not need to serve webhooks.
func SecretFetcher ¶
func SecretFetcher(ctx context.Context) metrics.SecretFetcher
SecretFetcher provides a helper function to fetch individual Kubernetes Secrets (for example, a key for client-side TLS). Note that this is not intended for high-volume usage; the current use is when establishing a metrics client connection in WatchObservabilityConfigOrDie.
func SetupConfigMapWatchOrDie ¶
func SetupConfigMapWatchOrDie(ctx context.Context, logger *zap.SugaredLogger) *cminformer.InformedWatcher
SetupConfigMapWatchOrDie establishes a watch of the configmaps in the system namespace that are labeled to be watched or dies by calling log.Fatalw.
func SetupLoggerOrDie ¶
func SetupLoggerOrDie(ctx context.Context, component string) (*zap.SugaredLogger, zap.AtomicLevel)
SetupLoggerOrDie sets up the logger using the config from the given context and returns a logger and atomic level, or dies by calling log.Fatalf.
func SetupObservabilityOrDie ¶
func SetupObservabilityOrDie(ctx context.Context, component string, logger *zap.SugaredLogger, profilingHandler *profiling.Handler)
SetupObservabilityOrDie sets up the observability using the config from the given context or dies by calling log.Fatalf.
func WatchLoggingConfigOrDie ¶
func WatchLoggingConfigOrDie(ctx context.Context, cmw *cminformer.InformedWatcher, logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel, component string)
WatchLoggingConfigOrDie establishes a watch of the logging config or dies by calling log.Fatalw. Note, if the config does not exist, it will be defaulted and this method will not die.
func WatchObservabilityConfigOrDie ¶
func WatchObservabilityConfigOrDie(ctx context.Context, cmw *cminformer.InformedWatcher, profilingHandler *profiling.Handler, logger *zap.SugaredLogger, component string)
WatchObservabilityConfigOrDie establishes a watch of the observability config or dies by calling log.Fatalw. Note, if the config does not exist, it will be defaulted and this method will not die.
func WithHADisabled ¶
WithHADisabled signals to MainWithConfig that it should not set up an appropriate leader elector for this component.
Types ¶
This section is empty.