Skip to content

Files

Latest commit

 

History

History
 
 

gatekeeper

Agent Check: gatekeeper

Overview

This check collects metrics from OPA Gatekeeper.

Gatekeeper Overview Dashboard

Setup

Follow the instructions below to install and configure this check for an Agent running on a Kubernetes cluster. See also the Autodiscovery Integration Templates for guidance on applying these instructions.

Installation

Agent versions >=7.26.0 or >=6.26.0

To use an integration from integrations-extra with the Docker Agent, Datadog recommends building the Agent with the integration installed. Use the following Dockerfile to build an updated version of the Agent that includes the gatekeeper integration from integrations-extras:

FROM gcr.io/datadoghq/agent:latest
RUN agent integration install -r -t datadog-gatekeeper==<INTEGRATION_VERSION>

Agent versions <7.26.0 or <6.26.0

To install the gatekeeper check on your Kubernetes cluster:

  1. Install the developer toolkit.

  2. Clone the integrations-extras repository:

    git clone https://github.com/DataDog/integrations-extras.git.
  3. Update your ddev config with the integrations-extras/ path:

    ddev config set extras ./integrations-extras
  4. To build the gatekeeper package, run:

    ddev -e release build gatekeeper
  5. Download the Agent manifest to install the Datadog Agent as a DaemonSet.

  6. Create two PersistentVolumeClaims, one for the checks code, and one for the configuration.

  7. Add them as volumes to your Agent pod template and use them for your checks and configuration:

         env:
           - name: DD_CONFD_PATH
             value: "/confd"
           - name: DD_ADDITIONAL_CHECKSD
             value: "/checksd"
       [...]
         volumeMounts:
           - name: agent-code-storage
             mountPath: /checksd
           - name: agent-conf-storage
             mountPath: /confd
       [...]
       volumes:
         - name: agent-code-storage
           persistentVolumeClaim:
             claimName: agent-code-claim
         - name: agent-conf-storage
           persistentVolumeClaim:
             claimName: agent-conf-claim
  8. Deploy the Datadog Agent in your Kubernetes cluster:

    kubectl apply -f agent.yaml
  9. Copy the integration artifact .whl file to your Kubernetes nodes or upload it to a public URL

  10. Run the following command to install the integrations wheel with the Agent:

    kubectl exec ds/datadog -- agent integration install -w <PATH_OF_GATEKEEPER_ARTIFACT_>/<GATEKEEPER_ARTIFACT_NAME>.whl
  11. Run the following commands to copy the checks and configuration to the corresponding PVCs:

    kubectl exec ds/datadog -- sh
    # cp -R /opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/* /checksd
    # cp -R /etc/datadog-agent/conf.d/* /confd
  12. Restart the Datadog Agent pods.

Configuration

  1. Edit the gatekeeper/conf.yaml file, in the /confd folder that you added to the Agent pod to start collecting your gatekeeper performance data. See the sample gatekeeper/conf.yaml for all available configuration options.

  2. Restart the Agent.

Validation

Run the Agent's status subcommand and look for gatekeeper under the Checks section.

Data Collected

Metrics

See metadata.csv for a list of metrics provided by this check.

Events

Gatekeeper does not include any events.

Service Checks

See service_checks.json for a list of service checks provided by this integration.

Troubleshooting

Need help? Contact Datadog support.