8000 Keycloak Operator 26.3.0 fails to update to 26.3.0 · Issue #40890 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Keycloak Operator 26.3.0 fails to update to 26.3.0 #40890

Closed

Description

@bo0ts

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

operator

Describe the bug

When upgrading the Keycloak Operator to 26.3.0 on an existing Keycloak instance the Keycloak StatefulSet is not updated to the new version. The operator logs the following error:

2025-07-03 11:16:25,467 ERROR [io.jav.ope.pro.eve.EventProcessor] (ReconcilerExecutor-keycloakcontroller-96) Error during event processing ExecutionScope{ resource id: ResourceID{name='keycloak', namespace='keycloak'}, version: 1543606041}: io.javaoperatorsdk.operator.AggregatedOperatorException: Exception(s) during workflow execution. Details:
keycloak-operator-5c854d47ff-xzk42 keycloak-operator  - org.keycloak.operator.controllers.KeycloakDeploymentDependentResource -> io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: PATCH at: https://.../apis/apps/v1/namespaces/keycloak/statefulsets/keycloak?fieldManager=keycloakcontroller&force=true. Message: StatefulSet.apps "keycloak" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden. Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=spec, message=Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden, reason=FieldValueForbidden, additionalProperties={})], group=apps, kind=StatefulSet, name=keycloak, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=StatefulSet.apps "keycloak" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).

Version

26.3.0

Regression

  • The issue is a regression

Expected behavior

The StatefulSet is updated to the new image or automatically recreated.

Actual behavior

The update does not happen.

How to Reproduce?

Install Keycloak Operator 26.2.5, create Keycloak, update to 26.3.0.

Anything else?

No response

Activity

  1. bo0ts commented on Jul 3, 2025

    @bo0ts
    Author

    I suspect this is caused by #39419

  2. added this to the 26.3.0 milestone on Jul 3, 2025
  3. shawkins commented on Jul 3, 2025

    @shawkins
    Contributor

    I suspect this is caused by #39419

    I believe you are correct. We'll have to make that conditional for only new statefulsets.

  4. bo0ts commented on Jul 3, 2025

    @bo0ts
    Author

    @shawkins I believe the operator used to be smart enough to recreate statefulsets when necessary.

  5. shawkins commented on Jul 3, 2025

    @shawkins
    Contributor

    @shawkins I believe the operator used to be smart enough to recreate statefulsets when necessary.

    A few releases back for a label change it has to consider whether to delete the statefulset to make that change. This is just a optional change to the statefulset - there's no need to recreate just for this.

  6. bo0ts commented on Jul 3, 2025

    @bo0ts
    Author

    As a workaround it is possible to simply delete the statefulset and let the operator recreate it.

  7. 4 remaining items

  8. shawkins commented on Jul 3, 2025

    @shawkins
    Contributor

    @shawkins This is quite serious, basically affecting all Operator users. Will you be able to look into a fix? Otherwise I can help with that.

    I am looking at it.

    I wonder if we finally should start testing Operator upgrades.

    There is an upgrade test that I though was catching things like this, but it's specifically for the labeling issue.

    But then we'll have an inconsistency between upgraded StatefulSets, and newly created ones.

    Which is fine.

  9. vmuzikar commented on Jul 3, 2025

    @vmuzikar
    Contributor

    Which is fine.

    Right, just wanted to point that out. The servicename was supposed to help pass some validations. But it doesn't have much value for existing StatefulSets that clearly were not affected by the validations.

  10. added a commit that references this issue on Jul 4, 2025
    9198380
  11. added a commit that references this issue on Jul 5, 2025
    5ab7d54
  12. added a commit that references this issue on Jul 6, 2025
    21d24ff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0