canonical: https://jentic.com/apis/googleapis.com/gkebackup

# Google Backup for GKE API

Backup for GKE is a managed service that backs up and restores Kubernetes workloads running on Google Kubernetes Engine. The API manages backup plans, individual backups, restore plans, and restore operations, including selective restores of namespaces and resources. It captures both Kubernetes object state and persistent volume data so clusters can recover from accidental deletion, region outages, or operator errors.

## For AI agents

Create backup plans, trigger backups, and restore Kubernetes workloads in GKE clusters, including persistent volume data. Built for SRE and disaster-recovery automation.

## Scope

Does not back up VMs, Cloud SQL, or non-GKE workloads, and does not provision clusters - use the Container API to manage clusters and Backup and DR Service for non-Kubernetes assets.

## Capabilities

- Create a backup plan that schedules cluster backups
- List and inspect existing backup plans across regions
- Trigger an on-demand backup of a GKE cluster
- Browse volume backups produced by a cluster backup
- Define a restore plan with namespace and resource selectors
- Trigger a restore from a backup into a target cluster
- Generate a download URL for a backup index for offline inspection

## Use cases

### Scheduled Disaster Recovery for GKE

Platform teams running production GKE clusters need a managed backup that captures both Kubernetes objects and persistent volumes. The Backup for GKE API creates a backup plan with a cron schedule and retention policy, then automatically produces backups in cluster-specified regions. Operators can list backups and trigger ad-hoc captures before risky changes.

Example prompt: Call POST /v1/projects/{project}/locations/{location}/backupPlans with a cluster reference and a daily cron schedule, then verify the plan in GET on the same path.

### Pre-Deployment Snapshots

Before applying a major change to a cluster, SREs trigger an on-demand backup so a known-good state exists if rollback is needed. The backups endpoint creates a backup tied to a backup plan, capturing both objects and PV data, and returns a long-running operation that can be polled to completion.

Example prompt: Call POST /v1/projects/{project}/locations/{location}/backupPlans/{backupPlan}/backups to create an on-demand backup and poll the operation until it completes.

### Selective Restore After Operator Error

When a deployment accidentally deletes a namespace or modifies critical resources, operators need to restore only that namespace without overwriting unrelated workloads. The restore plan supports namespace and resource selectors, and a restore can be targeted at the original cluster or a different recovery cluster, minimising blast radius.

Example prompt: Call POST /v1/projects/{project}/locations/{location}/restorePlans with selectedNamespaces, then POST under that plan to start a restore from a specific backup.

### Agent-Driven Backup Operations

An AI agent integrated with on-call tooling can trigger pre-deployment backups when a deployment is approved, then poll for completion before allowing the rollout. Through Jentic, the agent searches for the backup-create operation, loads its schema, and executes it without holding raw service account keys.

Example prompt: Use Jentic to search 'create a gke backup', load the backups create schema, and execute it before each production deploy in the rollout pipeline.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /v1/{+parent}/backupPlans | List backup plans in a location |
| POST | /v1/{+parent}/backupPlans | Create a backup plan |
| GET | /v1/{+parent}/backups | List backups for a plan |
| POST | /v1/{+parent}/backups | Create an on-demand backup |
| GET | /v1/{+parent}/restorePlans | List restore plans |
| POST | /v1/{+parent}/restorePlans | Create a restore plan |
| POST | /v1/{+parent}/restores | Start a restore from a backup |
| POST | /v1/{+name}:cancel | Cancel a long-running operation |

## Key resources

- **backupPlans** — Schedule and configuration for cluster backups.
- **backups** — Captured cluster state, including objects and persistent volumes.
- **volumeBackups** — Per-volume snapshots produced by a backup.
- **restorePlans** — Restore configuration with namespace and resource selectors.
- **restores** — Individual restore operations from a backup.

## Why Jentic

- **Setup:** Wiring the Backup for GKE API by hand means standing up Google OAuth 2.0 with a service account, requesting the cloud-platform scope, and polling the long-running backup and restore operations yourself. Through Jentic you install once, import the Backup for GKE API from the API Directory, store the service-account credential once, and your agent calls it.
- **Permission scoping:** Backup for GKE puts the parent project and location in the URL path (/v1/{parent}/backupPlans, /v1/{parent}/restorePlans), so a rule can pin your agent to one project and location: it can list and create backup plans there and nothing else. You choose the operations it may call, so restores are not included unless you add them.
- **Credential handling:** Your Google service-account credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a GKE backup' or 'restore a Kubernetes namespace', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Kubernetes Engine API** — Manages the GKE clusters that this API backs up.
- **Backup and DR Service API** — Broader backup service covering VMs, databases, and file shares.
- **GKE Hub API** — Registers and manages fleet membership for GKE clusters.
- **Compute Engine API** — Provides the underlying disks that volume backups protect.

## FAQ

### What authentication does the Backup for GKE API use?

It uses Google OAuth 2.0 with the cloud-platform scope, typically through a service account. Through Jentic, those credentials live encrypted in the vault and the agent receives scoped, short-lived bearer tokens.

### Can I restore only a specific namespace with this API?

Yes. A RestorePlan supports selectedNamespaces and resource filters, and the resulting restore only applies the chosen namespaces or resources rather than the full cluster contents.

### What are the rate limits for the Backup for GKE API?

Google enforces standard per-project quotas on management calls (typically several hundred requests per minute). The actual backup and restore operations are long-running and limited by cluster size and disk throughput rather than API rate.

### How do I trigger a backup before a deployment through Jentic?

Search Jentic for 'create a gke backup', load the schema for POST /v1/{parent}/backups, and execute it pointing at the backup plan, then poll the returned operation for completion.

### Is the Backup for GKE API free?

The API itself has no surcharge, but storage of backup data and persistent volume snapshots is billed under Backup for GKE pricing. See the GKE pricing docs for current rates.

### Does this API back up Kubernetes secrets and configmaps?

Yes, by default backups capture the full set of Kubernetes resources for the targeted namespaces, including configmaps and secrets, alongside persistent volume data. RestorePlan filters can exclude specific resource kinds when restoring.

### Can I limit what my agent is allowed to do with the Backup for GKE API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials your agent may use with the Backup for GKE API. Since the API carries the project and location in the URL path, such as /v1/{parent}/backupPlans and /v1/{parent}/restorePlans, you can pin the agent to a single project and location and grant only the calls you intend, for example listing and creating backup plans while withholding restores. The service-account credential stays with your own instance and is added only at execution, never exposed to the agent.
