Skip to content

Unable to configure tolerations in Operator if configTarget is OperatorConfigurationCRD #1633

@Lebvanih

Description

@Lebvanih
  • Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.6.3
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Bare Metal K8s
  • Are you running Postgres Operator in production? yes
  • Type of issue? Bug report

We are trying to configure the pod tolerations as described in here: https://postgres-operator.readthedocs.io/en/latest/administrator/#use-taints-and-tolerations-for-dedicated-postgresql-nodes, but we can't get it to work. Our deployment is using the OperatorConfiguration Resource rather than the configmap.

Below the lines in our operator logs that shows null for the PodToleration. If we inspect the pod manifest, there is no trace of tolerations either.

time="2021-10-05T09:55:43Z" level=info msg="   \"PodToleration\": null," pkg=controller

And the configuration (relevant part) for the toleration:

apiVersion: acid.zalan.do/v1
kind: OperatorConfiguration
configuration:
  kubernetes:
    toleration:
      postgres: "key:db-only,operator:Exists,effect:NoSchedule"

I am not really familiar with the go language, but I tried to check a bit, and it seems that the values isn't mapped at all in the configuration object when the operator start.

If I check in this file/line:

if configObjectName := os.Getenv("POSTGRES_OPERATOR_CONFIGURATION_OBJECT"); configObjectName != "" {

I understand that if the environment variable is defined, it is a Configuration from CRD (my pod does indeed show that env variable set) and the importConfigurationFromCRD function is used.

If I then follow the importConfigurationFromCRD function here:

func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigurationData) *config.Config {
, I can't find any reference to the PodToleration object... Which make me think, that the values exist in the documentation, but isn't mapped at all if we use the CRD Configuration and not the Configmap. This could explain also, why I couldn't find the key to set this value in the values.yaml file of the helm chart (adding it under configKubernetes does work, but the problem above still exist).

Could you let me know if we are doing something wrong? Or if there is indeed an issue there and we should use the cluster manifest for now to workaround this issue?
Kr,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions