zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 980 forks source link

Default cpu limits #2804

Open ecniiv opened 1 day ago

ecniiv commented 1 day ago

Please, answer some short questions which should help us to understand your problem / question better?

HI, i saw this PR: #2524 that should resolve the default cpu limit problems, but using the v1.13.0 postgres operator image I still can't let the cpu limits empty, the operator will update the statefulset:

time="2024-11-20T16:09:08Z" level=info msg="statefulset test/test is not in the desired state and needs to be updated" cluster-name=test/test pkg=cluster worker=7
time="2024-11-20T16:09:08Z" level=debug msg="+              cpu: 1," cluster-name=test/test pkg=cluster worker=7

In the PR #2524 I see the doc updated for default_cpu_limit parameters:

Empty string or `0` disables the default.

but the doc here seems not updated, and if I try:

  resources:
    requests:
      cpu: 100m
      memory: 100Mi
    limits:
      cpu: ""
      memory: 250Mi

I'm getting The postgresql "test" is invalid: spec.resources.limits.cpu: Invalid value: "": spec.resources.limits.cpu in body should match '^(\d+m|\d+(\.\d{1,3})?)$'

Maybe I'm missing something. Thx

FxKu commented 2 hours ago

What happens when you specify limits without cpu? Anyway, the schema validation has been updated in #2735. It's just not part of a release, yet.

ecniiv commented 2 hours ago

When I specify limits without settings cpu, the statefulset is created with limits.cpu: 1, In the operator configuration, I have set all the default/min cpu limit to null;

default_cpu_limit: null
min_cpu_limit: null

Don't understand why the operator set the limits.cpu to 1 in the statefulset

Ok, I see, thanks