This Helm chart deploys the Datakit agent as a DaemonSet for a GKE Autopilot cluster. It is designed to collect metrics, traces, and logs from all nodes in your cluster.
This chart is optimized for GKE Autopilot but is compatible with most Kubernetes distributions.
- Kubernetes 1.19+
- Helm 3.2.0+
kubectlconfigured to communicate with your cluster.
To get started, you need to clone or download the Helm chart, and then install the chart with your specific configuration values.
git clone https://github.com/TrueWatchTech/datakit-gke-autopilot-helm-chart.gitThe following command installs the Datakit chart. You must replace the placeholder values for datakit.dataway, datakit.clusterName, and datakit.election.namespace.
# Replace <release-name> with a name for this installation (e.g., "datakit-agent")
# Replace <your-namespace> with the target namespace (e.g., "monitoring")
helm install <release-name> ./datakit-gke-autopilot-helm-chart \
--namespace <your-namespace> \
--create-namespace \
--set datakit.dataway="<YOUR_DATAWAY_URL_WITH_TOKEN>" \
--set datakit.clusterName="<YOUR_CLUSTER_NAME>" \
--set datakit.election.namespace="<YOUR_CLUSTER_NAME>"For a more robust setup, it is recommended to create a custom values.yaml file and pass it during installation:
# values.yaml
datakit:
dataway: "<YOUR_DATAWAY_URL_WITH_TOKEN>"
clusterName: "<YOUR_CLUSTER_NAME>"
election:
namespace: "<YOUR_CLUSTER_NAME>"Then install using:
helm install <release-name> ./datakit-gke-autopilot-helm-chart -f values.yaml --namespace <your-namespace> --create-namespaceTo uninstall the release, use the following command:
helm uninstall <release-name> -n <your-namespace>This will remove all Kubernetes components associated with the chart.
Here are some common steps to troubleshoot a failing Datakit installation.
-
Check Pod Status: Verify that the Datakit pods are running correctly.
kubectl get pods -n <your-namespace> -l app=daemonset-datakit
-
View Pod Logs: Check the logs of the main
datakitcontainer for any errors.kubectl logs -n <your-namespace> -l app=daemonset-datakit -c datakit
-
Pods Stuck in
InitState: If a pod is stuck in theInitstate, it usually indicates a problem with thefix-permissionsinitContainer. Check its logs:# Replace <pod-name> with the actual name of the stuck pod kubectl logs <pod-name> -n <your-namespace> -c fix-permissions
A common error is
chown: ... Read-only file system. This chart is structured to avoid this error by correctly setting permissions on directories without attempting to modify read-only files mounted from ConfigMaps. -
Check Pod Events: Use
describe podto see detailed events, which can reveal issues with image pulling, volume mounting, or scheduling.kubectl describe pod <pod-name> -n <your-namespace>
The following table lists the most common configurable parameters of the Datakit chart and their default values.
| Parameter | Description | Default |
|---|---|---|
image.repository |
Image repository for the Datakit agent. | pubrepo.truewatch.com/truewatch/datakit |
image.tag |
Image tag to use. Overrides appVersion in Chart.yaml. |
"1.86.1" |
image.pullPolicy |
Image pull policy. | IfNotPresent |
serviceAccount.create |
If true, a ServiceAccount will be created for the pods. |
true |
serviceAccount.name |
The name of the ServiceAccount to use. |
"datakit" |
initContainer.image |
Image for the init container that sets file permissions. | busybox:1.35 |
datakit.dataway |
Required. The Dataway endpoint URL including your access token. | "<YOUR_DATAWAY_URL_WITH_TOKEN>" |
datakit.clusterName |
Required. A unique name for your Kubernetes cluster. | "<YOUR_CLUSTER_NAME>" |
datakit.globalHostTags |
Global tags to apply to all collected data. __datakit_hostname and __datakit_ip are special placeholders. |
"host=__datakit_hostname,host_ip=__datakit_ip" |
datakit.defaultEnabledInputs |
A comma-separated list of default Datakit inputs to enable. | "statsd,dk,cpu,disk,diskio,mem,... |
datakit.election.enable |
Set to "enable" to activate leader election for certain inputs (e.g., kubernetesprometheus). |
"enable" |
datakit.election.namespace |
Required. A unique namespace for leader election, typically the same as the cluster name. | "<YOUR_CLUSTER_NAME>" |
datakit.resources |
CPU/Memory resource requests and limits for the Datakit container. | { requests: { cpu: "500m", memory: "512Mi" }, ... } |
networkPolicy.create |
If true, create a NetworkPolicy to allow ingress traffic to Datakit ports. |
true |
rbac.create |
If true, create the necessary ClusterRole and ClusterRoleBinding. |
true |
dkconfig |
A list of custom configuration files to be mounted into the conf.d directory. This is useful for enabling additional inputs like MySQL, Redis, etc. See values.yaml for an example structure. |
[] |
For more information about Datakit, visit the TrueWatch documentation.
This chart is provided as-is for use with TrueWatch Datakit.