Google Kubernetes Engine, Agent
Overview
Google Kubernetes Engine (GKE), a service on the Google Cloud Platform (GCP), is a hosted platform for running and orchestrating containerized applications. Similar to Amazon’s Elastic Container Service (ECS), GKE manages Docker containers deployed on a cluster of machines. However, unlike ECS, GKE uses Kubernetes.
Setup
Prerequisites
Ensure that your role in your GCP project
has the proper permissions to use GKE.
Enable the Google Container Engine API
for your project.
Install the Google Cloud SDK
and the kubectl
command line tool on your local machine. Once you pair the Cloud SDK with your GCP account
, you can control your clusters directly from your local machine using kubectl
.
Create a small GKE cluster named doglib
with the ability to access the Cloud Datastore by running the following command:
$ gcloud container clusters create doglib --num-nodes 3 --zone "us-central1-b" --scopes "cloud-platform"
Set up the GCE integration
Install the Google Cloud Platform
integration.
You can then access an out-of-the-box Google Compute Engine dashboard
that displays metrics like disk I/O, CPU utilization, and network traffic.
Set up the GKE integration
Choose a mode of operation. A mode of operation refers to the level of flexibility, responsibility, and control that you have over your cluster. GKE offers two modes of operation:
Standard: You manage the cluster’s underlying infrastructure, giving you node configuration flexibility.
Autopilot: Google provisions and manages the entire cluster’s underlying infrastructure, including nodes and node pools, giving you an optimized cluster with a hands-off experience.
Autopilot
Install Helm.
Add the Datadog repository to your Helm repositories:
helm repo add datadog https://helm.datadoghq.com
helm repo update
- Deploy the Datadog Agent and Cluster Agent on Autopilot with the following command:
helm install <RELEASE_NAME> \
--set datadog.apiKey=<DATADOG_API_KEY> \
--set datadog.appKey=<DATADOG_APP_KEY> \
--set clusterAgent.enabled=true \
--set clusterAgent.metricsProvider.enabled=true \
--set providers.gke.autopilot=true \
datadog/datadog
Note: If you also wish to enable logs or traces, add lines to this command setting datadog.logs.enabled
(for logs) and datadog.apm.enabled
(for traces) to true
. For example:
helm install --name <RELEASE_NAME> \
--set datadog.apiKey=<DATADOG_API_KEY> \
--set datadog.appKey=<DATADOG_APP_KEY> \
--set clusterAgent.enabled=true \
--set clusterAgent.metricsProvider.enabled=true \
--set providers.gke.autopilot=true \
--set datadog.logs.enabled=true \
--set datadog.apm.enabled=true \
datadog/datadog
See the [Datadog helm-charts repository][1] for a full list of configurable values.
Admission Controller
To use [Admission Controller][2] with Autopilot, set the [configMode
][3] of the Admission Controller to either service
or hostip
.
Because Autopilot does not allow socket
mode, Datadog recommends using service
(with hostip
as a fallback) to provide a more robust layer of abstraction for the controller.
[1]: https://github.com/DataDog/helm-charts/tree/master/charts/datadog#values
[2]: https://docs.datadoghq.com/containers/cluster_agent/admission_controller/?tab=operator
[3]: https://github.com/DataDog/helm-charts/blob/main/charts/datadog/values.yaml#L922
Further Reading