How much time trident operator pod takes to spin up during the upgrade or restart
Applies to
Astra Trident
Answer
It completely depends on the time taken to pull the operator image from online or offline.
Additional Information
Source code: https://github.com/netapp/trident/blob/master/operator/controllers/orchestrator/installer/installer.go
// Try to identify the reason for container not running, it could be a
// temporary error due to latency in pulling the image or a more
// permanent error like ImagePullBackOff.
tempError := true
containerErrors := make(map[string]string)
if pod != nil {
for _, containerStatus := range pod.Status.ContainerStatuses {
// If there exists a container still in creating state verify that
// the reason for waiting is "ContainerCreating" and nothing else
// like ImagePullBackOff
if containerStatus.State.Waiting != nil {
if containerStatus.State.Waiting.Reason != "ContainerCreating" {
tempError = false
containerErrors[containerStatus.Name] = " Reason: " + containerStatus.State.Waiting.
Reason + ", " +
"Message: " + containerStatus.State.Waiting.Message
}
}
}
}
podNotify := func(err error, duration time.Duration) {
Log().WithFields(LogFields{
"increment": duration,
}).Debugf("Trident pod not yet running, waiting.")
}
podBackoff := backoff.NewExponentialBackOff()
podBackoff.MaxElapsedTime = k8sTimeout
Log().Info("Waiting for Trident pod to start.")
if err := backoff.RetryNotify(checkPodRunning, podBackoff, podNotify); err != nil {
totalWaitTime := k8sTimeout
// In case pod is still creating and taking extra time due to issues such as latency in pulling
// container image, then additional time should be allocated for the pod to come online.
if errors.IsTempOperatorError(err) {
extraWaitTime := 150 * time.Second
totalWaitTime = totalWaitTime + extraWaitTime
podBackoff.MaxElapsedTime = extraWaitTime
Log().Debugf("Pod is still provisioning after %3.2f seconds, "+
"waiting %3.2f seconds extra.", k8sTimeout.Seconds(), extraWaitTime.Seconds())
err = backoff.RetryNotify(checkPodRunning, podBackoff, podNotify)
}