Skip to content

Commit

Permalink
Add more topology keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dtomcej committed May 1, 2020
1 parent c06f510 commit a891ae3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ func (s *ShadowServiceManager) Create(userSvc *corev1.Service) error {

// If the kubernetes server version is 1.17+, then use the topology key.
if major == 1 && minor >= 17 {
svc.Spec.TopologyKeys = []string{"kubernetes.io/hostname", "*"}
svc.Spec.TopologyKeys = []string{
"kubernetes.io/hostname",
"topology.kubernetes.io/zone",
"topology.kubernetes.io/region",
"*",
}
}

if _, err = s.kubeClient.CoreV1().Services(s.namespace).Create(svc); err != nil {
Expand Down

0 comments on commit a891ae3

Please sign in to comment.