mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
fix defaulting
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
This commit is contained in:
parent
0768b45e7b
commit
20fc86df25
@ -171,9 +171,9 @@ func SetDefaults_Service(obj *v1.Service) {
|
|||||||
obj.Spec.Type == v1.ServiceTypeLoadBalancer {
|
obj.Spec.Type == v1.ServiceTypeLoadBalancer {
|
||||||
ipMode := v1.LoadBalancerIPModeVIP
|
ipMode := v1.LoadBalancerIPModeVIP
|
||||||
|
|
||||||
for _, ing := range obj.Status.LoadBalancer.Ingress {
|
for i, ing := range obj.Status.LoadBalancer.Ingress {
|
||||||
if ing.IPMode == nil {
|
if ing.IP != "" && ing.IPMode == nil {
|
||||||
ing.IPMode = &ipMode
|
obj.Status.LoadBalancer.Ingress[i].IPMode = &ipMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1175,7 +1175,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
// This currently works for loadbalancers that preserves source ips.
|
// This currently works for loadbalancers that preserves source ips.
|
||||||
// For loadbalancers which direct traffic to service NodePort, the firewall rules will not apply.
|
// For loadbalancers which direct traffic to service NodePort, the firewall rules will not apply.
|
||||||
|
|
||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.LoadBalancerIPMode) || ingress.IPMode == nil || *ingress.IPMode == v1.LoadBalancerIPModeVIP {
|
if !utilfeature.DefaultFeatureGate.Enabled(features.LoadBalancerIPMode) || *ingress.IPMode == v1.LoadBalancerIPModeVIP {
|
||||||
args = append(args[:0],
|
args = append(args[:0],
|
||||||
"-A", string(kubeServicesChain),
|
"-A", string(kubeServicesChain),
|
||||||
"-m", "comment", "--comment", fmt.Sprintf(`"%s loadbalancer IP"`, svcNameString),
|
"-m", "comment", "--comment", fmt.Sprintf(`"%s loadbalancer IP"`, svcNameString),
|
||||||
|
@ -1333,7 +1333,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
|
|
||||||
// Capture load-balancer ingress.
|
// Capture load-balancer ingress.
|
||||||
for _, ingress := range svcInfo.LoadBalancerIngress() {
|
for _, ingress := range svcInfo.LoadBalancerIngress() {
|
||||||
if ingress.IP != "" && (!utilfeature.DefaultFeatureGate.Enabled(features.LoadBalancerIPMode) || ingress.IPMode == nil || *ingress.IPMode == v1.LoadBalancerIPModeVIP) {
|
if ingress.IP != "" && (!utilfeature.DefaultFeatureGate.Enabled(features.LoadBalancerIPMode) || *ingress.IPMode == v1.LoadBalancerIPModeVIP) {
|
||||||
// ipset call
|
// ipset call
|
||||||
entry = &utilipset.Entry{
|
entry = &utilipset.Entry{
|
||||||
IP: ingress.IP,
|
IP: ingress.IP,
|
||||||
|
Loading…
Reference in New Issue
Block a user