Skip to content

Commit 2f28aff

Browse files
authored
Merge pull request #9 from krancour/readme-updates
update README with more accurate install instructions
2 parents 50a9096 + 8289e96 commit 2f28aff

File tree

1 file changed

+97
-26
lines changed

1 file changed

+97
-26
lines changed

README.md

+97-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Brigade Metrics: One-Step Monitoring for Brigade 2
1+
# Brigade Metrics: Monitoring for Brigade 2
22

33
Brigade Metrics adds monitoring capabilities to a Brigade 2 installation. It
44
utilizes Brigade APIs to export time series metrics to Prometheus and makes
@@ -9,52 +9,123 @@ development, as such, the same is true for this add-on component.
99

1010
## Getting Started
1111

12-
Comprehensive documentation will become available in conjunction with a future
13-
release. In the meantime, here is a little to get you started.
12+
Follow these steps to get started.
1413

1514
### Prerequisites
1615

1716
Since Brigade Metrics aggregates and exposes metrics for a running Brigade 2
18-
installation, an operation Brigade 2 beta installation is a prerequisite. Please
19-
refer to
20-
[Brigade 2's own getting started documentation](https://github.com/brigadecore/brigade/tree/v2).
17+
installation, an operational Brigade 2 installation is a prerequisite.
2118

22-
Once Brigade 2 is up and running, create a service account, and give it `READ`
23-
permissions:
19+
Note that Brigade Metrics is only compatible with the _beta_ series of Brigade 2
20+
releases.
21+
22+
If necessary, please refer to
23+
[Brigade 2's own getting started documentation](https://github.com/brigadecore/brigade/tree/v2)
24+
for guidance in fulfilling this dependency.
25+
26+
Once Brigade 2 is operational, create a service account for use by Brigade
27+
Metrics:
2428

2529
```console
26-
$ brig sa create -i brigade-metrics -d brigade-metrics
27-
$ brig role grant READER --service-account brigade-metrics
30+
$ brig service-account create \
31+
--id brigade-metrics \
32+
--description "Used by Brigade Metrics"
2833
```
2934

30-
Save the service account token somewhere safe.
35+
This command will display a token that Brigade Metrics can use for
36+
authenticating to the Brigade 2 API server. Take note of this value. It will
37+
be required in subsequent steps and cannot be retrieved later through any other
38+
means.
39+
40+
Now grant the service account global read permissions:
41+
42+
```console
43+
$ brig role grant READER --service-account brigade-metrics
44+
```
3145

3246
### Installing Brigade Metrics
3347

34-
Since this add-on is still very much a prototype, we're not currently publishing
35-
a Helm chart anywhere. You will need to clone this repository to obtain the
36-
chart and install.
48+
For now, we're using the [GitHub Container Registry](https://ghcr.io) (which is
49+
an [OCI registry](https://helm.sh/docs/topics/registries/)) to host our Helm
50+
chart. Helm 3 has _experimental_ support for OCI registries. In the event that
51+
the Helm 3 dependency proves troublesome for users, or in the event that this
52+
experimental feature goes away, or isn't working like we'd hope, we will revisit
53+
this choice before going GA.
54+
55+
To install Brigade Metrics, begin by pulling the chart from GCR and exporting
56+
it to some location on your local system. Here, we export it to `~/charts`:
57+
58+
```console
59+
$ export HELM_EXPERIMENTAL_OCI=1
60+
$ helm chart pull ghcr.io/brigadecore/brigade-metrics:v0.1.0
61+
$ helm chart export ghcr.io/brigadecore/brigade-metrics:v0.1.0 -d ~/charts
62+
```
63+
64+
Use the following command to extract the full set of configuration options from
65+
the chart. Here we're storing a copy at `~/brigade-metrics-values.yaml`:
66+
67+
```console
68+
$ helm inspect values ~/charts/brigade-metrics > ~/brigade-metrics-values.yaml
69+
```
70+
71+
Edit the configuration (`~/brigade-metrics-values.yaml` in this example). At
72+
minimum, you will need to make the following changes:
3773

38-
Once the repository is cloned, open the `values.yaml` file, and paste the
39-
service account token into the `exporter.brigade.apiToken` field.
74+
* Set the value of `exporter.brigade.apiAddress` to the address of your Brigade 2
75+
API server. This should utilize the _internal_ DNS hostname by which that API
76+
server is reachable _within_ your Kubernetes cluster. This value is defaulted
77+
to `https://brigade-apiserver.brigade.svc.cluster.local`, but may need to be
78+
updated if you installed Brigade 2 in a different namespace.
4079

41-
There are two methods of authentication you can choose from for logging into Grafana.
42-
1. Option to use Grafana's built in user management system. The username and password for the admin account are specified in the `grafana.auth` fields, and the admin can handle user management using the Grafana UI.
43-
2. Option to use an nginx reverse proxy and a shared username/password to access Grafana in anonymous mode.
80+
* Set the value of `exporter.brigade.apiToken` to the service account token that
81+
was generated earlier.
4482

45-
For option 1, set `grafana.auth.proxy` to false in `values.yaml`, and true for option 2.
83+
* Specify a username and password for the metrics dashboard (Grafana) by setting
84+
values for `grafana.auth.username` and `grafana.auth.password`.
4685

47-
In addition, you have the option to enable tls or ingress for grafana, and both options can be configured in `values.yaml`.
86+
Install Brigade Metrics, referencing your edited configuration:
87+
88+
```console
89+
$ helm install brigade-metrics ~/charts/brigade-metrics \
90+
--create-namespace \
91+
--namespace brigade-metrics \
92+
--values ~/brigade-metrics-values.yaml
93+
```
4894

49-
Save the file, and run `make hack` from the project's root directory.
95+
### Accessing the Dashboard
5096

51-
Once all three pods of the project are up and running, run the following command to expose the Grafana frontend:
97+
Use the following command to determine when the dashboard (Grafana) is ready:
5298

5399
```console
54-
$ kubectl port-forward service/brigade-metrics-grafana 3000:<80 (tls disabled), 443 (tls enabled)> -n brigade-metrics
100+
$ kubectl get deployment brigade-metrics-grafana --namespace brigade-metrics
55101
```
56102

57-
Enter your supplied credentials. You can now access the Grafana dashboard!
103+
If you deployed Brigade Metrics on a public cloud _and_ kept the default service
104+
type of `LoadBalancer` for the dashboard, then use the following command to
105+
determine when your dashboard has been assigned a public IP:
106+
107+
```console
108+
$ kubectl get service brigade-metrics-grafana --namespace brigade-metrics
109+
```
110+
111+
The dashboard should be accessible at the public IP using HTTPS. If you used
112+
the default, auto-generated certificate, expect to receive a cert warning.
113+
114+
If you deployed Brigade Metrics on a local cluster or changed the service type
115+
for the dashboard to something like `ClusterIP`, then use port forwarding to
116+
access the dashboard:
117+
118+
```console
119+
$ kubectl port-forward \
120+
service/brigade-metrics-grafana \
121+
--namespace brigade-metrics \
122+
8443:443
123+
```
124+
125+
The dashboard should be accessible at `https://localhost:8443`. Expect to
126+
receive a cert warning.
127+
128+
Log in using the username and password you selected in the previous section.
58129

59130
## Contributing
60131

@@ -68,4 +139,4 @@ We have a slack channel!
68139
[Kubernetes/#brigade](https://kubernetes.slack.com/messages/C87MF1RFD) Feel free
69140
to join for any support questions or feedback, we are happy to help. To report
70141
an issue or to request a feature open an issue
71-
[here](https://github.com/brigadecore/brigade/issues)
142+
[here](https://github.com/brigadecore/brigade-metrics/issues)

0 commit comments

Comments
 (0)