Skip to content

Conversation

@FxKu
Copy link
Member

@FxKu FxKu commented Jan 29, 2024

closes #2057

This PR removes the hard-coded internal defaults for the (default) resource config options for Spilo and pooler pods allowing for not setting resources at all while relying on the K8s environment to handle it.

This means deployments lacking a resource section and a config map with no defaults defined are likely to fail because memory/cpu request (and memory limits) are missing.

The PR also adds a safeguard function matchLimitsWithRequestsIfSmaller for situations where limits are smaller than the actual requests, e.g. if no limit is specified in the manifest and the operator falls back on a default value which is still lower than the request.

@FxKu FxKu added this to the 1.11.0 milestone Jan 29, 2024
@idanovinda
Copy link
Member

👍

1 similar comment
@FxKu
Copy link
Member Author

FxKu commented Feb 9, 2024

👍

@FxKu FxKu merged commit 29ea863 into master Feb 9, 2024
@FxKu FxKu deleted the no-cpu-limit branch February 9, 2024 06:35
@antverpp
Copy link

This is not working. I updated my operator to 1.11.0. I remove setting the cpu limits, but still receive “1” on limits. The same if I set “0” - it still makes “1”

@ktalo
Copy link

ktalo commented Jun 14, 2024

This is not working. I updated my operator to 1.11.0. I remove setting the cpu limits, but still receive “1” on limits. The same if I set “0” - it still makes “1”

If you have installed using the helm chart, the defaults are still set in

# configure resource requests for the Postgres pods
and thus end up in your operator's config. You need to update your operator using a values that unset those (i.e.. set to null).

@marcofunstage
Copy link

Hi @ktalo,
I set the following configuration, but doesn't work; setting empty value, restarting postgres or the operator pods didn't help either

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: postgres-operator
  namespace: postgres-operator
spec:
  interval: 5m
  chart:
    spec:
      chart: postgres-operator
      version: '1.12.0'
      sourceRef:
        kind: HelmRepository
        name: zalando-postgres-operator
        namespace: flux-system
      interval: 60m
  values:
    configKubernetes:
      enable_cross_namespace_secret: true
    configMajorVersionUpgrade:
      major_version_upgrade_mode: "manual"
    configPostgresPodResources:
      default_cpu_limit: "0"

@ktalo
Copy link

ktalo commented Jun 27, 2024

If you still have old CRDs present, the defaults are there, too. The CRDs won't get updated with helm upgrade. The default limits are in CRD operatorconfigurations.acid.zalan.do and that needs to be updated too.

EDIT: and for operator config, I had success with the following helm values:

configPostgresPodResources:
  default_cpu_limit: null
  default_cpu_request: null
  default_memory_limit: null
  default_memory_request: null
  min_cpu_limit: null
  min_memory_limit: null

@ecniiv ecniiv mentioned this pull request Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow setting null resource requests / limits

6 participants