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

Service LoadBalancer kube-controller #9221

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
7 changes: 7 additions & 0 deletions api/pkg/apis/projectcalico/v3/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ const (
// Enum options for enable/disable fields
Enabled = "Enabled"
Disabled = "Disabled"

// Enum options for AllServices/RequestedServicesOnly
AllServices = "AllServices"
RequestedServicesOnly = "RequestedServicesOnly"

// Host name used for Service LoadBalancer
VirtualLoadBalancer = "virtual-load-balancer"
)
15 changes: 13 additions & 2 deletions api/pkg/apis/projectcalico/v3/ippool.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ type IPPoolSpec struct {
// AllowedUse controls what the IP pool will be used for. If not specified or empty, defaults to
// ["Tunnel", "Workload"] for back-compatibility
AllowedUses []IPPoolAllowedUse `json:"allowedUses,omitempty" validate:"omitempty"`

// Determines the mode how IP addresses should be assigned from this pool
AssignmentMode AssignmentMode `json:"assignmentMode,omitempty" validate:"omitempty,assignmentMode"`
}

type IPPoolAllowedUse string

const (
IPPoolAllowedUseWorkload IPPoolAllowedUse = "Workload"
IPPoolAllowedUseTunnel IPPoolAllowedUse = "Tunnel"
IPPoolAllowedUseWorkload IPPoolAllowedUse = "Workload"
IPPoolAllowedUseTunnel IPPoolAllowedUse = "Tunnel"
IPPoolAllowedUseLoadBalancer IPPoolAllowedUse = "LoadBalancer"
)

type VXLANMode string
Expand Down Expand Up @@ -120,6 +124,13 @@ const (
CrossSubnet EncapMode = "cross-subnet"
)

type AssignmentMode string
caseydavenport marked this conversation as resolved.
Show resolved Hide resolved

const (
Automatic AssignmentMode = "Automatic"
Manual AssignmentMode = "Manual"
)

const DefaultMode = Always

type IPIPConfiguration struct {
Expand Down
7 changes: 7 additions & 0 deletions api/pkg/apis/projectcalico/v3/kubecontrollersconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ type ControllersConfig struct {

// Namespace enables and configures the namespace controller. Enabled by default, set to nil to disable.
Namespace *NamespaceControllerConfig `json:"namespace,omitempty"`

// LoadBalancer enables and configures the LoadBalancer controller. Enabled by default, set to nil to disable.
caseydavenport marked this conversation as resolved.
Show resolved Hide resolved
LoadBalancer *LoadBalancerControllerConfig `json:"loadBalancer,omitempty"`
}

// NodeControllerConfig configures the node controller, which automatically cleans up configuration
Expand Down Expand Up @@ -137,6 +140,10 @@ type NamespaceControllerConfig struct {
ReconcilerPeriod *metav1.Duration `json:"reconcilerPeriod,omitempty" validate:"omitempty"`
}

type LoadBalancerControllerConfig struct {
AssignIPs string `json:"assignIPs,omitempty" validate:"omitempty,assignIPs"`
caseydavenport marked this conversation as resolved.
Show resolved Hide resolved
}

// KubeControllersConfigurationStatus represents the status of the configuration. It's useful for admins to
// be able to see the actual config that was applied, which can be modified by environment variables on the
// kube-controllers process.
Expand Down
21 changes: 21 additions & 0 deletions api/pkg/apis/projectcalico/v3/zz_generated.deepcopy.go

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

34 changes: 33 additions & 1 deletion api/pkg/openapi/openapi_generated.go

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

2 changes: 2 additions & 0 deletions apiserver/pkg/storage/calico/ippool_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,7 @@ func (gc IPPoolConverter) convertToAAPIList(libcalicoListObject resourceListObje
if matched, err := pred.Matches(&aapiIPPool); err == nil && matched {
aapiIPPoolList.Items = append(aapiIPPoolList.Items, aapiIPPool)
}

}

}
Loading
Loading