lyft / flinkk8soperator

Kubernetes operator that provides control plane for managing Apache Flink applications
Apache License 2.0
569 stars 159 forks source link

nodeSelector does not get picked up #250

Open sushraju opened 2 years ago

sushraju commented 2 years ago

We are trying to set the nodeSelector attribute in the taskManagerConfig and jobManagerConfig, but, it gets ignored.

jobManagerConfig:
    nodeSelector:
     instancezone: primary
    resources:
      requests:
        memory: "1Gi"
        cpu: "500m"
      limits:
        memory: "1Gi"
    envConfig:
...

Here's how it is being defined in the schema:

jobManagerConfig:
              type: object
              properties:
                replicas:
                  type: integer
                  minimum: 1
                offHeapMemoryFraction:
                  type: number
                  minimum: 0
                  maximum: 1
                systemMemoryFraction:
                  type: number
                  minimum: 0
                  maximum: 1
                nodeSelector:
                  type: object
                  properties:
                    additionalProperties:
                      type: string
taskManagerConfig:
              type: object
              properties:
                taskSlots:
                  type: integer
                  minimum: 1
                offHeapMemoryFraction:
                  type: number
                  minimum: 0
                  maximum: 1
                systemMemoryFraction:
                  type: number
                  minimum: 0
                  maximum: 1
                nodeSelector:
                  type: object
                  properties:
                    additionalProperties:
                      type: string
sushraju commented 2 years ago

So, in k8s 1.20 we added x-kubernetes-preserve-unknown-fields: true to the validation schema. That seems to help for now.