Skip to content
Open
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
@@ -0,0 +1,107 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "BGPBasedVIPManagement Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- BGPBasedVIPManagement
tests:
onUpdate:
- name: Should allow setting vipManagement to BGP on BareMetal
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
status:
platform: BareMetal
platformStatus:
baremetal:
vipManagement: BGP
type: BareMetal
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
status:
platform: BareMetal
platformStatus:
baremetal:
vipManagement: BGP
loadBalancer:
type: OpenShiftManagedDefault
type: BareMetal
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
controlPlaneTopology: HighlyAvailable
- name: Should allow setting vipManagement to Keepalived on BareMetal
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
status:
platform: BareMetal
platformStatus:
baremetal:
vipManagement: Keepalived
type: BareMetal
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
status:
platform: BareMetal
platformStatus:
baremetal:
vipManagement: Keepalived
loadBalancer:
type: OpenShiftManagedDefault
type: BareMetal
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
controlPlaneTopology: HighlyAvailable
- name: Should reject an invalid vipManagement value
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
baremetal: {}
type: BareMetal
status:
platform: BareMetal
platformStatus:
baremetal:
vipManagement: VRRP
type: BareMetal
expectedStatusError: 'platformStatus.baremetal.vipManagement: Unsupported value: "VRRP": supported values: "Keepalived", "BGP"'
28 changes: 28 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ const (
DNSRecordsTypeInternal DNSRecordsType = "Internal"
)

// VIPManagementType defines which mechanism manages the API and Ingress
// VIPs on an on-premise cluster.
// +kubebuilder:validation:Enum=Keepalived;BGP
// +enum
type VIPManagementType string

const (
// VIPManagementTypeKeepalived means the VIPs are managed by the default
// keepalived/VRRP mechanism.
VIPManagementTypeKeepalived VIPManagementType = "Keepalived"
// VIPManagementTypeBGP means the VIPs are advertised via BGP by kube-vip
// (Routing Table Mode) and frr-k8s running as static pods.
VIPManagementTypeBGP VIPManagementType = "BGP"
)

// PlatformType is a specific supported infrastructure provider.
// +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt;EquinixMetal;PowerVS;AlibabaCloud;Nutanix;External
type PlatformType string
Expand Down Expand Up @@ -1074,6 +1089,19 @@ type BareMetalPlatformStatus struct {
// +optional
LoadBalancer *BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`

// vipManagement indicates which VIP management mechanism is active
// on this cluster.
// Allowed values are `Keepalived`, `BGP`, and omitted.
// When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are
// deployed as static pods to advertise VIPs via BGP, replacing the
// default keepalived/VRRP mechanism.
// When set to `Keepalived`, the default keepalived-based VIP
// management is used.
// When omitted, the default keepalived-based VIP management is used.
// +openshift:enable:FeatureGate=BGPBasedVIPManagement
// +optional
VIPManagement VIPManagementType `json:"vipManagement,omitempty"`

// dnsRecordsType determines whether records for api, api-int, and ingress
// are provided by the internal DNS service or externally.
// Allowed values are `Internal`, `External`, and omitted.
Expand Down
2 changes: 1 addition & 1 deletion config/v1/types_infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

const (
infraCRDDefaultFilePath = "0000_10_config-operator_01_infrastructures-Default.crd.yaml"
infraCRDTestPreviewFilePath = "0000_10_config-operator_01_infrastructures-SelfManagedHA-TechPreviewNoUpgrade.crd.yaml"
infraCRDTestPreviewFilePath = "0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml"
)

// TestInfrastructureStatusDefault verifies that the infrastructure CR status does not have default value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,21 @@ spec:
datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
to the nodes in the cluster.
type: string
vipManagement:
description: |-
vipManagement indicates which VIP management mechanism is active
on this cluster.
Allowed values are `Keepalived`, `BGP`, and omitted.
When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are
deployed as static pods to advertise VIPs via BGP, replacing the
default keepalived/VRRP mechanism.
When set to `Keepalived`, the default keepalived-based VIP
management is used.
When omitted, the default keepalived-based VIP management is used.
enum:
- Keepalived
- BGP
type: string
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External when loadBalancer.type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,21 @@ spec:
datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
to the nodes in the cluster.
type: string
vipManagement:
description: |-
vipManagement indicates which VIP management mechanism is active
on this cluster.
Allowed values are `Keepalived`, `BGP`, and omitted.
When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are
deployed as static pods to advertise VIPs via BGP, replacing the
default keepalived/VRRP mechanism.
When set to `Keepalived`, the default keepalived-based VIP
management is used.
When omitted, the default keepalived-based VIP management is used.
enum:
- Keepalived
- BGP
type: string
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External when loadBalancer.type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,21 @@ spec:
datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
to the nodes in the cluster.
type: string
vipManagement:
description: |-
vipManagement indicates which VIP management mechanism is active
on this cluster.
Allowed values are `Keepalived`, `BGP`, and omitted.
When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are
deployed as static pods to advertise VIPs via BGP, replacing the
default keepalived/VRRP mechanism.
When set to `Keepalived`, the default keepalived-based VIP
management is used.
When omitted, the default keepalived-based VIP management is used.
enum:
- Keepalived
- BGP
type: string
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External when loadBalancer.type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,21 @@ spec:
datacenter DNS, a DNS service is hosted as a static pod to serve those hostnames
to the nodes in the cluster.
type: string
vipManagement:
description: |-
vipManagement indicates which VIP management mechanism is active
on this cluster.
Allowed values are `Keepalived`, `BGP`, and omitted.
When set to `BGP`, kube-vip (Routing Table Mode) and frr-k8s are
deployed as static pods to advertise VIPs via BGP, replacing the
default keepalived/VRRP mechanism.
When set to `Keepalived`, the default keepalived-based VIP
management is used.
When omitted, the default keepalived-based VIP management is used.
enum:
- Keepalived
- BGP
type: string
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External when loadBalancer.type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/470
api.openshift.io/merged-by-featuregates: "true"
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
release.openshift.io/bootstrap-required: "true"
release.openshift.io/feature-set: TechPreviewNoUpgrade
Expand Down
1 change: 1 addition & 0 deletions config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ infrastructures.config.openshift.io:
- AWSClusterHostedDNSInstall
- AWSDualStackInstall
- AzureDualStackInstall
- BGPBasedVIPManagement
- DualReplica
- DyanmicServiceEndpointIBMCloud
- MutableTopology
Expand Down
Loading