Skip to content

Commit

Permalink
feat: Add zone and region to preferred pod affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 5, 2023
1 parent 28103f8 commit 3d5ef7a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/util/cmd_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,24 @@ func createJob(cmd *cobra.Command, conf *config.Global, actionName string) error
},
},
},
{
Weight: 90,
PodAffinityTerm: corev1.PodAffinityTerm{
TopologyKey: "topology.kubernetes.io/zone",
LabelSelector: &metav1.LabelSelector{
MatchLabels: conf.Pod.ObjectMeta.Labels,
},
},
},
{
Weight: 80,
PodAffinityTerm: corev1.PodAffinityTerm{
TopologyKey: "topology.kubernetes.io/region",
LabelSelector: &metav1.LabelSelector{
MatchLabels: conf.Pod.ObjectMeta.Labels,
},
},
},
},
},
},
Expand Down

0 comments on commit 3d5ef7a

Please sign in to comment.