Skip to content

About

Install FastNetMon Advanced via helm

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

FastNetMon Advanced Helm Chart

Deploy FastNetMon Advanced and its supporting services on Kubernetes (including k3s).

Chart status: This chart is intended for operators who can manage Kubernetes networking, persistent storage and Secrets. Review values.yaml before deployment. Container versions and available options are defined by the chart.

Release name, namespace and secrets directory

Set these shell variables before running the commands below:

export RELEASE=fnm
export NAMESPACE=fastnetmon
export SECRETS_DIR="$PWD/secrets"
  • RELEASE is the Helm release name, not the application or chart name. Kubernetes objects and default Secret names use it as a prefix, e.g. ${RELEASE}-mongodb-auth and ${RELEASE}-fastnetmon.
  • NAMESPACE is the Kubernetes namespace where the release and its Secrets are installed. fastnetmon is just an example; it does not need to match the release name.
  • SECRETS_DIR is the directory for locally generated passwords. Using an absolute path keeps the Secret creation commands valid even after changing directories.

Run these export commands in the terminal session before copying any of the commands below. When using another shell/session, set them again. A local chart checkout is not required when installing from GHCR.

Choose the chart source (the default is the published OCI chart):

export CHART=oci://ghcr.io/fastnetmon/charts/fastnetmon-advanced

To install from a local checkout instead, run cd into the chart repository and set export CHART=.. The OCI address will work once the first public chart release is published.

Components

Enabled by default: FastNetMon Advanced, MongoDB, ClickHouse, and FastNetMon Web API v2 (LiveView). With the default values.yaml, the initial installation deploys this core stack; no additional --set flags are required.

Component Default Purpose / notes
FastNetMon Advanced Enabled Traffic collection, detection and mitigation. FastNetMon-related containers share Chart.yaml appVersion.
MongoDB Enabled Default persistent configuration and metadata database; required for LiveView.
ClickHouse Enabled Persistent metrics and traffic data.
FastNetMon Web API / LiveView Enabled Web interface in a separate Pod; uses FastNetMon gRPC and shared configuration.
FerretDB Disabled Optional MongoDB alternative; LiveView is not supported with FerretDB.
TrafficDB Disabled Traffic-data service over UDP/8100; enable when needed for its data/graphs.
GoBGP Disabled BGP mitigation; internal gRPC TCP/50051, external BGP TCP/179 as configured.
Grafana Disabled ClickHouse dashboards with persistent data and optional provisioning.

The enabled state of optional components is controlled by values.yaml; review the file for your chart revision before installing.

Prerequisites

  • Working Kubernetes cluster with kubectl and Helm 4 access (tested during development on single-node k3s).
  • A default StorageClass or explicit storage classes in values.yaml. The example installation uses persistent volumes for databases, Grafana and FastNetMon.
  • Network access to required container image registries; if behind a proxy, configure the proxy Secret as described below.
  • FastNetMon Advanced license and outbound connectivity to the licensing service as required for your installation.
  • Routes/firewall rules that allow collectors to receive traffic. Kubernetes NodePort and GoBGP hostPort exposure are configurable; verify actual settings in values.yaml.

Storage note: ReadWriteOnce PVCs can be shared by multiple Pods on the same node, but this is not a portable multi-node architecture. The shared FastNetMon configuration PVC is mounted by FastNetMon and components that read its generated configuration (such as GoBGP and Web API). For multi-node deployments, use a suitable shared storage design and explicit scheduling constraints. This chart's original deployment target is single-node k3s.

Choose a database backend

Exactly one backend must be enabled. MongoDB is the default:

mongodb:
  enabled: true
ferretdb:
  enabled: false

To select FerretDB:

helm upgrade --install "$RELEASE" "$CHART" -n "$NAMESPACE" --create-namespace \
  --set mongodb.enabled=false \
  --set ferretdb.enabled=true \
  --set fastnetmon_web_api.v2=false

FerretDB is a MongoDB-compatible alternative, not a migration mechanism. Switching databases does not move data from one backend to another. Old StatefulSet PVCs are normally retained and should not be deleted without a backup. LiveView currently requires MongoDB. Because Web API v2 / LiveView is enabled by default, disable it explicitly when selecting FerretDB, as shown above.

Create Kubernetes Secrets

Generate local passwords

No chart checkout is required to generate Secrets. From any working directory, download the password generator and run it there:

curl -fsSLo init_secrets.sh \
  https://raw.githubusercontent.com/FastNetMon/fastnetmon-advanced-helm/main/files/init_secrets.sh
sh init_secrets.sh "$SECRETS_DIR"

The script creates $SECRETS_DIR and the required password files (mode 600), including a Web API v2-compatible password. Keep this directory private. To store credentials elsewhere, change SECRETS_DIR before running the generator; the Kubernetes Secret commands below will use the same path automatically. The generator preserves existing password files on reruns; it must not silently rotate credentials already used by the running databases.

The download URL is available only once the GitHub repository is public. If you are working with a private checkout, copy files/init_secrets.sh to your chosen working directory and run sh init_secrets.sh "$SECRETS_DIR" there, or invoke it using its absolute path with "$SECRETS_DIR" as the argument.

Important: Web API v2 password complexity

FastNetMon Web API (with v2 enabled) passwords must satisfy all these requirements:

  • Length: 8–24 characters.
  • At least one digit (0–9).
  • At least one Latin letter (a–z or A–Z).
  • At least one uppercase Latin letter (A–Z).
  • At least one special character from !@#$%&*()-_+=[]{};:,.<>?/|~.

Do not commit password files. Ensure .gitignore includes /secrets/ and any proxy environment files containing credentials.

Add passwords to Kubernetes Secrets

Helm consumes existing Kubernetes Secrets; creating local password files does not automatically create resources in the cluster. The commands below use the ${RELEASE}, ${NAMESPACE} and ${SECRETS_DIR} variables defined at the top. Secrets are external to Helm and must be present before installing the default stack.

Create the namespace before creating Secrets:

kubectl create namespace "$NAMESPACE" --dry-run=client -o yaml | kubectl apply -f -

Create the Secrets used by enabled services (depending on which components you enable):

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-mongodb-auth" \
  --from-file=mongo_password="$SECRETS_DIR/mongo_password"

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-clickhouse-auth" \
  --from-file=clickhouse_password="$SECRETS_DIR/clickhouse_password"

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-clickhouse-grafana-auth" \
  --from-file=clickhouse_grafana_password="$SECRETS_DIR/clickhouse_grafana_password"

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-grafana-auth" \
  --from-file=grafana_admin_password="$SECRETS_DIR/grafana_admin_password"

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-web-api-auth" \
  --from-file=web_api_admin_password="$SECRETS_DIR/web_api_admin_password"
Kubernetes Secret Required key Consumer When needed
${RELEASE}-mongodb-auth mongo_password MongoDB / FastNetMon MongoDB backend
${RELEASE}-clickhouse-auth clickhouse_password ClickHouse / FastNetMon / TrafficDB ClickHouse enabled
${RELEASE}-clickhouse-grafana-auth clickhouse_grafana_password ClickHouse / Grafana Grafana with ClickHouse datasource
${RELEASE}-grafana-auth grafana_admin_password Grafana Grafana enabled
${RELEASE}-web-api-auth web_api_admin_password FastNetMon / Web API Web API enabled
${RELEASE}-proxy HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy (as applicable) FastNetMon Only when using an outbound proxy

The Secret names in the table are patterns based on RELEASE. The chart allows overriding Secret names through *.auth.existingSecret and the corresponding key names in values.yaml. For example, clickhouse.auth.existingSecret is independent of clickhouse.auth.grafanaExistingSecret.

Do not store passwords in values.yaml or commit generated Kubernetes Secret manifests. Secret values are also visible to appropriately privileged cluster administrators; apply normal access control and backup precautions.

To update an existing Secret safely, use client-side generation with apply rather than running kubectl create again:

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-web-api-auth" \
  --from-file=web_api_admin_password="$SECRETS_DIR/web_api_admin_password" \
  --dry-run=client -o yaml | kubectl apply -f -

After changing a Secret, restart the affected workload if it reads passwords from environment variables or at startup. Some mounted Secret files update automatically, but running processes do not necessarily reload them. Database password rotation also requires the password inside the database to match; replacing a Kubernetes Secret alone does not rotate an established database user's password.

Optional outbound proxy

Create a local proxy.env file such as:

HTTP_PROXY=http://proxy.example.net:3128
HTTPS_PROXY=http://proxy.example.net:3128
http_proxy=http://proxy.example.net:3128
https_proxy=http://proxy.example.net:3128

Never surround values with quotes when using kubectl --from-env-file:

# WRONG — quotation marks become part of the stored value
HTTPS_PROXY="http://proxy.example.net:3128"

# CORRECT
HTTPS_PROXY=http://proxy.example.net:3128

Kubernetes does not strip shell-style quotes from env-file values in this workflow. A quoted URL can lead to errors such as bad uri.scheme: '"http' when the proxy is used.

Create the proxy Secret:

kubectl -n "$NAMESPACE" create secret generic "${RELEASE}-proxy" \
  --from-env-file=proxy.env

The proxy Secret name defaults to ${RELEASE}-proxy. To use an existing Secret with a different name, set fastnetmon.proxy.existingSecret in values.yaml. The chart automatically constructs NO_PROXY and no_proxy from fastnetmon.proxy.noProxy and the enabled internal services. You do not need to list those service names manually.

Configure and install the chart

values.yaml

Edit values.yaml (or provide a separate overrides file). Important options include:

  • global.image.repository and Chart.yaml: appVersion: FastNetMon image repository and the shared, pinned FastNetMon application version.
  • mongodb.enabled (true by default) / ferretdb.enabled (false by default): mutually exclusive database backends. FerretDB does not support LiveView.
  • fastnetmon.enabled (true by default) and fastnetmon.persistence.*: data, logs, cache and shared configuration PVCs.
  • fastnetmon.service.*: sFlow/NetFlow exposure; check configured node ports and UDP protocols.
  • gobgp.enabled and GoBGP host-port settings: BGP peering TCP/179 and internal gRPC TCP/50051.
  • fastnetmon_web_api.enabled: Web API / LiveView (enabled by default). Its HTTP listener is separate from FastNetMon's gRPC API service.
  • trafficdb.enabled: TrafficDB and its UDP service.
  • grafana.enabled, grafana.service.*, grafana.dashboards.enabled: Grafana and dashboards.
  • clickhouse.enabled (true by default): persistent metrics database.
  • *.persistence.storageClass: leave empty to use the cluster default if that is how the template is implemented; explicitly select a class when needed.

Check the actual names and default values in your revision of values.yaml before deploying.

If using a local chart checkout (CHART=.), validate the default and an alternative backend before installation:

helm lint .
helm template "$RELEASE" . -n "$NAMESPACE" > /tmp/fnm-rendered.yaml

helm lint . --set mongodb.enabled=false --set ferretdb.enabled=true --set fastnetmon_web_api.enabled=false
helm template "$RELEASE" . -n "$NAMESPACE" \
  --set mongodb.enabled=false --set ferretdb.enabled=true --set fastnetmon_web_api.enabled=false \
  > /tmp/fnm-ferretdb.yaml

FastNetMon version

The FastNetMon version is controlled by appVersion in Chart.yaml. The published chart deploys the application version defined by that chart release.

When installing from a local checkout, you can change appVersion before installation:

# Chart.yaml
appVersion: "2.0.385"

This version is shared by all FastNetMon components (FastNetMon Advanced, Web API, TrafficDB, and GoBGP), ensuring they use matching container image tags.

You cannot override appVersion with helm --set. When installing from OCI, use helm show chart "$CHART" --version <chart-version> to inspect the bundled app version; use --version <chart-version> when installing a specific published chart release. To change appVersion directly, use a local checkout.

Install

Install the selected chart source (Kubernetes Secrets must already exist):

helm upgrade --install "$RELEASE" "$CHART" -n "$NAMESPACE" --create-namespace --wait --timeout 10m
kubectl -n "$NAMESPACE" get pods,svc,pvc

helm upgrade is declarative, but it does not migrate data or automatically orchestrate a safe backend change. Check StatefulSet readiness, existing PVCs and application logs.

Network ports and service exposure

Service Port/protocol Exposure
FastNetMon sFlow UDP/6343 ClusterIP or configurable NodePort
FastNetMon NetFlow/IPFIX UDP/2055 ClusterIP or configurable NodePort
FastNetMon gRPC API TCP/50052 Internal Service for Web API
GoBGP gRPC TCP/50051 Internal Service for FastNetMon
GoBGP BGP peering TCP/179 Node hostPort when enabled
MongoDB / FerretDB TCP/27017 Internal Service
ClickHouse native client TCP/9000 Internal Service
TrafficDB UDP/8100 Internal Service
FastNetMon Web API TCP/10007 Optional external HTTP Service / NodePort
Grafana TCP/3000 Optional NodePort, configurable in values.yaml

Kubernetes Service selectors matter: the internal FastNetMon gRPC Service (TCP/50052) targets the FastNetMon Pod; the Web API HTTP Service (TCP/10007) targets the separate Web API Pod. Do not combine them into a single Service with one selector.

For BGP, decide how external neighbors reach TCP/179 on the Kubernetes node. hostPort is appropriate for the original single-node lab, but needs deliberate scheduling and networking for multi-node installations.

Verify the installation

kubectl -n "$NAMESPACE" get pods,svc,deployments,pvc
kubectl -n "$NAMESPACE" exec  deployment/${RELEASE}-fastnetmon -- fcli show fastnetmon_version
kubectl -n "$NAMESPACE" logs deployment/${RELEASE}-fastnetmon  --timestamps --tail=100

Check FastNetMon counters:

kubectl -n "$NAMESPACE" exec deployment/${RELEASE}-fastnetmon -- \
  fcli show system_counters

Operations and troubleshooting

Applying FastNetMon configuration changes

In Kubernetes, instead of running fcli commit, restart the FastNetMon Deployment to apply configuration changes:

kubectl -n "$NAMESPACE" rollout restart deployment/"$RELEASE"-fastnetmon
kubectl -n "$NAMESPACE" rollout status deployment/"$RELEASE"-fastnetmon

Depending on the changes, the Web API and GoBGP, if they enabled, deployments may also need to be restarted to pick up the updated configuration:

# Web API / LiveView (if enabled)
kubectl -n "$NAMESPACE" rollout restart deployment/"$RELEASE"-fastnetmon-web-api

# GoBGP (if enabled)
kubectl -n "$NAMESPACE" rollout restart deployment/"$RELEASE"-gobgp

fastnetmon_client fails with panic: invalid dimensions

With kubectl exec -it, terminal dimensions may initially be 0 0. For an interactive session, wait until a valid terminal size has arrived:

kubectl -n "$NAMESPACE" exec -it deployment/${RELEASE}-fastnetmon -- \
  sh -c 'sleep 2; fastnetmon_client'

Upgrades, backups and uninstall

  • Pin FastNetMon application images using Chart.yaml: appVersion; avoid latest for production.
  • Back up MongoDB/FerretDB, ClickHouse, Grafana and FastNetMon persistent data before major upgrades.
  • Back up generated Secrets securely. Kubernetes Secrets are not a password manager; losing them can prevent services from connecting to existing databases.
  • Be careful with changes to the shared /etc/fastnetmon configuration PVC, which multiple components consume.
  • Helm does not automatically restart every component when another Deployment restarts. Applications should tolerate temporary dependency outages and reconnect.

Upgrade:

helm lint .  # Only when working from a local chart checkout
helm upgrade "$RELEASE" "$CHART" -n "$NAMESPACE"
kubectl -n "$NAMESPACE" get pods,pvc

Uninstall:

helm uninstall "$RELEASE" -n "$NAMESPACE"

Uninstall is not a backup or guaranteed full cleanup. Some StatefulSet-generated PVCs can remain, while other Helm-managed PVCs may be deleted. Check retention behavior and data backups before uninstalling.

References

About

Install FastNetMon Advanced via helm

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages