Skip to content

Commit 1bd293a

Browse files
committed
split org and project actors
1 parent c6d344b commit 1bd293a

File tree

5 files changed

+365
-300
lines changed

5 files changed

+365
-300
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ the [post that presents Iris](https://blog.doit-intl.com/iris-3-automatic-labeli
1414
Iris automatically assigns labels to Google Cloud Platform resources for manageability and easier billing reporting.
1515

1616
Each supported resource in the GCP Organization will get automatically-generated labels with keys like `iris_zone` (the
17-
prefix is configurable), and the copied value.
17+
prefix is configurable), and the copied value.
1818
For example, a Google Compute Engine instance would get labels like
1919
`[iris_name:nginx]`, `[iris_region:us-central1]` and `[iris_zone:us-central1-a]`.
2020

@@ -34,7 +34,7 @@ Iris adds labels:
3434
- You can disable this, see ["Deploy"](#deployment).
3535
* On schedule, using a Cloud Scheduler cron job that the deployer sets up for you.
3636
- By default, only some types of resources are labeled on Cloud Scheduler runs.
37-
- This can be configured so that all resources are labeled. See `label_all_on_cron` below.
37+
- This can be configured so that all resources are labeled. See `label_all_on_cron` below.
3838

3939
## Labeling existing resources
4040

@@ -47,7 +47,7 @@ Iris adds labels:
4747
Right now, there are plugins for the following types of resources.
4848

4949
To learn from the code what resources and keys are added, search for `def _gcp_<LABEL_NAME>)`, i.e., functions whose
50-
names start `_gcp_`.
50+
names start `_gcp_`.
5151
The part of the function name after `_gcp_` is used for the label key.
5252

5353
* Compute Engine Instances (Labels name, zone, region, instance type)
@@ -56,14 +56,14 @@ The part of the function name after `_gcp_` is used for the label key.
5656
* Compute Engine Disks (Labels name, zone, region)
5757
* Disks created with an Instance are not labeled on-creation. They are labeled with the Cloud Scheduler cron job.
5858
* The label indicating whether a disk is attached will change, if the state changed, on the cron job, not on-event.
59-
* Compute Engine Snapshots (Labels name, zone, region)
59+
* Compute Engine Snapshots (Labels name, zone, region)
6060
* BigQuery Datasets (Labels name, zone, region)
6161
* BigQuery Tables (Labels name, zone, region)
6262
* PubSub Subscriptions (Labels name)
6363
* PubSub Topics (Labels name, zone)
6464
* CloudSQL (Labels name, zone, region)
6565
* These receive a label only on the Cloud Scheduler cron job, not on creation.
66-
* Cloud Storage buckets (Labels name, location)
66+
* Cloud Storage buckets (Labels name, location)
6767
* In addition to these, project labels may be copied into each resource, if you have configured that in the
6868
configuration file.
6969

@@ -76,14 +76,14 @@ The part of the function name after `_gcp_` is used for the label key.
7676
* You can deploy Iris in any project within your Google Cloud organization, but we recommend using a
7777
[new project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project).
7878

79-
* To deploy, you will need to have these roles on the *organization* where Iris is deployed.
79+
* For the first deployment, to set up roles and log sink. You will need to have these roles on the *organization* where Iris is deployed. These are not needed for subsequent deployments.
8080
* *Organization Role Administrator* to create a custom IAM role for Iris that allows to get and set labels on the
8181
services.
8282
(Note that this is different from *Organization Administrator* and from Organization *Owner*.)
8383
* *Security Admin* OR *Organization Administrator* to allow Iris app engine service account to use the above role
8484
* *Logs Configuration Writer* to create an organization log sink that sends logs to PubSub
8585

86-
* On the project where Iris is deployed, you will need Owner or these roles:
86+
* To deploy Iris itself, you will need Owner on the project where Iris is deployed, or else these roles. (To deploy only Iris itself after the org elements are already deployed, use `-p` as documented below.)
8787
* *Project IAM Admin* to set up the custom role as mentioned above.
8888
* *App Engine Admin* to deploy to App Engine.
8989
* *Pub/Sub Admin* to create topics and subscriptions.
@@ -103,13 +103,18 @@ through [this tutorial](https://cloud.google.com/appengine/docs/standard/python3
103103
* Have Python 3.9+ as your default `python3`.
104104
* Install tools `envsubst` and `jq`.
105105
* Install and initialize `gcloud` using an account with the [above-mentioned](#before-deploying) roles.
106-
* Copy `config.yaml.original` to `config.yaml`.
107-
* Optionally configure by editing the configuration files ([See more documentation below](#configuration).)
108-
* Run `./deploy.sh <PROJECT_ID>`.
109-
* To use *only* Cloud Scheduler cron (i.e., without labeling resources on-creation), put `-c` at the end of the
110-
command line.
111-
* For the opposite, to label resources on-creation and *not* label with Cloud Scheduler, thus saving the costs of
112-
iterating over all resources, see below re the `label_all_on_cron` setting in the configuration file.
106+
* Config
107+
* Copy `config.yaml.original` to `config.yaml`.
108+
* Optionally configure by editing the configuration files ([See more documentation below](#configuration).)
109+
* Run `./deploy.sh <PROJECT_ID> `.
110+
* The above is the default. There are also command-line options, to be put at the end of the command line after the project id.
111+
* Org and project
112+
* Use `-o -p` to deploy org elements and also project elements. If you omit both, then the default behavior is to deploy both, as if `-o -p` were given.
113+
* Use `-o` to deploy only org elements like roles and log sinks. You might want to do this if you have different people controlling the org and the project.
114+
* Once org elements are set up, only `-p` is needed, to deploy the Iris app to App Engine
115+
* Cloud Scheduler
116+
* To use *only* Cloud Scheduler cron (i.e., without labeling resources on-creation), also use `-c`.
117+
* To *not at all* use Cloud Scheduler, delete schedule in `cron.yaml`.
113118
* When you redeploy different versions of Iris code on top of old ones:
114119
* If new plugins were added or some removed, the log sink *will* be updated to reflect this.
115120
* If the parameters for subscriptions or topics were changed in a new version of the Iris code, the subscriptions or
@@ -125,7 +130,7 @@ through [this tutorial](https://cloud.google.com/appengine/docs/standard/python3
125130
* otherwise `config.yaml` is used.
126131
* Local vs App Engine
127132
* `config-dev.yaml` is not uploaded to App Engine and so is ignored there.
128-
* `config-test.yaml` and `config.yaml` are available for use in App Engine.
133+
* `config-test.yaml` and `config.yaml` are available for use in App Engine.
129134
* Copy `config.yaml.original` to the desired file name
130135
* All values in the `config*.yaml` are optional.
131136
* `app.yaml` lets you configure App Engine, for example to set a maximum number of instances. See App Engine

0 commit comments

Comments
 (0)