You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Anshul1128 (via GitHub)" <gi...@apache.org> on 2024/01/02 09:15:25 UTC

Re: [PR] Adding affinity rule. [flink-kubernetes-operator]

Anshul1128 commented on code in PR #737:
URL: https://github.com/apache/flink-kubernetes-operator/pull/737#discussion_r1439265099


##########
helm/flink-kubernetes-operator/templates/flink-operator.yaml:
##########
@@ -55,6 +55,24 @@ spec:
       {{- if .Values.operatorPod.nodeSelector }}
       nodeSelector: {{ toYaml .Values.operatorPod.nodeSelector | nindent 8 }}
       {{- end }}
+      {{- if .Values.operatorPod.affinity }}
+      affinity:
+        podAntiAffinity: {{ if eq .Values.operatorPod.affinity.type "requiredDuringSchedulingIgnoredDuringExecution"}}
+          {{ .Values.operatorPod.affinity.type }}:
+          - labelSelector:
+              matchLabels:
+                {{- include "flink-operator.labels" . | nindent 16 }}
+            topologyKey: "kubernetes.io/hostname"
+          {{ else }}
+          {{ .Values.operatorPod.affinity.type }}:
+            - weight: 100
+              podAffinityTerm:
+                labelSelector:
+                  matchLabels:
+                    {{- include "flink-operator.labels" . | nindent 20 }}
+                topologyKey: "kubernetes.io/hostname"

Review Comment:
   Thank you for bringing up the discussion. I've given it some thought, and I agree with your suggestion to let users specify the affinity object so we can enhance robustness and flexibility. I believe this change will contribute to a more adaptable system. Let me create a JIRA ticket and push new changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org