blob: 7586b10dbd8589caabbbac9bd35b43f5be22adfe [file] [log] [blame]
Tim Windelschmidt03000772023-07-03 02:19:28 +02001diff --git a/pkg/registry/core/service/portallocator/allocator.go b/pkg/registry/core/service/portallocator/allocator.go
2--- a/pkg/registry/core/service/portallocator/allocator.go (revision f66044f4361b9f1f96f0053dd46cb7dce5e990a8)
3+++ b/pkg/registry/core/service/portallocator/allocator.go (revision f42349f2a3ed203fc06462b9f28e90c0b857cb42)
4@@ -25,6 +25,7 @@
5 "k8s.io/kubernetes/pkg/registry/core/service/allocator"
6
7 "k8s.io/klog/v2"
8+ "source.monogon.dev/metropolis/node"
9 )
10
11 // Interface manages the allocation of ports out of a range. Interface
12@@ -70,6 +71,12 @@
13 }
14 var err error
15 a.alloc, err = allocatorFactory(max, rangeSpec)
16+
17+ for _, p := range node.SystemPorts {
18+ // We ignore errors as these could only happen if the port we try to
19+ // allocate is out of range, which we dont really care about.
20+ _, _ = a.alloc.Allocate(int(p))
21+ }
22 return a, err
23 }
24