Skip to content

Commit 77b04ef

Browse files
committed
Add Network Observability controller with day-0 installation support
This commit introduces automated installation and management of the Network Observability Operator during cluster deployment (day-0). Key features: - Automatic operator installation via OLM when NetworkObservabilityInstall feature gate is enabled - Opt-out model: installs by default except on SNO clusters - Feature gate support with backward compatibility for older clusters Implementation details: - New observability controller in pkg/controller/observability/ - Manifest-based operator installation (07-observability-operator.yaml) - Default FlowCollector configuration (08-flowcollector.yaml) - RBAC permissions for OLM resource management - namespace creation for operator and observability components
1 parent b8d21fa commit 77b04ef

44 files changed

Lines changed: 5135 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,5 @@ require (
161161
sigs.k8s.io/randfill v1.0.0 // indirect
162162
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
163163
)
164+
165+
replace github.com/openshift/api v0.0.0-20260320151444-324a1bcb9f55 => github.com/OlivierCazade/api v0.0.0-20260324144412-012c4cdbbb5b

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj
1212
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
1313
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
1414
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
15+
github.com/OlivierCazade/api v0.0.0-20260324144412-012c4cdbbb5b h1:gP0wnvRizYDHlzLptWxAL3BPC1p6iTkqvC9R43Lexn4=
16+
github.com/OlivierCazade/api v0.0.0-20260324144412-012c4cdbbb5b/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
1517
github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ=
1618
github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw=
1719
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
@@ -209,8 +211,6 @@ github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI
209211
github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE=
210212
github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28=
211213
github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg=
212-
github.com/openshift/api v0.0.0-20260320151444-324a1bcb9f55 h1:2h6bqs9ua3wrsQnxEbzys3/n5IohLC7Dyb/KgaVYC/A=
213-
github.com/openshift/api v0.0.0-20260320151444-324a1bcb9f55/go.mod h1:pyVjK0nZ4sRs4fuQVQ4rubsJdahI1PB94LnQ8sGdvxo=
214214
github.com/openshift/build-machinery-go v0.0.0-20251023084048-5d77c1a5e5af h1:UiYYMi/CCV+kwWrXuXfuUSOY2yNXOpWpNVgHc6aLQlE=
215215
github.com/openshift/build-machinery-go v0.0.0-20251023084048-5d77c1a5e5af/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
216216
github.com/openshift/client-go v0.0.0-20260320040014-4b5fc2cdad98 h1:Ssuo/zELWqb7pFCwzB3QGEA4QeLW948hL2AhWq2SWjs=
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: cno-observability
5+
rules:
6+
# Manage the netobserv namespace itself
7+
- apiGroups: [""]
8+
resources: ["namespaces"]
9+
verbs: ["get", "create", "list"]
10+
11+
# Manage ServiceAccounts for ClusterExtension installer
12+
- apiGroups: [""]
13+
resources: ["serviceaccounts"]
14+
verbs: ["get", "create", "list"]
15+
16+
# Manage OLM v1 resources for operator installation
17+
- apiGroups: ["olm.operatorframework.io"]
18+
resources: ["clusterextensions"]
19+
verbs: ["get", "list", "create", "update", "patch"]
20+
21+
# Check for FlowCollector CRD to determine if operator is installed
22+
- apiGroups: ["apiextensions.k8s.io"]
23+
resources: ["customresourcedefinitions"]
24+
verbs: ["get"]
25+
26+
# Manage FlowCollector CRs
27+
- apiGroups: ["flows.netobserv.io"]
28+
resources: ["flowcollectors"]
29+
verbs: ["get", "create", "update", "patch", "delete"]
30+
---
31+
apiVersion: rbac.authorization.k8s.io/v1
32+
kind: ClusterRoleBinding
33+
metadata:
34+
name: cno-observability
35+
roleRef:
36+
apiGroup: rbac.authorization.k8s.io
37+
kind: ClusterRole
38+
name: cno-observability
39+
subjects:
40+
- kind: ServiceAccount
41+
name: cluster-network-operator
42+
namespace: openshift-network-operator
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: openshift-netobserv-operator
5+
---
6+
apiVersion: v1
7+
kind: ServiceAccount
8+
metadata:
9+
name: netobserv-operator-installer
10+
namespace: openshift-netobserv-operator
11+
---
12+
apiVersion: rbac.authorization.k8s.io/v1
13+
kind: ClusterRole
14+
metadata:
15+
name: netobserv-operator-installer
16+
rules:
17+
# Permissions needed by OLM v1 to install operators
18+
- apiGroups: ["*"]
19+
resources: ["*"]
20+
verbs: ["*"]
21+
---
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
kind: ClusterRoleBinding
24+
metadata:
25+
name: netobserv-operator-installer
26+
roleRef:
27+
apiGroup: rbac.authorization.k8s.io
28+
kind: ClusterRole
29+
name: netobserv-operator-installer
30+
subjects:
31+
- kind: ServiceAccount
32+
name: netobserv-operator-installer
33+
namespace: openshift-netobserv-operator
34+
---
35+
apiVersion: olm.operatorframework.io/v1
36+
kind: ClusterExtension
37+
metadata:
38+
name: netobserv-operator
39+
spec:
40+
namespace: openshift-netobserv-operator
41+
serviceAccount:
42+
name: netobserv-operator-installer
43+
source:
44+
sourceType: Catalog
45+
catalog:
46+
packageName: netobserv-operator
47+
channels: [stable]

manifests/08-flowcollector.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: flows.netobserv.io/v1beta2
2+
kind: FlowCollector
3+
metadata:
4+
name: cluster
5+
spec:
6+
agent:
7+
ebpf:
8+
features:
9+
- DNSTracking
10+
sampling: 400
11+
type: eBPF
12+
deploymentModel: Service
13+
loki:
14+
enable: false
15+
namespace: openshift-network-observability

pkg/controller/add_networkconfig.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/openshift/cluster-network-operator/pkg/controller/egress_router"
99
"github.com/openshift/cluster-network-operator/pkg/controller/infrastructureconfig"
1010
"github.com/openshift/cluster-network-operator/pkg/controller/ingressconfig"
11+
"github.com/openshift/cluster-network-operator/pkg/controller/observability"
1112
"github.com/openshift/cluster-network-operator/pkg/controller/operconfig"
1213
"github.com/openshift/cluster-network-operator/pkg/controller/pki"
1314
"github.com/openshift/cluster-network-operator/pkg/controller/proxyconfig"
@@ -28,5 +29,6 @@ func init() {
2829
infrastructureconfig.Add,
2930
allowlist.Add,
3031
dashboards.Add,
32+
observability.Add,
3133
)
3234
}

0 commit comments

Comments
 (0)