fix: make the statefulset reconciliation wait for secret creation#31646
fix: make the statefulset reconciliation wait for secret creation#31646vmuzikar merged 1 commit intokeycloak:mainfrom
Conversation
1454ddc to
1981e47
Compare
Ok, this has been updated to switch from using depends on to manual invocation of the statefulset dependent. cc @vmuzikar |
switching to manual invocation of statefulset reconciliation closes: keycloak#30004 Signed-off-by: Steve Hawkins <[email protected]> * Update docs/guides/operator/advanced-configuration.adoc Co-authored-by: Václav Muzikář <[email protected]> Signed-off-by: Steven Hawkins <[email protected]> * enhance: add bootstrap admin handling to the operator closes: keycloak#30004 Signed-off-by: Steve Hawkins <[email protected]> --------- Signed-off-by: Steve Hawkins <[email protected]> Signed-off-by: Steven Hawkins <[email protected]> Co-authored-by: Václav Muzikář <[email protected]>
Had to switch to manual creation of the statefulset dependent as well. Using Application or Depedent scope doesn't work with this version of the operator sdk because the re-initialization of the depedent is inconplete and it ends up with a reference to the old Kubernetes client. I believe this was addressed in later versions of the operator sdk. |
|
@ahus1 yes, we should be able to merge this |
closes: #30004
@ahus1 @vmuzikar the issue here is that adding the KeycloakAdminSecretDependentResource EnabledCondition is causing the KeycloakAdminSecretDependentResource to be run more routinely after the KeycloakDeploymentDependentResource. When that happens it's creating another revision of the StatefulSet because the initial one is marked as having a missing secret. I'm not sure why yet, but that StatefulSet revision is not rolled out to the Pods in the test case with a non-existent image. So the Pods are staying at the initial revision, which causes the logic that scrapes the Pod status for the Keycloak status error message to not work.
In general it would be good to avoid creating these short lived versions of the StatefulSet, so I added a depends on dependency between the two dependents.
Another solution / refinement, that is more involved, would be to only use the missing annotations for optional Secrets / ConfigMaps - or to simply let the optional case be handled by the general poll interval.