spotify/flink-on-k8s-operator

Validation Error `nodeaffinity` rule for the flinkcluster

rupeshmore85 opened this issue · 2 comments

We are trying to define nodeaffinity rules for the jobmanager/taskmanager pods, so that they are hosted on a specific availability zone. However we get a ValidationError excpetion while deploying the flinkcluster. Can anyone please suggest if the spec is correct for the FlinkCluster? We couldn't find any examples of defining NodeAffinity rules for the FlinkCluster.
Thank you!

spec:
  jobManager:
    affinity:
      nodeAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
                - key: topology.kubernetes.io/zone
                  operator: In
                  values:
                    - us-east-1a
  taskManager:
    affinity:
      nodeAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
                - key: topology.kubernetes.io/zone
                  operator: In
                  values:
                    - us-east-1a

error: error validating ".": error validating data: [ValidationError(FlinkCluster.spec.jobManager): unknown field "affinity" in io.k8s.flinkoperator.v1beta1.FlinkCluster.spec.jobManager, ValidationError(FlinkCluster.spec.taskManager): unknown field "affinity" in io.k8s.flinkoperator.v1beta1.FlinkCluster.spec.taskManager]; if you choose to ignore these errors, turn validation off with --validate=false

Hi @rupeshmore85 this was only added recently, and it hasn't been released yet.