mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Create a LB for a K8S with the LB-IP provided by user.
This commit is contained in:
@@ -55,6 +55,7 @@ func paramNames() []GeneratorParam {
|
||||
{"labels", false},
|
||||
{"external-ip", false},
|
||||
{"create-external-load-balancer", false},
|
||||
{"load-balancer-ip", false},
|
||||
{"type", false},
|
||||
{"protocol", false},
|
||||
{"container-port", false}, // alias of target-port
|
||||
@@ -149,6 +150,9 @@ func generate(genericParams map[string]interface{}) (runtime.Object, error) {
|
||||
if len(params["type"]) != 0 {
|
||||
service.Spec.Type = api.ServiceType(params["type"])
|
||||
}
|
||||
if service.Spec.Type == api.ServiceTypeLoadBalancer {
|
||||
service.Spec.LoadBalancerIP = params["load-balancer-ip"]
|
||||
}
|
||||
if len(params["session-affinity"]) != 0 {
|
||||
switch api.ServiceAffinity(params["session-affinity"]) {
|
||||
case api.ServiceAffinityNone:
|
||||
|
||||
Reference in New Issue
Block a user