Refactor egress-selector pods mode to watch pods

Watching pods appears to be the most reliable way to ensure that the
proxy routes and authorizes connections.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson
2022-06-07 03:43:07 -07:00
committed by Brad Davidson
parent 8456d98283
commit 15b8fb962a
4 changed files with 291 additions and 194 deletions

View File

@@ -30,8 +30,17 @@ const (
EgressSelectorModeDisabled = "disabled"
EgressSelectorModePod = "pod"
CertificateRenewDays = 90
StreamServerPort = "10010"
KubeletPort = "10250"
)
// These ports can always be accessed via the tunnel server, at the loopback address.
// Other addresses and ports are only accessible via the tunnel on newer agents, when used by a pod.
var KubeletReservedPorts = map[string]bool{
StreamServerPort: true,
KubeletPort: true,
}
type Node struct {
Docker bool
ContainerRuntimeEndpoint string