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

Setup: GCP workload identity configuration #366

Merged
merged 3 commits into from
Nov 4, 2022

Conversation

biancaburtoiu
Copy link
Contributor

@biancaburtoiu biancaburtoiu commented Sep 26, 2022

Document steps to set up Workload Identity federation for GCP clusters.

image
image
image


<a name="bq-name"></a>**BigQuery dataset** requires a BigQuery dataset prefix (e.g. billing_data) in addition to the BigQuery table name. A full example is `billing_data.gcp_billing_export_v1_018AIF_74KD1D_534A2`.
<a name="bq-name"></a>**Service key** If you've created a service account key, copy the contents of the `compute-viewer-kubecost-key.json` file and paste them here (be careful with this!). If you've connected using Workload Identity federation, you should leave this box empty.

### Configuring using values.yaml (Recommended)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to update WI to be recommended

@biancaburtoiu biancaburtoiu force-pushed the biancaburtoiu/gcp-workload-identity-setup branch from 85b38b5 to 34227c8 Compare September 27, 2022 22:11
@biancaburtoiu biancaburtoiu force-pushed the biancaburtoiu/gcp-workload-identity-setup branch from 34227c8 to 6748191 Compare September 27, 2022 22:15
Comment on lines +72 to +77
* Set `.Values.kubecostProductConfigs.projectID = <GCP Project ID that contains the BigQuery Export>`
* Set `.Values.kubecostProductConfigs.bigQueryBillingDataDataset = <DATASET.TABLE_NAME that contains the billing export>`

If you've connected using Workload Identity federation:
* Set `.Values.nodeSelector = iam.gke.io/gke-metadata-server-enabled: "true"` to update the Kubecost deployment to run on nodes that use Workload Identity
* Set `.Values.serviceAccount.annotations = iam.gke.io/gcp-service-account: compute-viewer-kubecost@$PROJECT_ID.iam.gserviceaccount.com` where $PROJECT_ID defined in the `gcloud` commands above
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Sean-Holcomb I've also added a nodeSelector constraint and moved the deployment annotation to the helm params

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good

@biancaburtoiu biancaburtoiu marked this pull request as ready for review September 27, 2022 22:17
@biancaburtoiu biancaburtoiu requested a review from a team as a code owner September 27, 2022 22:17
Copy link
Contributor

@brstuder brstuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +72 to +77
* Set `.Values.kubecostProductConfigs.projectID = <GCP Project ID that contains the BigQuery Export>`
* Set `.Values.kubecostProductConfigs.bigQueryBillingDataDataset = <DATASET.TABLE_NAME that contains the billing export>`

If you've connected using Workload Identity federation:
* Set `.Values.nodeSelector = iam.gke.io/gke-metadata-server-enabled: "true"` to update the Kubecost deployment to run on nodes that use Workload Identity
* Set `.Values.serviceAccount.annotations = iam.gke.io/gcp-service-account: compute-viewer-kubecost@$PROJECT_ID.iam.gserviceaccount.com` where $PROJECT_ID defined in the `gcloud` commands above
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good

@srpomeroy
Copy link
Contributor

Waiting for 1.98 to merge.

@biancaburtoiu biancaburtoiu merged commit b79c9ac into main Nov 4, 2022
@srpomeroy srpomeroy deleted the biancaburtoiu/gcp-workload-identity-setup branch November 11, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants