Skip to content

Commit

Permalink
Merge pull request #4 from planetscale/gcp-docs
Browse files Browse the repository at this point in the history
docs: document GCP IAM
  • Loading branch information
joemiller authored May 18, 2024
2 parents 8c0a6e8 + e11577a commit 965d678
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,26 @@ You need to create an AWS IAM Role that can be used by `k8s-pvc-tagger`. For EKS

#### GCP Service Account

TBD/TODO: fill in details here, possibly even a custom role with minimum needed perms
You need a GCP Service Account (GSA) that can be used by `k8s-pvc-tagger`. For GKE clusters, [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) should be used instead of a static JSON key.

It is recommended you create a custom IAM role for use by `k8s-pvc-tagger`. The permissions needed are:

- compute.disks.get
- compute.disks.list
- compute.disks.setLabels

An example terraform resources is in [examples/gcp-custom-role.tf](examples/gcp-custom-role.tf).

Or, with `gcloud`:

```sh
gcloud iam roles create CustomDiskRole \
--project=<your-project-id> \
--title="k8s-pvc-tagger" \
--description="Custom role to manage disk permissions" \
--permissions="compute.disks.get,compute.disks.list,compute.disks.setLabels" \
--stage="GA"
```

#### Install via helm

Expand Down
11 changes: 11 additions & 0 deletions examples/gcp-custom-role.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "google_project_iam_custom_role" "k8s-pvc-tagger" {
project = var.gcp_project
role_id = "k8s-pvc-tagger"
title = "k8s-pvc-tagger"
description = "A Custom role with minimum permission set for k8s-pvc-tagger"
permissions = [
"compute.disks.get",
"compute.disks.list",
"compute.disks.setLabels",
]
}

0 comments on commit 965d678

Please sign in to comment.