Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an invalid label causes whole cluster to be removed #1420

Open
alexvanolst opened this issue May 17, 2024 · 4 comments
Open

Adding an invalid label causes whole cluster to be removed #1420

alexvanolst opened this issue May 17, 2024 · 4 comments
Labels
question Topic starter is waiting for reply

Comments

@alexvanolst
Copy link

Operator version: 0.23.5

Adding an invalid label to a podtemplate, eventually causes the operator to delete all statefulsets during reconciliation, regardless of settings.

I have the following settings:

    runtime:
        reconcileCHIsThreadsNumber: 10
        reconcileShardsThreadsNumber: 5
        reconcileShardsMaxConcurrencyPercent: 50
        threadsNumber: 0
    statefulSet:
        create:
            onFailure: abort
        update:
            timeout: 300
            pollInterval: 5
            onFailure: rollback
    host:
        wait:
            exclude: "true"
            queries: "true"
            include: "false"

After adding an invalid label to spec.templates.podTemplates[0].metadata.label e.g. some_bad_label: '/metrics' the operator tries to recreate the statefulsets but encounters the following error:

E0508 13:36:35.377188       1 creator.go:46] createStatefulSet():StatefulSet create failed. err: StatefulSet.apps "chi-clickhouse-store-0-0" is invalid: spec.template.labels: Invalid value: "/metrics": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')

My expected behavior is:
After failing to create the statefulset the operator either aborts or rolls back

Actual behavior:
After some time period, the operator moves to the next statefulset until all are deleted (and not recreated due to error)

@sunsingerus
Copy link
Collaborator

Please check these behaviors:

# What to do in case updated StatefulSet is not in 'Ready' after `reconcile.statefulSet.update.timeout` seconds

@sunsingerus
Copy link
Collaborator

sunsingerus commented May 17, 2024

Try to modify

update:
            onFailure: rollback

to

update:
            onFailure: abort

@sunsingerus sunsingerus reopened this May 17, 2024
@sunsingerus
Copy link
Collaborator

rollback needs to be checked

@sunsingerus sunsingerus added the question Topic starter is waiting for reply label May 17, 2024
@alexvanolst
Copy link
Author

@sunsingerus

I checked this with

update:
            onFailure: abort

and I still get the exact same behavior. After ~15mins it continues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Topic starter is waiting for reply
Projects
None yet
Development

No branches or pull requests

2 participants