Skip to main content

GCP

Causely provides native integration with the Google Cloud API to retrieve relevant information about your cloud environment. To set up this integration, you need a Service Account (Account) with Viewer on the projects you want to monitor.

Step 1: Create a Service Account (SA)

Use the following gcloud command to create an SA:

gcloud iam service-accounts create causely \
--description="causely" \
--display-name="causely"

gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:causely@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/viewer"

gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:causely@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/monitoring.viewer"

gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:causely@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/bigtable.viewer"

Step 2: Create a Kubernetes Secret for the SA Credentials

After creating the SA, save its credentials .json in a Kubernetes Secret.

kubectl create secret --namespace causely generic gcp-credentials \
--from-file=service_account.json=path_to_service_account.json \
--from-literal=project_id=PROJECT_ID

Step 3: Update Causely Configuration

Once the Secret is created, update the Causely configuration to enable scraping for the new project. Below is an example configuration:

scrapers:
gcp:
enabled: true
projects:
- secretName: gcp-credentials
namespace: causely

Alternative: Enable Credentials Autodiscovery

Causely also supports credentials autodiscovery. This feature allows you to add new scraping targets without updating the Causely configuration. Simply label the Kubernetes Secret to enable autodiscovery for the corresponding scraper.

Example: Labeling Secrets for Autodiscovery

kubectl --namespace causely label secret gcp-credentials "causely.ai/scraper=GCP"

With these steps, you can seamlessly integrate Causely with the Google Cloud API and configure it to monitor your desired resources.

Configure individual Resources

You have to enable the resources you want causely to discover and monitor.