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
Copy file name to clipboardExpand all lines: README.md
+23-77
Original file line number
Diff line number
Diff line change
@@ -6,105 +6,51 @@ In Greek mythology, Iris (/ˈaɪrɪs/; Greek: Ἶρις) is the personification
6
6
7
7
Iris helps to automatically assign labels to Google Cloud resources for better manageability and billing reporting. Each resource in Google Cloud will get an automatically generated label in a form of [iris_name:name], [iris_region:region] and finally [iris_zone:zone]. For example if you have a Google Compute Engine instance named `nginx`, Iris will automatically label this instance with [iris_name:nginx], [iris_region:us-central1] and [iris_zone:us-central1-a].
8
8
9
-
Iris will also label shortlived Google Compute Engine instances such as preemtible instances or instances managed by Instance Group Manager by listening to Stackdriver Logs and putting required labels on-demand.
9
+
Iris will also label short-lived Google Compute Engine instances such as preemptible instances or instances managed by an Instance Group Manager by listening to Operations (Stackdriver) Logs and adding required labels on-demand.
10
10
11
-
**NOTE**: Iris will try tagging resources in _all_ project across your GCP organization. Not just the project it will be deployed into.
11
+
**Supported Google Cloud Products**
12
12
13
-
## Supported Google Cloud Products
14
-
15
-
Iris is extensible through plugins and new Google Cloud products may be supported via simply adding a plugin. Right now, there are plugins for the following products:
13
+
Iris is extensible through plugins. New Google Cloud products may be supported via simply adding a plugin. Right now, there are plugins for the following products:
16
14
17
15
* Google Compute Engine (including disks and snapshots)
18
16
* Google Cloud Storage
17
+
* Google CloudSQL
19
18
* Google BigQuery
20
19
* Google Bigtable
21
20
22
-
## Installation
23
-
24
-
We recommend to deploy Iris in a [separate](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project) project within your Google Cloud organization.
25
-
To deploy, you will need to have *Owner* role on Iris project and the following roles in your *GCP Organization*:
26
-
27
-
*_Organization Role Administrator_ - to create a custom IAM role for Iris that allows setting labels on the services
28
-
(note this is different from _Organization Administrator_, which is in turn not related to Organization-level _Owner_)
29
-
*_Security Admin_ OR _Organization Administrator_ - to allow Iris app engine service account to use the above role
30
-
*_Logs Configuration Writer_ OR _Logs Configuration Writer_ - to configure log events stream on Organization level to watch for new instances, databases, etc.
21
+
**Installation**
31
22
32
-
### Install dependencies
23
+
We recommend deploying Iris in a [new project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project) within your Google Cloud organization. You will need the following IAM permissions on your Google Cloud organization to complete the deployment:
33
24
34
-
```
35
-
pip2.7 install -r requirements.txt -t lib
36
-
```
25
+
* App Engine Admin
26
+
* Logs Configuration Writer
27
+
* Pub/Sub Admin
37
28
38
-
Yes, we still use Python2.7. Yes, [we know](https://pythonclock.org/).
29
+
##### Install dependencies
39
30
40
-
#### Deploy
31
+
`pip install -r requirements.txt -t lib`
41
32
42
-
```
43
-
./deploy.sh <project-id>
44
-
```
33
+
##### Deploy
34
+
`./deploy.sh project-id`
45
35
46
-
#### Configuration
36
+
#####Configuration
47
37
48
-
Configuration is stored in the config.json file. The file contains two arrays.
38
+
Configuration is stored in the `config.json` file. The file contains two arrays.
49
39
50
-
1. tags - A list of tags that will be applied to the resources (if the corresponding plugin implemented a function `_get_<TAGNAME>()`)
51
-
2. on_demand - A List of plugins that will tag whenever a new object of their type is created
40
+
1.`tags` - A list of tags that will be applied to the resources (if the plugin impliments a function by the name _get_TAGNAME)
41
+
2.`on_demand` - A list of plugins that will tag whenever there is a new object of their type (as opposed to tagging as part of a batch command).
42
+
Note: There is no support for CloudSQL for now)
52
43
53
-
```json
54
-
{
55
-
"tags": [
56
-
"name",
57
-
"zone",
58
-
"region",
59
-
"location",
60
-
"instance_type"
61
-
],
62
-
"on_demand": [
63
-
"Gce",
64
-
"BigQuery",
65
-
"Gcs",
66
-
"BigTable",
67
-
"GceDisks",
68
-
"GceSnapshots"
69
-
]
70
-
}
71
-
```
72
44
73
45
### Local Development
74
46
For local development run:
75
47
76
48
`dev_appserver.py --log_level=debug app.yaml`
77
49
78
-
Iris is easily extendable to support tagging of other GCP services. You will need to create a Python file in the /plugin directory with `register_signals`, `def api_name` and `methodsNames` functions as following:
79
-
80
-
```python
81
-
defregister_signals(self):
82
-
83
-
"""
84
-
Register with the plugin manager.
85
-
"""
86
-
87
-
logging.debug("BigQuery class created and registering signals")
88
-
```
89
-
90
-
```python
91
-
defapi_name(self):
92
-
return"compute.googleapis.com"
93
-
```
94
-
95
-
```python
96
-
// a list of log methods to listen on
97
-
defmethodsNames(self):
98
-
return ["storage.buckets.create"]
99
-
```
100
-
101
-
All plugins are derived form `Plugin` class and needs to implement the following functions:
102
-
103
-
1.`do_tag(self, project_id)`
104
-
1.`get_gcp_object(self, data)`
105
-
1.`tag_one(self, gcp_object, project_id)`
106
-
1.`api_name(self)`
107
-
1.`methodsNames(self)`
50
+
## Extension
51
+
Iris is easily extendable to support tagging of other GCP services. You will need to create a Python file in the `/plugin` directory, implementing `register_signals`, `def api_name` and `methodsNames` functions as following:
108
52
53
+
All plugins are derived from `Plugin` class and need to implement the following functions:
109
54
110
-
Each plugin will execute `gen_labels()` which will loop over all the tags that are defined in the config file and will execute `_get_<TAGNAME>()` function
55
+
56
+
Each plugin will execute will loop over all the tags that are defined in the config file and will execute the `_get_TAGNAME` function
0 commit comments