Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Commit 4d2e1aa

Browse files
author
Mathieu Benoit
committed
more explanations about the billing.user role restriction and alternatives
1 parent 9976fd4 commit 4d2e1aa

File tree

2 files changed

+44
-5
lines changed

2 files changed

+44
-5
lines changed

content/config-controller/create-config-controller.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ gcloud organizations add-iam-policy-binding ${ORG_OR_FOLDER_ID} \
127127
{{% /tab %}}
128128
{{< /tabs >}}
129129

130-
Set the `billing.user`, `serviceusage.serviceUsageAdmin` and `iam.serviceAccountAdmin` roles:
130+
Set the `serviceusage.serviceUsageAdmin` and `iam.serviceAccountAdmin` roles:
131131
```Bash
132-
gcloud beta billing accounts add-iam-policy-binding ${BILLING_ACCOUNT_ID} \
133-
--member="serviceAccount:${CONFIG_CONTROLLER_SA}" \
134-
--role='roles/billing.user'
135132
gcloud projects add-iam-policy-binding ${CONFIG_CONTROLLER_PROJECT_ID} \
136133
--member="serviceAccount:${CONFIG_CONTROLLER_SA}" \
137134
--role='roles/serviceusage.serviceUsageAdmin'
@@ -140,6 +137,16 @@ gcloud projects add-iam-policy-binding ${CONFIG_CONTROLLER_PROJECT_ID} \
140137
--role='roles/iam.serviceAccountAdmin'
141138
```
142139

140+
Finally, you need to assign the `billing.user` role too. Later in this workshop, it will be needed to attach a `Project` to a Billing Account. If you don't have the proper role you may have an error by running the command below. In this case you need to ask your Billing Account or Organization admins in order to run this command for you.
141+
```Bash
142+
gcloud beta billing accounts add-iam-policy-binding ${BILLING_ACCOUNT_ID} \
143+
--member="serviceAccount:${CONFIG_CONTROLLER_SA}" \
144+
--role='roles/billing.user'
145+
```
146+
{{% notice note %}}
147+
In some specific scenario, you may not be able to accomplish this step. You could skip it for now, another way to assign the Billing Account to a `Project` will be provided later in this workshop, when you will need it.
148+
{{% /notice %}}
149+
143150
## Check deployments
144151

145152
List the GCP resources created:

content/gke-project/create-gke-project.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,36 @@ getting 1 RepoSync and RootSync from krmapihost-configcontroller
188188
│ resourcemanager.cnrm.cloud.google.com │ Project │ acm-workshop-463-gke │ config-control │
189189
│ serviceusage.cnrm.cloud.google.com │ Service │ cloudbilling.googleapis.com │ config-control │
190190
└───────────────────────────────────────┴────────────────────────┴─────────────────────────────────┴──────────────────────┘
191-
```
191+
```
192+
193+
Here, if you skipped the assignment of the `billing.user` role earlier while you were setting up your Config Controller instance, you will have an error with the creation of the `Project`. A simple way to make sure you don't have any error is to run this command below:
194+
```Bash
195+
kubectl get gcpproject -n config-control
196+
```
197+
198+
If the output is similar to this below, you are good:
199+
```Plaintext
200+
NAMESPACE NAME AGE READY STATUS STATUS AGE
201+
config-control acm-workshop-463-gke 24m True UpToDate 21m
202+
```
203+
204+
But if you have this output below, that's where you will need to take actions:
205+
```Plaintext
206+
NAMESPACE NAME AGE READY STATUS STATUS AGE
207+
config-control acm-workshop-463-gke 24m True UpdateFailed 21m
208+
```
209+
210+
With a closer look at the error by running this command `kubectl descibe gcpproject -n config-control`, you will see that the error is similar too:
211+
```Plaintext
212+
Update call failed: error applying desired state: summary: Error setting billing account "XXX" for project "projects/acm-workshop-463-gke": googleapi: Error 403: The caller does not have permission, forbidden
213+
```
214+
215+
You can resolve this issue by running by yourself this command below:
216+
```Bash
217+
gcloud beta billing projects link $GKE_PROJECT_ID \
218+
--billing-account $BILLING_ACCOUNT_ID
219+
```
220+
221+
As Config Connector is still reconciling the resources, if you successfully ran this command, the error will disappear. You can run again the command `kubectl get gcpproject -n config-control` to make sure about that.
222+
223+
If you can't run the command above, the alternative is having someone in your organization (Billing Account or Organization admins) running it for you.

0 commit comments

Comments
 (0)