This page describes how to use VPC Service Controls to protect Backup for GKE resources. For more information about VPC Service Controls, read the Overview of VPC Service Controls.
Before you begin
Ensure that you have the required IAM permissions to administer VPC Service Controls.
Create a service perimeter to protect Backup for GKE resources
-
In the Google Cloud console, go to the VPC Service Controls page.
If you are prompted, select your Organization.
On the VPC Service Controls page, click New Perimeter.
On the New VPC Service Perimeter page, in the Perimeter Name box, type a name for the perimeter.
Select the projects that you want to secure within the perimeter:
Click Add Projects button.
To add a project to the perimeter, in the Add Projects dialog, select that project's checkbox.
Click Add n Projects button, where n is the number of projects you selected in the previous step.
Select Backup for GKE to secure within the perimeter:
Click Add Services button.
To secure Backup for GKE within the perimeter, in the Specify services to restrict dialog, select Backup for GKE's checkbox.
Click Add Backup for GKE API button.
Click Save button.
You've created a service perimeter that restricts access to Backup for GKE resources. The service perimeter may take up to 30 minutes to propagate and take effect. When the changes have propagated, access to Backup for GKE will be limited for the projects you added to the perimeter. For example, no backup plan or backup can be created from outside of the perimeter, unless otherwise explicitly allowed by an ingress rule.
Details about how Backup for GKE works with service perimeters
If Backup for GKE is not among the list of VPC accessible services of a service perimeter, backup and restore may fail even if you are able to create backup or restore using the Google Cloud console or gcloud CLI. This is because the Backup for GKE agent is running in your GKE cluster (within the service perimeter) and requires access to Backup for GKE to perform backup and restore.
Backup for GKE doesn't support cross-project backup and restore, so creating an egress policy to allow access to Backup for GKE resources in another project has no effect. This is because, by definition, if a project is within a service perimeter, all of its GKE clusters are considered within the service perimeter.