-
Notifications
You must be signed in to change notification settings - Fork 277
CORENET-6714: Enable Network Observability on Day 0 #2925
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: cno-observability | ||
| rules: | ||
| # Manage the netobserv namespace itself | ||
| - apiGroups: [""] | ||
| resources: ["namespaces"] | ||
| verbs: ["get", "create", "list"] | ||
|
|
||
| # Manage ServiceAccounts for ClusterExtension installer | ||
| - apiGroups: [""] | ||
| resources: ["serviceaccounts"] | ||
| verbs: ["get", "create", "list"] | ||
|
|
||
| # Manage OLM v1 resources for operator installation | ||
| - apiGroups: ["olm.operatorframework.io"] | ||
| resources: ["clusterextensions"] | ||
| verbs: ["get", "list", "create", "update", "patch"] | ||
|
|
||
| # Check for FlowCollector CRD to determine if operator is installed | ||
| - apiGroups: ["apiextensions.k8s.io"] | ||
| resources: ["customresourcedefinitions"] | ||
| verbs: ["get"] | ||
|
|
||
| # Manage FlowCollector CRs | ||
| - apiGroups: ["flows.netobserv.io"] | ||
| resources: ["flowcollectors"] | ||
| verbs: ["get", "create", "update", "patch", "delete"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: cno-observability | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: cno-observability | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: cluster-network-operator | ||
| namespace: openshift-network-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,246 @@ | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: openshift-netobserv-operator | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: netobserv-operator-installer | ||
| namespace: openshift-netobserv-operator | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: netobserv-operator-installer | ||
| rules: | ||
| # Permissions needed by OLM v1 to install the Network Observability operator | ||
| # Based on OLM v1 pre-authorization requirements from the operator bundle | ||
|
|
||
| # Core resources | ||
| - apiGroups: [""] | ||
| resources: ["endpoints", "nodes", "pods"] | ||
| verbs: ["get", "list", "watch"] | ||
| - apiGroups: [""] | ||
| resources: ["events"] | ||
| verbs: ["create", "patch"] | ||
| - apiGroups: [""] | ||
| resources: ["namespaces"] | ||
| verbs: ["create", "get", "list", "watch", "update", "patch", "delete"] | ||
| - apiGroups: [""] | ||
| resources: ["serviceaccounts", "services", "configmaps"] | ||
| verbs: ["create", "get", "list", "watch", "update", "patch", "delete"] | ||
| - apiGroups: [""] | ||
| resources: ["secrets", "persistentvolumeclaims"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
|
|
||
| # Webhooks - validating webhook configurations | ||
| - apiGroups: ["admissionregistration.k8s.io"] | ||
| resources: ["validatingwebhookconfigurations"] | ||
| verbs: ["create", "list", "watch"] | ||
| - apiGroups: ["admissionregistration.k8s.io"] | ||
| resources: ["validatingwebhookconfigurations"] | ||
| resourceNames: ["flowcollectorconversionwebhook.netobserv.io", "flowmetricvalidationwebhook.netobserv.io"] | ||
| verbs: ["delete", "get", "patch", "update"] | ||
|
|
||
| # CRDs and API services | ||
| - apiGroups: ["apiextensions.k8s.io"] | ||
| resources: ["customresourcedefinitions"] | ||
| verbs: ["create", "get", "list", "watch", "update", "patch"] | ||
| - apiGroups: ["apiextensions.k8s.io"] | ||
| resources: ["customresourcedefinitions/status"] | ||
| verbs: ["patch", "update"] | ||
| - apiGroups: ["apiextensions.k8s.io"] | ||
| resources: ["customresourcedefinitions"] | ||
| resourceNames: ["flowcollectors.flows.netobserv.io", "flowcollectorslices.flows.netobserv.io", "flowmetrics.flows.netobserv.io"] | ||
| verbs: ["delete"] | ||
| - apiGroups: ["apiregistration.k8s.io"] | ||
| resources: ["apiservices"] | ||
| verbs: ["get", "list", "watch"] | ||
|
|
||
| # Workloads | ||
| - apiGroups: ["apps"] | ||
| resources: ["deployments", "daemonsets"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
| - apiGroups: ["apps"] | ||
| resources: ["replicasets"] | ||
| verbs: ["get", "list", "watch"] | ||
|
|
||
| # Authentication and authorization | ||
| - apiGroups: ["authentication.k8s.io"] | ||
| resources: ["tokenreviews"] | ||
| verbs: ["create"] | ||
| - apiGroups: ["authorization.k8s.io"] | ||
| resources: ["subjectaccessreviews"] | ||
| verbs: ["create"] | ||
|
|
||
| # Autoscaling | ||
| - apiGroups: ["autoscaling"] | ||
| resources: ["horizontalpodautoscalers"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
|
|
||
| # eBPF (bpfman.io) | ||
| - apiGroups: ["bpfman.io"] | ||
| resources: ["clusterbpfapplications"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
| - apiGroups: ["bpfman.io"] | ||
| resources: ["clusterbpfapplications/status"] | ||
| verbs: ["get", "patch", "update"] | ||
|
|
||
| # OpenShift config | ||
| - apiGroups: ["config.openshift.io"] | ||
| resources: ["clusterversions", "networks"] | ||
| verbs: ["get", "list", "watch"] | ||
|
|
||
| # Console plugin | ||
| - apiGroups: ["console.openshift.io"] | ||
| resources: ["consoleplugins"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
|
|
||
| # Coordination (leader election) | ||
| - apiGroups: ["coordination.k8s.io"] | ||
| resources: ["leases"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
|
|
||
| # Discovery | ||
| - apiGroups: ["discovery.k8s.io"] | ||
| resources: ["endpointslices"] | ||
| verbs: ["get", "list", "watch"] | ||
|
|
||
| # FlowCollector CRs | ||
| - apiGroups: ["flows.netobserv.io"] | ||
| resources: ["flowcollectors", "flowcollectorslices", "flowmetrics"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
| - apiGroups: ["flows.netobserv.io"] | ||
| resources: ["flowcollectors/finalizers"] | ||
| verbs: ["update"] | ||
| - apiGroups: ["flows.netobserv.io"] | ||
| resources: ["flowcollectors/status", "flowcollectorslices/status", "flowmetrics/status"] | ||
| verbs: ["get", "patch", "update"] | ||
|
|
||
| # OVN-Kubernetes | ||
| - apiGroups: ["k8s.ovn.org"] | ||
| resources: ["clusteruserdefinednetworks", "userdefinednetworks"] | ||
| verbs: ["get", "list", "watch"] | ||
|
|
||
| # Loki integration | ||
| - apiGroups: ["loki.grafana.com"] | ||
| resources: ["lokistacks"] | ||
| verbs: ["get", "list", "watch"] | ||
| - apiGroups: ["loki.grafana.com"] | ||
| resources: ["network"] | ||
| resourceNames: ["logs"] | ||
| verbs: ["create", "get"] | ||
|
|
||
| # Metrics | ||
| - apiGroups: ["metrics.k8s.io"] | ||
| resources: ["pods"] | ||
| verbs: ["create"] | ||
|
|
||
| # Monitoring | ||
| - apiGroups: ["monitoring.coreos.com"] | ||
| resources: ["prometheusrules", "servicemonitors"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
|
|
||
| # Network policies | ||
| - apiGroups: ["networking.k8s.io"] | ||
| resources: ["networkpolicies"] | ||
| verbs: ["create", "delete", "get", "list", "patch", "update", "watch"] | ||
|
|
||
| # OLM ClusterExtension finalizers | ||
| - apiGroups: ["olm.operatorframework.io"] | ||
| resources: ["clusterextensions/finalizers"] | ||
| resourceNames: ["netobserv-operator"] | ||
| verbs: ["update"] | ||
|
|
||
| # OpenShift console and network config | ||
| - apiGroups: ["operator.openshift.io"] | ||
| resources: ["consoles"] | ||
| verbs: ["get", "list", "update", "watch"] | ||
| - apiGroups: ["operator.openshift.io"] | ||
| resources: ["networks"] | ||
| verbs: ["get", "list", "watch"] | ||
|
|
||
| # RBAC | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["clusterroles", "clusterrolebindings"] | ||
| verbs: ["create", "delete", "get", "list", "update", "watch", "patch"] | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["roles"] | ||
| verbs: ["list", "watch"] | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["rolebindings"] | ||
| verbs: ["create", "delete", "get", "list", "update", "watch"] | ||
|
|
||
| # Security context constraints | ||
| - apiGroups: ["security.openshift.io"] | ||
| resources: ["securitycontextconstraints"] | ||
| verbs: ["create", "list", "update", "watch"] | ||
| - apiGroups: ["security.openshift.io"] | ||
| resources: ["securitycontextconstraints"] | ||
| resourceNames: ["hostnetwork"] | ||
| verbs: ["use"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: netobserv-operator-installer | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: netobserv-operator-installer | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: netobserv-operator-installer | ||
| namespace: openshift-netobserv-operator | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: netobserv-operator-installer | ||
| namespace: openshift-netobserv-operator | ||
| rules: | ||
| # Namespace-scoped permissions needed for operator installation | ||
| # The operator needs to manage Roles and RoleBindings in its own namespace | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["roles"] | ||
| verbs: ["create"] | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["roles"] | ||
| resourceNames: ["netobserv-openshift-netobserv-operator-prometheus"] | ||
| verbs: ["delete", "get", "patch", "update"] | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["rolebindings"] | ||
| resourceNames: ["netobserv-openshift-netobserv-operator-prometheus"] | ||
| verbs: ["delete", "get", "patch", "update"] | ||
| - apiGroups: ["rbac.authorization.k8s.io"] | ||
| resources: ["rolebindings"] | ||
| verbs: ["create"] | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: netobserv-operator-installer | ||
| namespace: openshift-netobserv-operator | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: netobserv-operator-installer | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: netobserv-operator-installer | ||
| namespace: openshift-netobserv-operator | ||
| --- | ||
| apiVersion: olm.operatorframework.io/v1 | ||
| kind: ClusterExtension | ||
| metadata: | ||
| name: netobserv-operator | ||
| spec: | ||
| namespace: openshift-netobserv-operator | ||
| serviceAccount: | ||
| name: netobserv-operator-installer | ||
| source: | ||
| sourceType: Catalog | ||
| catalog: | ||
| packageName: netobserv-operator | ||
| channels: [stable] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| apiVersion: flows.netobserv.io/v1beta2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding this file to the manifests directory means that the CR will be added by default to the cluster. Is this desired behavior?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved the files to a sub-directory in the controller directory. |
||
| kind: FlowCollector | ||
| metadata: | ||
| name: cluster | ||
| spec: | ||
| agent: | ||
| ebpf: | ||
| features: | ||
| - DNSTracking | ||
| sampling: 400 | ||
| type: eBPF | ||
| deploymentModel: Service | ||
| loki: | ||
| enable: false | ||
| namespace: openshift-network-observability | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? With OlivierCazade in the path?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is temporary to make the branch testable.
Switching back to the main API branch once the API PR is merged is necessary before merging this PR.