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

feat(gateway): add loadBalancerIP to MeshGatewayInstance #4519

Merged
merged 2 commits into from
Jul 6, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -1391,6 +1391,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down Expand Up @@ -1523,6 +1530,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down Expand Up @@ -635,6 +642,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ spec:
Service.
type: object
type: object
spec:
description: Spec holds some customizable fields of a Service.
properties:
loadBalancerIP:
description: LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
type: string
type: object
type: object
serviceType:
default: LoadBalancer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ type MeshGatewayCommonConfig struct {
type MeshGatewayServiceTemplate struct {
// Metadata holds metadata configuration for a Service.
Metadata MeshGatewayServiceMetadata `json:"metadata,omitempty"`

// Spec holds some customizable fields of a Service.
Spec MeshGatewayServiceSpec `json:"spec,omitempty"`
}

// +k8s:deepcopy-gen=true
Expand All @@ -74,6 +77,15 @@ type MeshGatewayServiceMetadata struct {

// +k8s:deepcopy-gen=true

// MeshGatewayServiceSpec holds customizable fields of a Service spec.
type MeshGatewayServiceSpec struct {
// LoadBalancerIP corresponds to ServiceSpec.LoadBalancerIP.
// +optional
LoadBalancerIP string `json:"loadBalancerIP,omitempty"`
}

// +k8s:deepcopy-gen=true

// MeshGatewayConfigSpec specifies the options available for a Kuma MeshGateway.
type MeshGatewayConfigSpec struct {
MeshGatewayCommonConfig `json:",inline"`
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func (r *GatewayInstanceReconciler) createOrUpdateService(
service.Spec.Ports = ports
service.Spec.Type = gatewayInstance.Spec.ServiceType

if ip := gatewayInstance.Spec.ServiceTemplate.Spec.LoadBalancerIP; ip != "" {
service.Spec.LoadBalancerIP = ip
}

return service, nil
},
)
Expand Down