Skip to content

Commit 959a96e

Browse files
committed
config/v1: add networkObservability field for day-0 installation
Add networkObservability nested structure to configure network observability installation during cluster deployment (day-0). - Add NetworkObservability field to NetworkSpec with NetworkObservabilitySpec type - Add NetworkObservabilityInstallationPolicy enum ("", "InstallAndEnable", "DoNotInstall") - Add NetworkObservabilityInstall feature gate enabled in DevPreview and TechPreview - Add integration test suite for the new field When installationPolicy is set to "" (empty string) or "InstallAndEnable", network observability will be installed and enabled. When set to "DoNotInstall", it will not be installed. Related: openshift/enhancements#1908
1 parent 5e946e2 commit 959a96e

3 files changed

Lines changed: 89 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2+
name: "Network"
3+
crdName: networks.config.openshift.io
4+
featureGates:
5+
- NetworkObservabilityInstall
6+
tests:
7+
onCreate:
8+
- name: Should be able to set NetworkObservability with empty string (default)
9+
initial: |
10+
apiVersion: config.openshift.io/v1
11+
kind: Network
12+
spec:
13+
networkObservability:
14+
installationPolicy: ""
15+
expected: |
16+
apiVersion: config.openshift.io/v1
17+
kind: Network
18+
spec:
19+
networkObservability:
20+
installationPolicy: ""
21+
- name: Should be able to set NetworkObservability InstallAndEnable
22+
initial: |
23+
apiVersion: config.openshift.io/v1
24+
kind: Network
25+
spec:
26+
networkObservability:
27+
installationPolicy: InstallAndEnable
28+
expected: |
29+
apiVersion: config.openshift.io/v1
30+
kind: Network
31+
spec:
32+
networkObservability:
33+
installationPolicy: InstallAndEnable
34+
- name: Should be able to set NetworkObservability DoNotInstall
35+
initial: |
36+
apiVersion: config.openshift.io/v1
37+
kind: Network
38+
spec:
39+
networkObservability:
40+
installationPolicy: DoNotInstall
41+
expected: |
42+
apiVersion: config.openshift.io/v1
43+
kind: Network
44+
spec:
45+
networkObservability:
46+
installationPolicy: DoNotInstall

config/v1/types_network.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ type NetworkSpec struct {
8686
//
8787
// +optional
8888
NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"`
89+
90+
// networkObservability is an optional field that configures network observability installation
91+
// during cluster deployment (day-0).
92+
// When omitted, network observability will be installed unless this is a SNO cluster.
93+
// +openshift:enable:FeatureGate=NetworkObservabilityInstall
94+
// +optional
95+
NetworkObservability NetworkObservabilitySpec `json:"networkObservability,omitempty,omitzero"`
8996
}
9097

9198
// NetworkStatus is the current network configuration.
@@ -304,3 +311,31 @@ type NetworkDiagnosticsTargetPlacement struct {
304311
// +listType=atomic
305312
Tolerations []corev1.Toleration `json:"tolerations"`
306313
}
314+
315+
// NetworkObservabilityInstallationPolicy is an enumeration of the available network observability installation policies
316+
// Valid values are "", "InstallAndEnable", "DoNotInstall".
317+
// +kubebuilder:validation:Enum="";InstallAndEnable;DoNotInstall
318+
type NetworkObservabilityInstallationPolicy string
319+
320+
const (
321+
// NetworkObservabilityNoOpinion means that the user has no opinion and the platform is left
322+
// to choose reasonable defaults. The current default is to install and enable network observability.
323+
// This is subject to change over time.
324+
NetworkObservabilityNoOpinion NetworkObservabilityInstallationPolicy = ""
325+
// NetworkObservabilityInstallAndEnable means that network observability should be installed and enabled during cluster deployment
326+
NetworkObservabilityInstallAndEnable NetworkObservabilityInstallationPolicy = "InstallAndEnable"
327+
// NetworkObservabilityDoNotInstall means that network observability should not be installed
328+
NetworkObservabilityDoNotInstall NetworkObservabilityInstallationPolicy = "DoNotInstall"
329+
)
330+
331+
// NetworkObservabilitySpec defines the configuration for network observability installation
332+
// +kubebuilder:validation:MinProperties=1
333+
type NetworkObservabilitySpec struct {
334+
// installationPolicy controls whether network observability is installed during cluster deployment.
335+
// Valid values are "", "InstallAndEnable" and "DoNotInstall".
336+
// When set to "", network observability will be installed unless this is a SNO cluster.
337+
// When set to "InstallAndEnable", network observability will be installed and enabled.
338+
// When set to "DoNotInstall", network observability will not be installed.
339+
// +optional
340+
InstallationPolicy *NetworkObservabilityInstallationPolicy `json:"installationPolicy,omitempty"`
341+
}

features/features.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,4 +1004,12 @@ var (
10041004
enhancementPR("https://github.com/openshift/enhancements/pull/1933").
10051005
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
10061006
mustRegister()
1007+
1008+
FeatureGateNetworkObservabilityInstall = newFeatureGate("NetworkObservabilityInstall").
1009+
reportProblemsToJiraComponent("netobserv").
1010+
contactPerson("jtakvori").
1011+
productScope(ocpSpecific).
1012+
enhancementPR("https://github.com/openshift/enhancements/pull/1908").
1013+
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
1014+
mustRegister()
10071015
)

0 commit comments

Comments
 (0)