Deploy with the Operator
To enable continuous network flow collection, you need:
- A reachable ClickHouse server for storing flow logs
- The NetObserv Operator
- A FlowCollector instance
The ClickHouse backend can be prepared in either of these ways:
- Use an existing ClickHouse server and provide its connection information in the FlowCollector configuration
- Deploy a new ClickHouse instance in the cluster by using the ClickHouse Operator
TOC
Choose a ClickHouse Deployment OptionOptional: Deploy ClickHouse with the ClickHouse OperatorInstall the ClickHouse OperatorCreate a ClickHouseInstallation InstanceInstall the NetObserv OperatorCreate the ClickHouse Authentication SecretCreate a FlowCollector InstanceChoose a ClickHouse Deployment Option
Choose one of the following approaches before you create the FlowCollector instance:
- Existing ClickHouse server: Use this option if you already have a ClickHouse deployment that FlowCollector can access.
- New in-cluster ClickHouse instance: Use this option if you want to deploy ClickHouse in the cluster with the ClickHouse Operator.
If you use an existing ClickHouse server, prepare these values in advance:
- ClickHouse service address in
host:portformat - Database name for flow logs
- Username and password for ClickHouse authentication
- The namespace that will be used in
.spec.namespaceof the FlowCollector
Optional: Deploy ClickHouse with the ClickHouse Operator
If you already have a ClickHouse server for NetObserv, skip this section and go to Install the NetObserv Operator.
Install the ClickHouse Operator
-
Navigate to Administrator > Marketplace > OperatorHub.
-
Search for "ClickHouse" and locate the ClickHouse Operator provided by .
-
If the ClickHouse Operator status is Absent, upload the ClickHouse Operator package that you downloaded from the Customer Portal.
-
Click on the ClickHouse Operator to open the details page.
-
On the operator details page, click Install.
-
Fill in the configuration parameters as needed.
-
Click Install to start the installation.
-
Confirm the installation by clicking Confirm in the pop-up dialog.
-
Wait for the installation to complete.
If the ClickHouse Operator provided by is already installed, skip this section and go directly to creating a ClickHouse cluster for NetObserv.
Create a ClickHouseInstallation Instance
-
In the ClickHouse Operator details page, navigate to the All Instances page and click Create.
-
In the pop-up dialog, click Create in the ClickHouseInstallation section.
-
In the Create ClickHouseInstallation page, click YAML on the top right corner to switch to YAML editing mode.
-
Edit the YAML file as needed and click Create to create the ClickHouseInstallation instance.
Example ClickHouseInstallation YAML:
After the ClickHouse instance is ready, get the service endpoint by inspecting field .status.endpoint of the ClickHouseInstallation instance.
You can also run the following command to get the endpoint:
cpaas-system and netobserv in the command must match the namespace and name of the ClickHouseInstallation instance respectively.
If you use a different namespace or name, replace cpaas-system and netobserv in the command accordingly.
Record the ClickHouse endpoint address and credentials for later use. You will need this information when you create the FlowCollector instance.
Install the NetObserv Operator
-
Navigate to Administrator > Marketplace > OperatorHub.
-
Search for "Alauda Container Platform Network Observability Operator".
-
Click Install to open the installation configuration page.
-
Fill in the configuration parameters as needed.
-
Click Install to start the installation.
-
Confirm the installation by clicking Confirm in the pop-up dialog.
-
Wait for the installation to complete.
Create the ClickHouse Authentication Secret
Before you create the FlowCollector instance, create a Kubernetes secret for ClickHouse authentication.
This secret is referenced by .spec.clickhouse.authSecret.name in the FlowCollector configuration.
-
Create a local file named ck-auth.env with the following content:
-
Create the Kubernetes secret:
In this command, netobserv must match the value of .spec.namespace in the FlowCollector configuration.
If you use a different namespace in the FlowCollector configuration, replace netobserv in the command accordingly.
Create a FlowCollector Instance
Before creating the FlowCollector instance, confirm that:
- The ClickHouse server is reachable from the cluster
- The
ck-authsecret exists in the namespace specified by.spec.namespace - The ClickHouse address, database, and credentials are correct
Then create the FlowCollector instance:
-
Navigate to the All Instances page and click Create.
-
In the pop-up dialog, click Create in the FlowCollector section.
-
In the Create FlowCollector page, click YAML on the top right corner to switch to YAML editing mode.
-
Edit the YAML file as needed and click Create to create the FlowCollector instance.
Example FlowCollector YAML:
- Enabled features of the eBPF agent.
- Sampling interval of the eBPF probe. A value of 100 means that 1 out of every 100 packets is sampled. A value of 0 or 1 means that all packets are sampled.
- ClickHouse server addresses. Use the
host:portformat. These addresses can point to a ClickHouse instance created in the cluster or to an existing external ClickHouse server. - ClickHouse authentication secret. The secret MUST contain two keys:
usernameandpassword. The secret must be created in the same namespace specified by.spec.namespace. - Database name in ClickHouse for storing flow logs. If the database does not exist, it is created automatically.
- Data retention period in ClickHouse. Use a number followed by a time unit, for example
24h. This setting takes effect only when the ClickHouse table is created. - Namespace where the eBPF agents and the flow logs pipeline are deployed.
- Number of replicas for the flow logs pipeline.
If you are using an existing ClickHouse server, make sure that the FlowCollector can reach the server address and that the referenced secret contains valid credentials.
After the FlowCollector instance is created, the eBPF agents and the flow logs pipeline are deployed to the namespace specified by .spec.namespace.