Installation

Prerequisites

Kubernetes

To install the Kubewise K8s agent, you need a Kubernetes cluster running version v1.26 or newer. It can be any flavor of Kubernetes, deployed on any cloud provider like GKE, EKS, AKS, or even on bare metal, as long as you have the rights to create resources on it.

Earlier versions of Kubernetes can work if your applications use only the Kubernetes non-alpha/beta APIs (apps/v1, autoscaling/v2, batch/v1, core/v1, networking/v1). If not, your application will not be monitored by Kubewise.

Helm

To install the Kubewise Kubernetes agent in your cluster, you need Helm v3+ installed on your local machine.

Prepare Your Kubernetes Cluster

By default the K8s agent will collect metadata from all resources present in all namespaces (excluding kube-system, kube-public, kube-node-lease and kubewise namespaces). You can fine-tune metadata retrieval for each Kubernetes resource by adding annotations on Kuberentes resources or by further configuring the K8s agent directly.

Note

If you plan to use Kubewise’s cost breakdown tool, you must add specific annotations to nodes and storage classes.

Installation

Note

Ensure your kubectl client is configured to point to the cluster where you want to deploy the K8s agent.

First, add the Kubewise chart repository to Helm:

helm repo add kubewise https://kubewise.github.io/helm-charts
helm repo update

Note: The v0.4.0 specified in this documentation may not be the latest version. To find the latest version of the Kubewise Kubernetes agent, run:

helm search repo kubewise/k8s-agent --versions | awk 'FNR>1 {print \$2}' | sort -r | head -n1

Once you have the latest version, install the Kubernetes agent with the following command (you can replace myrelease with the name of your cluster):

helm install myrelease kubewise/k8s-agent \
  --atomic \
  --namespace kubewise \
  --create-namespace \
  --version v0.4.0 \
  --set credentials.clusterId="<your_kubewise_cluster_id>" \
  --set credentials.apiKey="<your_kubewise_cluster_api_key>"

Make sure to replace the version, cluster id, and API key with your corresponding values.

For further configuration of the K8s agent deployment, refer to the configuration section.

Note

You cannot run more than one instance of the K8s agent per cluster. If you try to do so, the second instance will crash, indicating that the authentication has been rejected.