Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
26 changes: 25 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
files: ./cover.out
flags: unittests
fail_ci_if_error: false
verbose: true
verbose: true

bundle-check:
runs-on: ubuntu-latest
Expand All @@ -47,3 +47,27 @@ jobs:
run: make update-bundle
- name: check bundle clean state
run: git add -A && git diff HEAD -I "operator-sdk-v" --exit-code

helm-check:
runs-on: ubuntu-latest
name: Checking helm up-to-date and valid
steps:
- name: install make
run: sudo apt-get install make

- name: checkout
uses: actions/checkout@v3

- name: generate helm
run: make helm-update

- name: check helm clean state
run: git add -A && git diff HEAD --exit-code

- name: set up Helm
uses: azure/setup-helm@v4.2.0
with:
version: v3.17.0

- name: run helm lint
run: helm lint helm/
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,11 @@ endif
@echo ""
@echo "Everything is ready to be pushed. Before that, you should compare the content of $(BUNDLE_VERSION) with $(PREVIOUS_VERSION) to make sure it looks correct."

# Update helm templates
.PHONY: helm-update
helm-update: YQ ## Update helm template
hack/helm-update.sh

include .mk/sample.mk
include .mk/development.mk
include .mk/local.mk
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,31 @@ Flow data is then available in multiple ways, each optional:

## Getting Started

You can install NetObserv Operator using [OLM](https://olm.operatorframework.io/) if it is available in your cluster, or directly from its repository.
You can install the NetObserv Operator using [Helm](https://helm.sh/), or directly from sources.

### Install with OLM
In OpenShift, NetObserv is renamed as the Network Observability operator and can be found in OperatorHub as an OLM operator. This section does not apply to it: please refer to the [OpenShift documentation](https://docs.openshift.com/container-platform/latest/observability/network_observability/installing-operators.html) in that case.

> [!IMPORTANT]
> There hasn't been recent releases pushed to the community OperatorHub. This is mostly due to the lack of demand. Unless there is demand, going forward we only release the downstream NetObserv aka [Network Observability operator](https://docs.openshift.com/container-platform/latest/observability/network_observability/network-observability-operator-release-notes.html) for OpenShift. But there's nothing written in stone. [Let us know](https://github.com/netobserv/network-observability-operator/discussions) if you would like that to change.
> NetObserv community was previously distributed via [OperatorHub](https://operatorhub.io/operator/netobserv-operator). This installation method is replaced with a helm chart. If you previously installed NetObserv community from OperatorHub, we recommend that you uninstall it, and re-install using the helm chart. The operation should not cause any data loss.

NetObserv Operator is available in [OperatorHub](https://operatorhub.io/operator/netobserv-operator) with guided steps on how to install this. It is also available in the OperatorHub catalog directly in the OpenShift Console.
### Install with Helm

![OpenShift OperatorHub search](./docs/assets/operatorhub-search.png)
_Integration with ArtifactHub coming soon._

Please read the [operator description in OLM](./config/descriptions/upstream.md).
In the meantime, you can install the Helm chart from this repository:

After the operator is installed, create a `FlowCollector` resource:
```bash
git clone https://github.com/netobserv/network-observability-operator.git && cd network-observability-operator

![OpenShift OperatorHub FlowCollector](./docs/assets/operatorhub-flowcollector.png)
# If you don't already have cert-manager, you'll need it:
make install-cert-manager

Refer to the [Configuration section](#configuration) of this document.
helm install netobserv --namespace netobserv --create-namespace -f helm/values.yaml ./helm
```

More information can be found [here](./config/descriptions/upstream.md).

After the operator is installed, create a `FlowCollector` resource: refer to the [Configuration section](#configuration) of this document.

### Install from repository

Expand Down
Binary file removed docs/assets/operatorhub-flowcollector.png
Binary file not shown.
Binary file removed docs/assets/operatorhub-search.png
Binary file not shown.
35 changes: 35 additions & 0 deletions hack/helm-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

mkdir -p _tmp

# Copy and edit CRDs
for crd in "flows.netobserv.io_flowcollectors.yaml" "flows.netobserv.io_flowmetrics.yaml"; do
cp "bundle/manifests/$crd" helm/templates
sed -i -r 's/(`[^`]*\{\{[^`]*`)/{{\1}}/g' helm/templates/$crd # escape "{{" for helm
yq -i '.spec.conversion.webhook.clientConfig.service.namespace="{{ .Release.Namespace }}"' helm/templates/$crd
done

# Copy unchanged files
for file in "netobserv-manager-config_v1_configmap.yaml" "netobserv-metrics-service_v1_service.yaml" "netobserv-webhook-service_v1_service.yaml" ; do
cp "bundle/manifests/$file" helm/templates
done

# Services: remove openshift annotations for certificates (and some kubeconfig labels)
yq -i 'del(.metadata.annotations)' helm/templates/netobserv-metrics-service_v1_service.yaml
yq -i 'del(.metadata.annotations)' helm/templates/netobserv-webhook-service_v1_service.yaml
yq -i 'del(.metadata.labels)' helm/templates/netobserv-webhook-service_v1_service.yaml

# Extract data from clusterserviceversion
yq '.spec.install.spec.deployments[0].spec' bundle/manifests/netobserv-operator.clusterserviceversion.yaml > _tmp/csv-deployment.yaml
yq '.spec.install.spec.clusterPermissions[0]' bundle/manifests/netobserv-operator.clusterserviceversion.yaml > _tmp/csv-clusterrole.yaml
yq '.spec.install.spec.permissions[0]' bundle/manifests/netobserv-operator.clusterserviceversion.yaml > _tmp/csv-role.yaml

# Create deployment
yq '{"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "netobserv-controller-manager", "labels": {"app": "netobserv-operator", "control-plane": "controller-manager"}}, "spec": .}' _tmp/csv-deployment.yaml > helm/templates/deployment.yaml

# Create roles
yq '{"apiVersion": "v1", "kind": "ServiceAccount", "metadata": {"name": .serviceAccountName}}' _tmp/csv-clusterrole.yaml > helm/templates/serviceaccount.yaml
yq '{"apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRole", "metadata": {"name": "netobserv-manager-role"}, "rules": .rules}' _tmp/csv-clusterrole.yaml > helm/templates/clusterrole.yaml
yq '{"apiVersion": "rbac.authorization.k8s.io/v1", "kind": "ClusterRoleBinding", "metadata": {"name": "netobserv-manager-rolebinding"}, "roleRef": {"apiGroup": "rbac.authorization.k8s.io", "kind": "ClusterRole", "name": "netobserv-manager-role"}, "subjects": [{"kind": "ServiceAccount", "name": .serviceAccountName, "namespace": "{{ .Release.Namespace }}"}]}' _tmp/csv-clusterrole.yaml > helm/templates/clusterrolebinding.yaml
yq '{"apiVersion": "rbac.authorization.k8s.io/v1", "kind": "Role", "metadata": {"name": "netobserv-leader-election-role"}, "rules": .rules}' _tmp/csv-role.yaml > helm/templates/role.yaml
yq '{"apiVersion": "rbac.authorization.k8s.io/v1", "kind": "RoleBinding", "metadata": {"name": "netobserv-leader-election-rolebinding"}, "roleRef": {"apiGroup": "rbac.authorization.k8s.io", "kind": "Role", "name": "netobserv-leader-election-role"}, "subjects": [{"kind": "ServiceAccount", "name": .serviceAccountName, "namespace": "{{ .Release.Namespace }}"}]}' _tmp/csv-role.yaml > helm/templates/rolebinding.yaml
File renamed without changes.
86 changes: 0 additions & 86 deletions helm/netobserv/templates/deployment.yaml

This file was deleted.

Loading