Skip to content
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

Update README usage instructions based on the publicly available chart #9

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all 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
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# kubenetmon

## What is kubenetmon?
`kubenetmon` is a service built and used at [ClickHouse](clickhouse.com) for Kubernetes data transfer metering in all 3 major cloud providers: AWS, GCP, and Azure.
`kubenetmon` is a service built and used at [ClickHouse](https://clickhouse.com) for Kubernetes data transfer metering in all 3 major cloud providers: AWS, GCP, and Azure.

`kubenetmon` is packaged as a Helm chart with a Docker image. The chart is available at [https://kubenetmon.clickhouse.tech/index.yaml](https://kubenetmon.clickhouse.tech/index.yaml). See below for detailed usage instructions.

## What can kubenetmon be used for?
At ClickHouse Cloud, we use `kubenetmon` to meter data transfer of all of our workloads running in Kubernetes. With the data `kubenetmon` collects and stores in ClickHouse, we are able to answer questions such as:
Expand Down Expand Up @@ -70,23 +72,35 @@ TTL intervalStartTime + toIntervalDay(90)
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1;
```

All you now need is a Kubernetes cluster where you want to meter data transfer. First, we create two namespaces:
All you now need is a Kubernetes cluster where you want to meter data transfer.

(**Optional**) If you don't have a test k8s cluster, you can spin up a `kind` cluster using config in this repository like so:
```
kubectl create namespace kubenetmon-server
kubectl create namespace kubenetmon-agent
kind create cluster --config=test/kind-config.yaml
```

**Optional** (if you don't have many workloads running in the cluster, you can install some mock services)
(**Optional**) And if you don't have many workloads running in the cluster, you can install some mock services)
```
helm repo add podinfo https://stefanprodan.github.io/podinfo
helm upgrade --install --wait backend --namespace default --set redis.enabled=true podinfo/podinfo
helm upgrade --install --wait frontend --namespace default --set redis.enabled=true podinfo/podinfo
```

Next, we create two namespaces:
```
kubectl create namespace kubenetmon-server
kubectl create namespace kubenetmon-agent
```

Let's add this Helm repository:
```
helm repo add kubenetmon https://kubenetmon.clickhouse.tech
```

We now install `kubenetmon-server`. `kubenetmon-server` expects an environment, cluster name, cloud provider name (`aws`, `gcp`, or `azure`), and region, so we provide these. We are also going to supply connection credentials for our ClickHouse instance:
```
helm install kubenetmon-server kubenetmon-server/kubenetmon-server-1.0.0.tgz --namespace kubenetmon-server \
--set image.repository=ghcr.io/clickhouse/kubenetmon \
--set image.tag=latest \
helm install kubenetmon-server kubenetmon/kubenetmon-server \
--namespace kubenetmon-server \
--set region=us-west-2 \
--set cluster=cluster \
--set environment=development \
Expand Down Expand Up @@ -117,19 +131,16 @@ you need to enable it on the nodes with:
```
**This is an important step, don't skip it!**

For example, to test getting data transfer information from just one node, I can run:
For example, to test getting data transfer information from all nodes in the kind cluster, you can run:
```
➜ ~ kubectl node-shell kind-worker
spawning "nsenter-b3sdnm" on "kind-worker"
If you don't see a command prompt, try pressing enter.
root@kind-worker:/# /bin/echo "1" > /proc/sys/net/netfilter/nf_conntrack_acct
for node in $(kubectl get nodes -o name); do
kubectl node-shell ${node##node/} -- /bin/sh -c '/bin/echo "1" > /proc/sys/net/netfilter/nf_conntrack_acct'
done
```

This node is now ready to host `kubenetmon-agent`, so let's install it.
Nodes are now ready to host `kubenetmon-agent`, so let's install it.
```
helm install kubenetmon-agent kubenetmon-agent/kubenetmon-agent-1.0.0.tgz --namespace kubenetmon-agent \
--set image.repository=ghcr.io/clickhouse/kubenetmon \
--set image.tag=latest
helm install kubenetmon-agent kubenetmon/kubenetmon-agent --namespace kubenetmon-agent
```

Let's check the logs:
Expand Down