Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: document GCP IAM #4

Merged
merged 1 commit into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
]
}
Loading