Documentation ¶
Index ¶
- func CheckK8sClientMinimumVersionOrDie(ctx context.Context, logger *zap.SugaredLogger)
- func ControllersAndWebhooksFromCtors(ctx context.Context, cmw *configmap.InformedWatcher, ...) ([]*controller.Impl, []interface{})
- func GetConfig(masterURL, kubeconfig string) (*rest.Config, error)
- func GetLeaderElectionConfig(ctx context.Context) (*kle.Config, error)
- func GetLoggingConfig(ctx context.Context) (*logging.Config, error)
- func Main(component string, ctors ...injection.ControllerConstructor)
- func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, ...)
- func MainWithContext(ctx context.Context, component string, ...)
- func MemStatsOrDie(ctx context.Context)
- func ParseAndGetConfigOrDie() *rest.Config
- func RunLeaderElected(ctx context.Context, logger *zap.SugaredLogger, run func(context.Context), ...)
- func SetupConfigMapWatchOrDie(ctx context.Context, logger *zap.SugaredLogger) *configmap.InformedWatcher
- func SetupLoggerOrDie(ctx context.Context, component string) (*zap.SugaredLogger, zap.AtomicLevel)
- func WatchLoggingConfigOrDie(ctx context.Context, cmw *configmap.InformedWatcher, logger *zap.SugaredLogger, ...)
- func WatchObservabilityConfigOrDie(ctx context.Context, cmw *configmap.InformedWatcher, ...)
- func WebhookMainWithConfig(ctx context.Context, component string, cfg *rest.Config, ...)
- func WebhookMainWithContext(ctx context.Context, component string, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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.Fatalf.
func ControllersAndWebhooksFromCtors ¶
func ControllersAndWebhooksFromCtors(ctx context.Context, cmw *configmap.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 GetConfig ¶
GetConfig returns a rest.Config to be used for kubernetes client creation. It does so in the following order:
- Use the passed kubeconfig/masterURL.
- Fallback to the KUBECONFIG environment variable.
- Fallback to in-cluster config.
- Fallback to the ~/.kube/config.
func GetLeaderElectionConfig ¶
GetLeaderElectionConfig gets the leader election config.
func GetLoggingConfig ¶
GetLoggingConfig gets the logging config from either the file system if present or via reading a configMap from the API. The context is expected to be initialized with injection.
func Main ¶
func Main(component string, ctors ...injection.ControllerConstructor)
Main runs the generic main flow for non-webhook controllers with a new context. Use WebhookMainWith* if you need to serve webhooks.
func MainWithConfig ¶
func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, ctors ...injection.ControllerConstructor)
MainWithConfig runs the generic main flow for non-webhook controllers. Use WebhookMainWithConfig if you need to serve webhooks.
func MainWithContext ¶
func MainWithContext(ctx context.Context, component string, ctors ...injection.ControllerConstructor)
MainWithContext runs the generic main flow for non-webhook controllers. Use WebhookMainWithContext if you need to serve webhooks.
func MemStatsOrDie ¶
MemStatsOrDie sets up reporting on Go memory usage every 30 seconds or dies by calling log.Fatalf.
func ParseAndGetConfigOrDie ¶
ParseAndGetConfigOrDie parses the rest config flags and creates a client or dies by calling log.Fatalf.
func RunLeaderElected ¶
func RunLeaderElected(ctx context.Context, logger *zap.SugaredLogger, run func(context.Context), component string, leConfig kle.ComponentConfig)
RunLeaderElected runs the given function in leader elected mode. The function will be run only once the leader election lock is obtained.
func SetupConfigMapWatchOrDie ¶
func SetupConfigMapWatchOrDie(ctx context.Context, logger *zap.SugaredLogger) *configmap.InformedWatcher
SetupConfigMapWatchOrDie establishes a watch of the configmaps in the system namespace that are labeled to be watched or dies by calling log.Fatalf.
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 WatchLoggingConfigOrDie ¶
func WatchLoggingConfigOrDie(ctx context.Context, cmw *configmap.InformedWatcher, logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel, component string)
WatchLoggingConfigOrDie establishes a watch of the logging config or dies by calling log.Fatalf. 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 *configmap.InformedWatcher, profilingHandler *profiling.Handler, logger *zap.SugaredLogger, component string)
WatchObservabilityConfigOrDie establishes a watch of the logging config or dies by calling log.Fatalf. Note, if the config does not exist, it will be defaulted and this method will not die.
func WebhookMainWithConfig ¶
func WebhookMainWithConfig(ctx context.Context, component string, cfg *rest.Config, ctors ...injection.ControllerConstructor)
WebhookMainWithConfig runs the generic main flow for controllers and webhooks with the given config. Use MainWithConfig if you do not need to serve webhooks.
func WebhookMainWithContext ¶
func WebhookMainWithContext(ctx context.Context, component string, ctors ...injection.ControllerConstructor)
WebhookMainWithContext runs the generic main flow for controllers and webhooks. Use MainWithContext if you do not need to serve webhooks.
Types ¶
This section is empty.