Merge ~arif-ali/juju-lint/+git/juju-lint:doc_updates into juju-lint:master

Proposed by Arif Ali
Status: Rejected
Rejected by: Haw Loeung
Proposed branch: ~arif-ali/juju-lint/+git/juju-lint:doc_updates
Merge into: juju-lint:master
Diff against target: 201 lines (+145/-4)
6 files modified
README.md (+8/-4)
docs/index.md (+46/-0)
docs/known_charms.md (+0/-0)
docs/openstack.md (+0/-0)
docs/operations.md (+0/-0)
docs/subordinates.md (+91/-0)
Reviewer Review Type Date Requested Status
🤖 prod-jenkaas-bootstack continuous-integration Needs Fixing
Juju Lint maintainers Pending
Review via email: mp+383990@code.launchpad.net

Commit message

Add more documentation

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
🤖 prod-jenkaas-bootstack (prod-jenkaas-bootstack) wrote :
review: Needs Fixing (continuous-integration)

Unmerged commits

524b8f8... by Arif Ali

Add more documentation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index 534395d..f65bca8 100644
3--- a/README.md
4+++ b/README.md
5@@ -1,8 +1,8 @@
6-= Juju Lint =
7+# Juju Lint
8
9 /!\ This is alpha software and backwards incompatible changes are expected.
10
11-== Introduction ==
12+## Introduction
13
14 This is intended to be run against a yaml dump of Juju status, which can be
15 generated as follows:
16@@ -17,7 +17,7 @@ To use a different rules file:
17
18 ./juju-lint -c my-rules.yaml status.yaml
19
20-== Rules File ==
21+## Rules File
22
23 For an example of a rules file, see `example-lint-rules.yaml`.
24
25@@ -28,7 +28,11 @@ Supported top-level options for your rules file:
26 3. `operations [mandatory|optional|subordinate]`
27 4. `openstack [mandatory|optional|subordinate]`
28
29-== License ==
30+## Documentation
31+
32+Documentation is available [here](docs/index)
33+
34+## License
35
36 Copyright 2018 Canonical Limited.
37 License granted by Canonical Limited.
38diff --git a/docs/index.md b/docs/index.md
39new file mode 100644
40index 0000000..dfae29f
41--- /dev/null
42+++ b/docs/index.md
43@@ -0,0 +1,46 @@
44+# Juju Lint
45+
46+**This is alpha software and backwards incompatible changes are expected.**
47+
48+## Introduction
49+
50+This is intended to be run against a yaml dump of Juju status, which can be
51+generated as follows:
52+
53+ juju status --format yaml > status.yaml
54+
55+Then run `juju-lint` (using a rules file of `lint-rules.yaml`):
56+
57+ ./juju-lint status.yaml
58+
59+To use a different rules file:
60+
61+ ./juju-lint -c my-rules.yaml status.yaml
62+
63+## Rules File
64+
65+For an example of a rules file, see `example-lint-rules.yaml`.
66+
67+Supported top-level options for your rules file:
68+
69+ 1. [subordinates](subordinates) - required subordinates.
70+ 2. [known charms](known_charms) - all primary charms should be in this list.
71+ 3. [operations](operations) `[mandatory|optional|subordinate]`
72+ 4. [openstack](openstack) `[mandatory|optional|subordinate]`
73+
74+## License
75+
76+Copyright 2018 Canonical Limited.
77+License granted by Canonical Limited.
78+
79+This program is free software: you can redistribute it and/or modify
80+it under the terms of the GNU General Public License version 3, as
81+published by the Free Software Foundation.
82+
83+This program is distributed in the hope that it will be useful, but
84+WITHOUT ANY WARRANTY; without even the implied warranties of
85+MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
86+PURPOSE. See the GNU General Public License for more details.
87+
88+You should have received a copy of the GNU General Public License
89+along with this program. If not, see <http://www.gnu.org/licenses/>.
90diff --git a/docs/known_charms.md b/docs/known_charms.md
91new file mode 100644
92index 0000000..e69de29
93--- /dev/null
94+++ b/docs/known_charms.md
95diff --git a/docs/openstack.md b/docs/openstack.md
96new file mode 100644
97index 0000000..e69de29
98--- /dev/null
99+++ b/docs/openstack.md
100diff --git a/docs/operations.md b/docs/operations.md
101new file mode 100644
102index 0000000..e69de29
103--- /dev/null
104+++ b/docs/operations.md
105diff --git a/docs/subordinates.md b/docs/subordinates.md
106new file mode 100644
107index 0000000..55a9a82
108--- /dev/null
109+++ b/docs/subordinates.md
110@@ -0,0 +1,91 @@
111+# Subordinates
112+
113+The purpose of the subordinates section is to check which subordinates are available on each of the deployed applications.
114+
115+Below is an example of what the subordinates attribute can look like
116+
117+```yaml
118+subordinates:
119+ telegraf:
120+ where: all except prometheus
121+ landscape-client:
122+ where: all except landscape-server
123+ filebeat:
124+ where: all except graylog
125+ canonical-livepatch:
126+ where: host only
127+ nrpe:
128+ where: container aware
129+ host-suffixes: [host, physical, guest]
130+ container-suffixes: [lxd, container]
131+ exceptions: [nagios]
132+ ntp:
133+ where: host only
134+ thruk-agent:
135+ where: on nagios
136+```
137+
138+In the `where` option we specify generally where to find the subordinates.
139+
140+In the above example we have 7 subordinates that we are looking at. Below we'll go through each of them, and explain all the options
141+
142+## all except \<app\>
143+
144+3 applications have tha same option, i.e. `telegraf`, `landscape-client` and `filebeat`, and these use the `where: all except ...` option. Below is the one from `telegraf`
145+
146+```yaml
147+telegraf:
148+ where: all except prometheus
149+```
150+
151+This option is suggesting that we should find the `telagraf` subordinate charm under all the applications except for the `prometheus` applications
152+
153+## host only
154+
155+We have one subordinate charm, that is using this option, namely `ntp` as shown below
156+
157+```yaml
158+ntp:
159+ where: host only
160+```
161+
162+In this instance the option will check that the `ntp` charm is available on all the hosts that are not containers.
163+
164+This is useful in this scenario, as running `ntp` on a container does not make sense, as the time for a container is directly taken from the underlying hypervisor. Also in this scenario, the ntp charm will not be able to change the time so wouldn't make sense.
165+
166+## on \<app\>
167+
168+We have one subordinate charm, that is using this option, namely `thruk-agent` as shown below
169+
170+```yaml
171+thruk-agent:
172+ where: on nagios
173+```
174+
175+This option checks that this particular subordinate charm is on a specific application. So in this scenario, the tool will chck that the `thruk-agent` is only on the `nagios` application
176+
177+## container aware
178+
179+We have one subordinate charm in our example that is using this option, namely `nrpe` as shown below
180+
181+```yaml
182+ nrpe:
183+ where: container aware
184+ host-suffixes: [host, physical, guest]
185+ container-suffixes: [lxd, container]
186+ exceptions: [nagios]
187+```
188+
189+As can be seen, this specific option has many other variables that we need to look at. The purpose of this option is to check the name of the subordinate charm that is linked, and that `nrpe` is in the name of the subordinate
190+
191+The `host-suffixes` and `container-suffixes` options are designed to look for the name of the subordinate with the relevant fixes, whether is a physical server, vm or a container. `host-suffixes` currently caters for physical and kvms, and `container-suffixes` for lxc containers. If however if neither of these options are found then the longer option of searching through is used, so could take longer
192+
193+The final option is `exceptions`, this is where the relevant subordinate will not be present. In the above scenario, we don't run nrpe on the nagios server, as that has the capability of monitoring itself and therefore is not required
194+
195+## all
196+
197+This option will suggest that all the applications will have this particular subordinate
198+
199+## all or nothing
200+
201+**TODO** not sure what this does

Subscribers

People subscribed via source and target branches