Skip to content

Commit 634b46c

Browse files
authored
Update README usage instructions based on the publicly available chart (#9)
The chart is now available at https://kubenetmon.clickhouse.tech/index.yaml with packages publicly accessible at e.g. https://github.com/ClickHouse/kubenetmon/releases/download/kubenetmon-agent-1.0.2/kubenetmon-agent-1.0.2.tgz.
1 parent 4ecbce9 commit 634b46c

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

README.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# kubenetmon
22

33
## What is kubenetmon?
4-
`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.
4+
`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.
5+
6+
`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.
57

68
## What can kubenetmon be used for?
79
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:
@@ -70,23 +72,35 @@ TTL intervalStartTime + toIntervalDay(90)
7072
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1;
7173
```
7274

73-
All you now need is a Kubernetes cluster where you want to meter data transfer. First, we create two namespaces:
75+
All you now need is a Kubernetes cluster where you want to meter data transfer.
76+
77+
(**Optional**) If you don't have a test k8s cluster, you can spin up a `kind` cluster using config in this repository like so:
7478
```
75-
kubectl create namespace kubenetmon-server
76-
kubectl create namespace kubenetmon-agent
79+
kind create cluster --config=test/kind-config.yaml
7780
```
7881

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

89+
Next, we create two namespaces:
90+
```
91+
kubectl create namespace kubenetmon-server
92+
kubectl create namespace kubenetmon-agent
93+
```
94+
95+
Let's add this Helm repository:
96+
```
97+
helm repo add kubenetmon https://kubenetmon.clickhouse.tech
98+
```
99+
85100
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:
86101
```
87-
helm install kubenetmon-server kubenetmon-server/kubenetmon-server-1.0.0.tgz --namespace kubenetmon-server \
88-
--set image.repository=ghcr.io/clickhouse/kubenetmon \
89-
--set image.tag=latest \
102+
helm install kubenetmon-server kubenetmon/kubenetmon-server \
103+
--namespace kubenetmon-server \
90104
--set region=us-west-2 \
91105
--set cluster=cluster \
92106
--set environment=development \
@@ -117,19 +131,16 @@ you need to enable it on the nodes with:
117131
```
118132
**This is an important step, don't skip it!**
119133

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

128-
This node is now ready to host `kubenetmon-agent`, so let's install it.
141+
Nodes are now ready to host `kubenetmon-agent`, so let's install it.
129142
```
130-
helm install kubenetmon-agent kubenetmon-agent/kubenetmon-agent-1.0.0.tgz --namespace kubenetmon-agent \
131-
--set image.repository=ghcr.io/clickhouse/kubenetmon \
132-
--set image.tag=latest
143+
helm install kubenetmon-agent kubenetmon/kubenetmon-agent --namespace kubenetmon-agent
133144
```
134145

135146
Let's check the logs:

0 commit comments

Comments
 (0)