fix: apply different network policies based on current target #97
Reference in New Issue
Block a user
No description provided.
Delete Branch "autodetect-k3d-server-ip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the k3d-harmony server IP range is hardcoded in the K8sTenantManager network policy.
Possible fixes
1. Separate implementation of TenantManager for K8s (generic) VS for K3d/s
Introduce an entirely different implementation for K3d/s of the
TenantManager.Pros:
TenantManager, it's fairly simple to create a new implementation and letK8sAnywherepick one or the other based on the client source (e.g.LocalK3d)Cons:
K8sTenantManagerand theK3dTenantManager-> lot of duplication2. Strategies to generate the network policy config
Instead of having 2 entirely different implementations for the
TenantManager, introduce a strategy to generate only the network policy.Pros:
Cons:
3. Strategy to apply changes to the network policy config
Let the
K8sTenantManagerwork as it currently does, but allow for changes of the base config that was generated:Pros:
Cons:
Decision
For now, option (3) seem the best approach: minimal changes to the existing code, no duplication. As we don't know yet how all of this will evolve, it will be easier to change in the future if we were wrong than the other approaches.
Fixes #94
This feels entirely correct. As we discussed, the complexity comes from the
Anywherepart ofK8sAnywheremodule, so it should be solved within the logical boundaries of K8sAnywhere. And all that K8sAnywhere has to do is decide which implementation to delegate to, which a Strategy seems perfectly suited for here.WIP: fix: autodetect k3d-harmony server IPto fix: apply different network policies based on current target113c1b0f9eto51214daf72f7b0b1e0c9to5c8799f6d1