You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the main documentation, See [README](./README.md).
4
+
5
+
## Iris' architecture
6
+
* Iris runs in Google App Engine Standard Environment (Python 3).
7
+
* It has Organization-level and project-level elements
8
+
* Note that Iris's design makes it focused on labeling resources across an organization.
9
+
* You can filter using the config file, so that Iris labels only some of the projects in an org
10
+
* Iris has architecture components which are deployed to the org, and others which are deployed to the project.
11
+
* If you want a person with all permissions to deploy the org-level elements and a person without org-level permissions to redeploy only the project-level elements (e.g. when you change configuration), you can split the deployment in this way with flags on the script. Run `deploy.sh -h`.
12
+
* The Cloud Scheduler "cron" job triggers Iris at configured intervals. See `cron_full.yaml` for config. The GCP Console view for this is in a separate App Engine tab in the Cloud Scheduler view.
13
+
* For newly created resources, a Log Sink on the organization level sends all logs for resource creation to a PubSub topic.
14
+
* The Log Sink is filtered to include only supported resource types.
15
+
* If you edit the configuration file so that only specific projects are to be labeled, the Log Sink only captures these.
16
+
* PubSub topics:
17
+
*
18
+
19
+
iris_deadletter_topic
20
+
* `iris_logs_topic` receives the resource-creation logs from the Log Sink
21
+
* `iris_schedulelabeling_topic` receives messages sent by the `/schedule` endpoint in `main.py` (after the `/schedule` endpoint was triggered by the Cloud Scheduler). Each message goes to endpoint `/do_label` to trigger the labeling of a given resource type in a given project.
22
+
* Messages to `iris_label_all_types_topic` triggers the labeling of all resources regardless of type.
23
+
* Another topic is a dead-letter topic.
24
+
* PubSub subscriptions
25
+
* There are subscriptions that that direct the messages to endpoints in `main.py`: `/label_one`, `/do_label` and `label_all_types`.
26
+
* For security, the endpoints hit by these PubSub subscriptions [use JWT auth](https://cloud.google.com/pubsub/docs/authenticate-push-subscriptions), where the JWT token is verified in the Iris webapp.
27
+
* A dead-letter subscription. This is a pull subscription. By default, it just accumulates the messages. You can use it to see statistics, or you can pull messages from it.
Copy file name to clipboardExpand all lines: INSTALL.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,12 @@
1
1
# How to Install
2
2
3
-
(For the main documentation, see[README](./README.md).)
3
+
For the main documentation, See[README](./README.md).
4
4
5
5
## Before deploying
6
-
7
-
### In which Project
8
-
### In which Project
6
+
### Selecting a Project
9
7
10
8
* You can deploy Iris in any one project within your Google Cloud organization, but we recommend using a [new project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project) just for this.
11
-
* The script will deploy Iris (an App Engine service) into this project. That does not mean that Iris is focused on labeling this project. (See [README](./README.md).)
9
+
* The script will deploy Iris (an App Engine service) into this project. That does not mean that Iris is focused on labeling this project. Rather, Iris is always focused on labeling across an organization (though you can filter that to specific projects). See [README](./README.md).
12
10
13
11
### Needed roles for deployment
14
12
#### Organization-level roles
@@ -55,10 +53,10 @@
55
53
56
54
# Configuration
57
55
58
-
* Iris' config file is `config*.yaml`.
56
+
* Iris' config file is `config.yaml`.
59
57
* All values are optional.
60
58
*`config.yaml.orig` has detailed documentation of the fields.
61
-
* Alternatively, you can have `config-test.yaml`. It takes priority if both it and `config-test.yaml` are present.
59
+
* Alternatively, you can have `config-test.yaml`. It takes priority if both it and `config.yaml` are present.
62
60
*`app.yaml` lets you configure App Engine, for example, to set a maximum number of instances. See App Engine documentation.
63
61
* Editing `cron_full.yaml` lets you optionally change the timing for the Cloud Scheduler scheduled labelings, e.g. to do it more frequently. See Google App Engine documentation.
64
62
@@ -68,7 +66,7 @@
68
66
* Use `uninstall.sh -h` for help.
69
67
70
68
# Architecture
71
-
Please see [README_architecture](README_architecture.md).
Copy file name to clipboardExpand all lines: README.md
+18-16Lines changed: 18 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Iris
2
2
3
3
In Greek mythology, Iris(Ἶρις) is the personification of the rainbow and messenger of the gods. She was the handmaiden to Hera.
4
+
4
5

5
6
# Blog post
6
7
@@ -14,43 +15,45 @@ Iris automatically assigns labels to Google Cloud Platform resources for easier
14
15
Resources of all supported types in all or some of the projects in the GCP organization will get automatically-generated labels with keys like `iris_zone` (the prefix is configurable), and a value copied from the resource. For example, a Google Compute Engine instance would get labels like
15
16
`[iris_name:nginx]`, `[iris_region:us-central1]` and `[iris_zone:us-central1-a]`. This behavior can be configured in various ways; see below.
16
17
17
-
## Note: Organization focus
18
+
## Organization focus
18
19
19
-
Note that Iris is designed to serve the organization.
20
-
* It is designed to label all projects in the organization (though you can configure that).
21
-
* The organization focus was chosen because labels are used for billing analysis which is typically done on the organization level (even though projects can in fact be associated arbitrarily with billing accounts).
20
+
Note that Iris is designed to serve the organization.
21
+
* Iris is designed to label all projects in the organization (though you can filter that down).
22
+
* Iris does not have a project-focused design, where you launch it in a project, and it labels just that project.
23
+
* The organization focus was chosen because labels are used for billing analysis, which is typically done on the organization level. (But this is not mandatory: Projects can be associated arbitrarily with any billing accounts).
22
24
23
25
## Iris doesn't add new information
24
26
25
-
Iris does not *add* information, only *copy* values that already exist. For example, it can label a VM instance with its zone; but it cannot add a "business unit" label because it does not know a resource's business unit. For that, you should label all resources when creating them, e.g., in your Terraform scripts. (Indeed, iris can be made extraneous in this way.)
27
+
Iris does not *add* information, only *copy* values that already exist. For example, it can label a VM instance with its zone; but it cannot add a "business unit" label because it does not know a resource's business unit.
28
+
29
+
For that, you should label all resources when creating them, e.g., in your Terraform scripts. In fact, I recommend doing that (and making Iris extraneous.)
26
30
27
31
## Labeling existing resources when you deploy Iris
28
32
29
33
If you want to label the resources -- virtual machines, PubSub topics etc. -- that *already exist* when you deploy Iris, see section "[Labeling existing resources](#labeling-existing-resources)" below.
30
34
31
35
# Open source
32
36
33
-
Iris is open-source;it is not an official DoiT product. Feel free to send Pull Requests with new functionality and add new types of labels. See the `TODO.md` file and Github
34
-
issues for features and fixes you might do.
37
+
Iris is open-source; it is not an official DoiT product. Feel free to send Pull Requests with new functionality and add new types of labels. See the `TODO.md` file and Github issues for features and fixes you might do.
35
38
36
39
# When Iris adds labels
37
40
38
41
## On resource creation
39
42
40
-
Iris labels newly-created resources by listening to Google Cloud Operations Logs. You can disable this: See [INSTALL](INSTALL.md) or run `deploy.sh -h`.
43
+
Iris labels most types of newly-created resources by listening to Google Cloud Operations Logs. You can disable this: See [INSTALL](INSTALL.md) or run `deploy.sh -h`.
41
44
42
45
## On schedule
43
46
44
-
Iris labels resources periodically on a Cloud Scheduler "cron" job. By default, only some types of resources are labeled on these Cloud Scheduler runs, while most types are not labeled on schedule, , to save the costs of relabeling with the same label every day.
47
+
Iris labels a few types of resources periodically on a Cloud Scheduler "cron" job. By default, Iris does not label all types of resources on these cron runs, to save the costs of relabeling -- with the same label -- every day.
45
48
46
-
You can change that in configuration. Set`label_all_on_cron` to `True` in the configuration file.
49
+
You can have Iris relabel everything on every cron run, See`label_all_on_cron` to `True` in the configuration file.
47
50
48
-
You can also disable the scheduled labeling. See Deployment below or run `./deploy.sh -h`
51
+
You can also disable the scheduled labeling entirely. See Deployment below or run `./deploy.sh -h`
49
52
50
53
## Labeling existing resources
51
54
52
-
* When you first use Iris, you may want to label all existing resources. Iris does not do this by default.
53
-
*Publish a PubSub message (the content doesn't matter) to `iris_label_all_types_topic`, for examplewith `gcloud pubsub topics publish iris_label_all_types_topic --message=does_not_matter --project $PROJECT_ID`and a full labeling will be triggered.
55
+
* When you first use Iris, you may want to label all existing resources. Iris *does not* do this by default.
56
+
*To do this, publish a PubSub message (the content doesn't matter) to `iris_label_all_types_topic`, and a full labeling will be triggered. For example, run with `gcloud pubsub topics publish iris_label_all_types_topic --message=does_not_matter --project $PROJECT_ID`where `$PROJECT_ID` is where Iris is deployed.
54
57
55
58
# Supported Google Cloud resources
56
59
@@ -63,7 +66,7 @@ names start `_gcp_`. The part of the function name after `_gcp_` is used for the
63
66
* Including preemptible instances and instances created by Managed Instance Groups.
0 commit comments