diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml
index 782a58df4774e55e620b873fbdcce05f0c1c8317..ee6ad901a6649b7cbf7fc2cf6196bf06ebdb54ce 100644
--- a/chart/templates/deployment.yaml
+++ b/chart/templates/deployment.yaml
@@ -52,6 +52,11 @@ spec:
         {{ toYaml .Values.nodeSelector | nindent 8 }}
       {{- end }}
 
+      {{- if gt (len .Values.affinity) 0 }}
+      affinity:
+        {{ toYaml .Values.affinity | nindent 8 }}
+      {{- end }}
+
       {{- if $.Values.networking.enabled }}
       hostNetwork: true
       {{- end }}
diff --git a/chart/values.yaml b/chart/values.yaml
index 041cb4ea0eba53d895ebec8f7975916172d4dd91..6aa3876e355041eee7434968001f0e3c0c7643a8 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -110,6 +110,9 @@ additionalTolerations: []
 nodeSelector: {}
   # node-role.kubernetes.io/control-plane: ""
 
+# Set the affinity for pods. (Only works with kind=Deployment)
+affinity: {}
+
 robot:
   # Set to true to enable support for Robot (Dedicated) servers.
   enabled: false