Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support external endpoint #220

Merged
merged 8 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/loxilb-agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ type AgentConfig struct {
NumZoneInst int `yaml:"numZoneInstances,omitempty"`
// If true, direct traffic forwarding from the LoxiLB to pods without NodePort
UsePodNetwork bool `yaml:"usePodNetwork,omitempty"`
// If true, direct traffic forwarding from the LoxiLB to external endpoints
UseExternalEndpoint bool `yaml:"useExternalEndpoint,omitempty"`
}
1 change: 1 addition & 0 deletions cmd/loxilb-agent/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (o *Options) addFlags(fs *pflag.FlagSet) {
fs.BoolVar(&o.config.AppendEPs, "appendEPs", o.config.AppendEPs, "Attach and detach end-points of LB rule")
fs.IntVar(&o.config.NumZoneInst, "numZoneInstances", o.config.NumZoneInst, "Number of HA instances per zone")
fs.BoolVar(&o.config.UsePodNetwork, "usePodNetwork", o.config.UsePodNetwork, "direct traffic forwarding from the LoxiLB to pods without NodePort")
fs.BoolVar(&o.config.UseExternalEndpoint, "useExternalEndpoint", o.config.UseExternalEndpoint, "direct traffic forwarding from the LoxiLB to external endpoints")
}

// complete completes all the required optionst
Expand Down
251 changes: 251 additions & 0 deletions manifest/workloads/multi-port-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
apiVersion: v1
kind: Endpoints
metadata:
name: ext-udp-lb
subsets:
- addresses:
- ip: 192.168.82.3
- ip: 192.168.82.4
ports:
- { port: 5201, name: udp-5201 }
- { port: 5202, name: udp-5202 }
- { port: 5203, name: udp-5203 }
- { port: 5204, name: udp-5204 }
- { port: 5205, name: udp-5205 }
- { port: 5206, name: udp-5206 }
- { port: 5207, name: udp-5207 }
- { port: 5208, name: udp-5208 }
- { port: 5209, name: udp-5209 }
- { port: 5210, name: udp-5210 }
- { port: 5211, name: udp-5211 }
- { port: 5212, name: udp-5212 }
- { port: 5213, name: udp-5213 }
- { port: 5214, name: udp-5214 }
- { port: 5215, name: udp-5215 }
- { port: 5216, name: udp-5216 }
- { port: 5217, name: udp-5217 }
- { port: 5218, name: udp-5218 }
- { port: 5219, name: udp-5219 }
- { port: 5220, name: udp-5220 }
- { port: 5221, name: udp-5221 }
- { port: 5222, name: udp-5222 }
- { port: 5223, name: udp-5223 }
- { port: 5224, name: udp-5224 }
- { port: 5225, name: udp-5225 }
- { port: 5226, name: udp-5226 }
- { port: 5227, name: udp-5227 }
- { port: 5228, name: udp-5228 }
- { port: 5229, name: udp-5229 }
- { port: 5230, name: udp-5230 }
- { port: 5231, name: udp-5231 }
- { port: 5232, name: udp-5232 }
- { port: 5233, name: udp-5233 }
- { port: 5234, name: udp-5234 }
- { port: 5235, name: udp-5235 }
- { port: 5236, name: udp-5236 }
- { port: 5237, name: udp-5237 }
- { port: 5238, name: udp-5238 }
- { port: 5239, name: udp-5239 }
- { port: 5240, name: udp-5240 }
- { port: 5241, name: udp-5241 }
- { port: 5242, name: udp-5242 }
- { port: 5243, name: udp-5243 }
- { port: 5244, name: udp-5244 }
- { port: 5245, name: udp-5245 }
- { port: 5246, name: udp-5246 }
- { port: 5247, name: udp-5247 }
- { port: 5248, name: udp-5248 }
- { port: 5249, name: udp-5249 }
- { port: 5250, name: udp-5250 }
- { port: 5251, name: udp-5251 }
- { port: 5252, name: udp-5252 }
- { port: 5253, name: udp-5253 }
- { port: 5254, name: udp-5254 }
- { port: 5255, name: udp-5255 }
- { port: 5256, name: udp-5256 }
- { port: 5257, name: udp-5257 }
- { port: 5258, name: udp-5258 }
- { port: 5259, name: udp-5259 }
- { port: 5260, name: udp-5260 }
- { port: 5261, name: udp-5261 }
- { port: 5262, name: udp-5262 }
- { port: 5263, name: udp-5263 }
- { port: 5264, name: udp-5264 }
- { port: 5265, name: udp-5265 }
- { port: 5266, name: udp-5266 }
- { port: 5267, name: udp-5267 }
- { port: 5268, name: udp-5268 }
- { port: 5269, name: udp-5269 }
- { port: 5270, name: udp-5270 }
- { port: 5271, name: udp-5271 }
- { port: 5272, name: udp-5272 }
- { port: 5273, name: udp-5273 }
- { port: 5274, name: udp-5274 }
- { port: 5275, name: udp-5275 }
- { port: 5276, name: udp-5276 }
- { port: 5277, name: udp-5277 }
- { port: 5278, name: udp-5278 }
- { port: 5279, name: udp-5279 }
- { port: 5280, name: udp-5280 }
- { port: 5281, name: udp-5281 }
- { port: 5282, name: udp-5282 }
- { port: 5283, name: udp-5283 }
- { port: 5284, name: udp-5284 }
- { port: 5285, name: udp-5285 }
- { port: 5286, name: udp-5286 }
- { port: 5287, name: udp-5287 }
- { port: 5288, name: udp-5288 }
- { port: 5289, name: udp-5289 }
- { port: 5290, name: udp-5290 }
- { port: 5291, name: udp-5291 }
- { port: 5292, name: udp-5292 }
- { port: 5293, name: udp-5293 }
- { port: 5294, name: udp-5294 }
- { port: 5295, name: udp-5295 }
- { port: 5296, name: udp-5296 }
- { port: 5297, name: udp-5297 }
- { port: 5298, name: udp-5298 }
- { port: 5299, name: udp-5299 }
- { port: 5300, name: udp-5300 }
---
apiVersion: v1
kind: Endpoints
metadata:
name: ext-tcp-lb
subsets:
- addresses:
- ip: 192.168.82.3
- ip: 192.168.82.4
ports:
- { port: 5201, name: tcp-5201 }
- { port: 5202, name: tcp-5202 }
- { port: 5203, name: tcp-5203 }
- { port: 5204, name: tcp-5204 }
- { port: 5205, name: tcp-5205 }
- { port: 5206, name: tcp-5206 }
- { port: 5207, name: tcp-5207 }
- { port: 5208, name: tcp-5208 }
- { port: 5209, name: tcp-5209 }
- { port: 5210, name: tcp-5210 }
- { port: 5211, name: tcp-5211 }
- { port: 5212, name: tcp-5212 }
- { port: 5213, name: tcp-5213 }
- { port: 5214, name: tcp-5214 }
- { port: 5215, name: tcp-5215 }
- { port: 5216, name: tcp-5216 }
- { port: 5217, name: tcp-5217 }
- { port: 5218, name: tcp-5218 }
- { port: 5219, name: tcp-5219 }
- { port: 5220, name: tcp-5220 }
- { port: 5221, name: tcp-5221 }
- { port: 5222, name: tcp-5222 }
- { port: 5223, name: tcp-5223 }
- { port: 5224, name: tcp-5224 }
- { port: 5225, name: tcp-5225 }
- { port: 5226, name: tcp-5226 }
- { port: 5227, name: tcp-5227 }
- { port: 5228, name: tcp-5228 }
- { port: 5229, name: tcp-5229 }
- { port: 5230, name: tcp-5230 }
- { port: 5231, name: tcp-5231 }
- { port: 5232, name: tcp-5232 }
- { port: 5233, name: tcp-5233 }
- { port: 5234, name: tcp-5234 }
- { port: 5235, name: tcp-5235 }
- { port: 5236, name: tcp-5236 }
- { port: 5237, name: tcp-5237 }
- { port: 5238, name: tcp-5238 }
- { port: 5239, name: tcp-5239 }
- { port: 5240, name: tcp-5240 }
- { port: 5241, name: tcp-5241 }
- { port: 5242, name: tcp-5242 }
- { port: 5243, name: tcp-5243 }
- { port: 5244, name: tcp-5244 }
- { port: 5245, name: tcp-5245 }
- { port: 5246, name: tcp-5246 }
- { port: 5247, name: tcp-5247 }
- { port: 5248, name: tcp-5248 }
- { port: 5249, name: tcp-5249 }
- { port: 5250, name: tcp-5250 }
- { port: 5251, name: tcp-5251 }
- { port: 5252, name: tcp-5252 }
- { port: 5253, name: tcp-5253 }
- { port: 5254, name: tcp-5254 }
- { port: 5255, name: tcp-5255 }
- { port: 5256, name: tcp-5256 }
- { port: 5257, name: tcp-5257 }
- { port: 5258, name: tcp-5258 }
- { port: 5259, name: tcp-5259 }
- { port: 5260, name: tcp-5260 }
- { port: 5261, name: tcp-5261 }
- { port: 5262, name: tcp-5262 }
- { port: 5263, name: tcp-5263 }
- { port: 5264, name: tcp-5264 }
- { port: 5265, name: tcp-5265 }
- { port: 5266, name: tcp-5266 }
- { port: 5267, name: tcp-5267 }
- { port: 5268, name: tcp-5268 }
- { port: 5269, name: tcp-5269 }
- { port: 5270, name: tcp-5270 }
- { port: 5271, name: tcp-5271 }
- { port: 5272, name: tcp-5272 }
- { port: 5273, name: tcp-5273 }
- { port: 5274, name: tcp-5274 }
- { port: 5275, name: tcp-5275 }
- { port: 5276, name: tcp-5276 }
- { port: 5277, name: tcp-5277 }
- { port: 5278, name: tcp-5278 }
- { port: 5279, name: tcp-5279 }
- { port: 5280, name: tcp-5280 }
- { port: 5281, name: tcp-5281 }
- { port: 5282, name: tcp-5282 }
- { port: 5283, name: tcp-5283 }
- { port: 5284, name: tcp-5284 }
- { port: 5285, name: tcp-5285 }
- { port: 5286, name: tcp-5286 }
- { port: 5287, name: tcp-5287 }
- { port: 5288, name: tcp-5288 }
- { port: 5289, name: tcp-5289 }
- { port: 5290, name: tcp-5290 }
- { port: 5291, name: tcp-5291 }
- { port: 5292, name: tcp-5292 }
- { port: 5293, name: tcp-5293 }
- { port: 5294, name: tcp-5294 }
- { port: 5295, name: tcp-5295 }
- { port: 5296, name: tcp-5296 }
- { port: 5297, name: tcp-5297 }
- { port: 5298, name: tcp-5298 }
- { port: 5299, name: tcp-5299 }
- { port: 5300, name: tcp-5300 }
---
apiVersion: v1
kind: Service
metadata:
name: ext-udp-lb
annotations:
loxilb.io/useExternalEndpoint: "yes"
loxilb.io/epselect: "persist"
loxilb.io/liveness: "yes"
spec:
externalTrafficPolicy: Local
loadBalancerClass: loxilb.io/loxilb
ports:
- port: 5000
protocol: UDP
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
name: ext-tcp-lb
annotations:
loxilb.io/useExternalEndpoint: "yes"
loxilb.io/epselect: "persist"
loxilb.io/liveness: "yes"
spec:
externalTrafficPolicy: Local
loadBalancerClass: loxilb.io/loxilb
ports:
- port: 5000
protocol: TCP
type: LoadBalancer
1 change: 1 addition & 0 deletions pkg/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ type NetworkConfig struct {
ExclIPAM bool
NumZoneInst int
UsePodNetwork bool
UseExternalEndpoint bool
}
Loading
Loading