blob: 7586b10dbd8589caabbbac9bd35b43f5be22adfe [file] [log] [blame]
diff --git a/pkg/registry/core/service/portallocator/allocator.go b/pkg/registry/core/service/portallocator/allocator.go
--- a/pkg/registry/core/service/portallocator/allocator.go (revision f66044f4361b9f1f96f0053dd46cb7dce5e990a8)
+++ b/pkg/registry/core/service/portallocator/allocator.go (revision f42349f2a3ed203fc06462b9f28e90c0b857cb42)
@@ -25,6 +25,7 @@
"k8s.io/kubernetes/pkg/registry/core/service/allocator"
"k8s.io/klog/v2"
+ "source.monogon.dev/metropolis/node"
)
// Interface manages the allocation of ports out of a range. Interface
@@ -70,6 +71,12 @@
}
var err error
a.alloc, err = allocatorFactory(max, rangeSpec)
+
+ for _, p := range node.SystemPorts {
+ // We ignore errors as these could only happen if the port we try to
+ // allocate is out of range, which we dont really care about.
+ _, _ = a.alloc.Allocate(int(p))
+ }
return a, err
}