Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePodTemplate ¶
func GeneratePodTemplate(operatorSpec *operatorv1.StaticPodOperatorSpec, command []string, targetNamespace, targetName, targetImagePullSpec, logFile string) (string, error)
func NewCommand ¶
func NewCommand(check ReadinessChecker, newOperatorClient func(config *rest.Config) (operatorclientv1.KubeAPIServerInterface, error)) *cobra.Command
NewCommand creates the startup-monitor cobra command. TODO: make generic for other operators. Note: normal operator client has informers that must be started and setup. We rather do not want that here.
Types ¶
type Monitor ¶
type Monitor interface {
// Run checks the target for readiness and returns with true if the all readiness
// checks return true within the given timeout duration, or false if the timeout
// has passed. It will return an error if the context is done before the timeout
// expired.
//
// When Run returns without error, the lock is kept (and must be released by the caller.
// In the case it does neither timeout nor the target gets ready, the lock is released.
//
// installerLock blocks the installer from running in parallel. The monitor will run
// every iteration of the probe interval with this lock taken. When Run returns
// without error, the lock is kept (and must be released by the caller.
// In the case it does neither timeout nor the target gets ready, the lock is released.
Run(ctx context.Context, installerLock Locker) (ready bool, reason string, message string, err error)
}
type Options ¶
type Options struct {
// Revision identifier for this particular installation instance
Revision int
// NodeName as used to update the right nodeStatus struct in the static pod operator resource
NodeName string
// FallbackTimeout specifies a timeout after which the monitor starts the fall back procedure
FallbackTimeout time.Duration
// ResourceDir directory that holds all files supporting the static pod manifest
ResourceDir string
// ManifestDir directory for the static pod manifest
ManifestDir string
// TargetName identifies operand used to construct the final file name when reading the current and previous manifests
TargetName string
// KubeConfig file for authn/authz against Kube API
KubeConfig string
// installerLock blocks the installer from running in parallel. The monitor will run
// every iteration of the probe interval with this lock taken.
InstallerLockFile string
// LogFile is the file the logs are written.
LogFile string
// Check is the readiness step.
Check ReadinessChecker
}
type ReadinessChecker ¶
type ReadinessChecker interface {
IsReady(ctx context.Context, revision int) (ready bool, reason string, message string, err error)
}
ReadinessChecker is a contract between the startup monitor and operators.
type ReadinessFunc ¶
type WantsNodeName ¶
type WantsNodeName interface {
SetNodeName(string)
}
WantsNodeName an optional interface used for setting the current node name
type WantsRestConfig ¶
WantsRestConfig an optional interface used for setting rest config for Kube API
Source Files
¶
Click to show internal directories.
Click to hide internal directories.