Skip to content

TrueWatchTech/datakit-gke-autopilot-helm-chart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datakit GKE Autopilot Helm Chart

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.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+
  • kubectl configured to communicate with your cluster.

Quick Start

To get started, you need to clone or download the Helm chart, and then install the chart with your specific configuration values.

1. Git clone the chart

git clone https://github.com/TrueWatchTech/datakit-gke-autopilot-helm-chart.git

2. Install the Chart

The 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-namespace

Uninstalling the Chart

To uninstall the release, use the following command:

helm uninstall <release-name> -n <your-namespace>

This will remove all Kubernetes components associated with the chart.

Troubleshooting

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 datakit container for any errors.

    kubectl logs -n <your-namespace> -l app=daemonset-datakit -c datakit
  • Pods Stuck in Init State: If a pod is stuck in the Init state, it usually indicates a problem with the fix-permissions initContainer. 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 pod to see detailed events, which can reveal issues with image pulling, volume mounting, or scheduling.

    kubectl describe pod <pod-name> -n <your-namespace>

Configuration

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. []

Support

For more information about Datakit, visit the TrueWatch documentation.

License

This chart is provided as-is for use with TrueWatch Datakit.

About

This Helm chart deploy datakit for GKE autopilot cluster.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages