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
27 changes: 20 additions & 7 deletions config/v1/types_infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package v1

import (
"os"
"path"
"path/filepath"
"slices"
"testing"

"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand All @@ -11,8 +12,8 @@ import (
)

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

// TestInfrastructureStatusDefault verifies that the infrastructure CR status does not have default value
Expand All @@ -21,12 +22,24 @@ const (
// It allows separating between clean installation and the roll-back to the previous version of the cluster
func TestInfrastructureStatusDefault(t *testing.T) {

filePaths := []string{infraCRDDefaultFilePath, infraCRDTestPreviewFilePath}
// Glob the generated infrastructure CRDs so the test keeps covering every
// feature set and cluster profile variant when the generator changes how
// the manifests are split.
filePaths, err := filepath.Glob(filepath.Join(infraCRDManifestsDir, "*_infrastructures-*.crd.yaml"))
if err != nil {
t.Fatalf("failed to list infrastructure CRD files: %v", err)
}
if len(filePaths) == 0 {
t.Fatalf("no infrastructure CRD files found in %q", infraCRDManifestsDir)
}
if !slices.Contains(filePaths, filepath.Join(infraCRDManifestsDir, infraCRDDefaultFilePath)) {
t.Fatalf("infrastructure CRD file %q not found in %v", infraCRDDefaultFilePath, filePaths)
}

for _, filepath := range filePaths {
infraCRDBytes, err := os.ReadFile(path.Join("zz_generated.crd-manifests", filepath))
for _, crdFilePath := range filePaths {
infraCRDBytes, err := os.ReadFile(crdFilePath)
if err != nil {
t.Fatalf("failed to read infrastructure CRD file %q: %v", filepath, err)
t.Fatalf("failed to read infrastructure CRD file %q: %v", crdFilePath, err)
}

var infraCRD map[string]interface{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
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
name: infrastructures.config.openshift.io
Expand Down Expand Up @@ -1803,6 +1802,25 @@ 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.
Once set to a non-empty value, this field is immutable.
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
x-kubernetes-validations:
- message: vipManagement is immutable once set
rule: oldSelf == '' || self == oldSelf
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,7 +4,6 @@ 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 Expand Up @@ -1803,6 +1802,25 @@ 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.
Once set to a non-empty value, this field is immutable.
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
x-kubernetes-validations:
- message: vipManagement is immutable once set
rule: oldSelf == '' || self == oldSelf
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External when loadBalancer.type
Expand Down
2 changes: 1 addition & 1 deletion features.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
| MutableTopology| | | | <span style="background-color: #519450">Enabled</span> | | | | |
| UnifiedClusterManagedDNSAndLB| | | | <span style="background-color: #519450">Enabled</span> | | | | |
| AuthenticationComponentProxyExternalOIDC| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| BGPBasedVIPManagement| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| BareMetalHostV1Beta1| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| ClusterAPIComputeInstall| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
| ClusterAPIControlPlaneInstall| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | | |
Expand All @@ -42,6 +41,7 @@
| AutomatedEtcdBackup| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AzureDedicatedHosts| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| AzureDualStackInstall| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| BGPBasedVIPManagement| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| BootcNodeManagement| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| CBORServingAndStorage| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| CRIOCredentialProviderConfig| | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> |
Expand Down
2 changes: 1 addition & 1 deletion features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ var (
contactPerson("mkowalski").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/1982").
enable(inDevPreviewNoUpgrade()).
enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enhancement in openshift/enhancements#1982 is still open, and we expect it to merge before a gate moves into TechPreviewNoUpgrade. Its Tech Preview criteria such as the tagged origin tests are also still open. Can we hold this until both are done?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have jobs (https://prow.ci.openshift.org/?job=*bgp-vip*) running for this feature already for quite some time as periodic on main (e.g. https://prow.ci.openshift.org/job-history/gs/test-platform-results-public/logs/periodic-ci-openshift-release-main-nightly-5.1-e2e-metal-ipi-bgp-vip).

Tests are not yet tagged purely because not enough understanding of the framework (Sippy etc.)

I have moved them to e2e origin in openshift/origin#31893 + openshift/release#88704 and it start collecting data soon, but in any case we will not get 14 days of tags on them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enhancement is in.

Jobs started to populate https://sippy-auth.dptools.openshift.org/sippy-ng/feature_gates/5.1/BGPBasedVIPManagement already. We have metal ipv4 and metal dual-stack. Other "missing" variants are not relevant for this feature.

mustRegister()

FeatureGateProvisioningRequestAvailable = newFeatureGate("ProvisioningRequestAvailable").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
api-approved.openshift.io: https://github.com/openshift/api/pull/1453
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/feature-set: TechPreviewNoUpgrade
labels:
openshift.io/operator-managed: ""
Expand Down Expand Up @@ -63,6 +62,18 @@ spec:
description: baseOSExtensionsContainerImage is the matching extensions
container for the new-format container
type: string
bgpVIPPeersJSON:
description: |-
bgpVIPPeersJSON carries the BGP VIP peer configuration (the config.json
payload of the bgp-vip-config ConfigMap) for rendering the frr-k8s
static pod peer file on control plane nodes. Only set when BGP-based
VIP management is enabled.
When omitted, BGP-based VIP management is not configured and no
frr-k8s peer file is rendered.
When set, the value must be between 1 and 65536 characters long.
maxLength: 65536
minLength: 1
type: string
cloudProviderCAData:
description: cloudProviderCAData specifies the cloud provider CA data
format: byte
Expand Down Expand Up @@ -2100,6 +2111,25 @@ 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.
Once set to a non-empty value, this field is immutable.
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
x-kubernetes-validations:
- message: vipManagement is immutable once set
rule: oldSelf == '' || self == oldSelf
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/1453
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/feature-set: TechPreviewNoUpgrade
labels:
Expand Down Expand Up @@ -63,6 +62,18 @@ spec:
description: baseOSExtensionsContainerImage is the matching extensions
container for the new-format container
type: string
bgpVIPPeersJSON:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MCO writes the plaintext peer passwords into this field, and cluster-reader can read ControllerConfig. That exposes the passwords without access to the Secrets. Can MCO move them to a Secret-backed transport before this goes to Tech Preview?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this change merges (openshift/machine-config-operator#6750) as we speak

description: |-
bgpVIPPeersJSON carries the BGP VIP peer configuration (the config.json
payload of the bgp-vip-config ConfigMap) for rendering the frr-k8s
static pod peer file on control plane nodes. Only set when BGP-based
VIP management is enabled.
When omitted, BGP-based VIP management is not configured and no
frr-k8s peer file is rendered.
When set, the value must be between 1 and 65536 characters long.
maxLength: 65536

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BGPVIPConfig accepts more hostOverrides and peers than fit in this field. When that happens, the whole ControllerConfig update fails after admission. Can we align the BGPVIPConfig bounds with this limit so the API rejects it up front?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. It's not a trivial math. You have 64K limit on the CR size. You can consume this limit with gazillion of small host overrides or a handful of monstrous ones.

I am happy to implement a suggestion but I don't have an idea. Just setting the limit to something conservatively small like 5 is defeating the purpose.

minLength: 1
type: string
cloudProviderCAData:
description: cloudProviderCAData specifies the cloud provider CA data
format: byte
Expand Down Expand Up @@ -2100,6 +2111,25 @@ 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.
Once set to a non-empty value, this field is immutable.
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
x-kubernetes-validations:
- message: vipManagement is immutable once set
rule: oldSelf == '' || self == oldSelf
type: object
x-kubernetes-validations:
- message: dnsRecordsType may only be set to External
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
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/feature-set: CustomNoUpgrade,DevPreviewNoUpgrade
release.openshift.io/feature-set: CustomNoUpgrade,DevPreviewNoUpgrade,TechPreviewNoUpgrade
labels:
openshift.io/operator-managed: ""
name: bgpvipconfigs.machineconfiguration.openshift.io
Expand Down
Loading