@@ -13,46 +13,48 @@ visualizations of those metrics available through a Grafana dashboard.
13
13
14
14
<br clear =" left " />
15
15
16
- Brigade 2 itself is currently in an _ beta_ state and remains under active
17
- development, as such, the same is true for this add-on component.
16
+ ## Installation
18
17
19
- ## Getting Started
18
+ Prerequisites:
20
19
21
- Follow these steps to get started.
20
+ * A Kubernetes cluster:
21
+ * For which you have the ` admin ` cluster role
22
+ * That is already running Brigade 2
23
+ * Capable of provisioning a _ public IP address_ for a service of type
24
+ ` LoadBalancer ` . (This means you won't have much luck running the gateway
25
+ locally in the likes of kind or minikube unless you're able and willing to
26
+ mess with port forwarding settings on your router, which we won't be
27
+ covering here.)
22
28
23
- ### Prerequisites
29
+ * ` kubectl ` , ` helm ` (commands below require Helm 3.7.0+), and ` brig ` (the
30
+ Brigade 2 CLI)
24
31
25
- Since Brigade Metrics aggregates and exposes metrics for a running Brigade 2
26
- installation, an operational Brigade 2 installation is a prerequisite.
32
+ ### 1. Create a Service Account
27
33
28
- Note that Brigade Metrics is only compatible with the _ beta_ series of Brigade 2
29
- releases.
34
+ __ Note:__ To proceed beyond this point, you'll need to be logged into Brigade 2
35
+ as the "root" user (not recommended) or (preferably) as a user with the ` ADMIN `
36
+ role. Further discussion of this is beyond the scope of this documentation.
37
+ Please refer to Brigade's own documentation.
30
38
31
- If necessary, please refer to
32
- [ Brigade 2's own getting started documentation] ( https://github.com/brigadecore/brigade/tree/v2 )
33
- for guidance in fulfilling this dependency.
34
-
35
- Once Brigade 2 is operational, create a service account for use by Brigade
36
- Metrics:
39
+ Using Brigade 2's ` brig ` CLI, create a service account:
37
40
38
41
``` console
39
42
$ brig service-account create \
40
43
--id brigade-metrics \
41
- --description "Used by Brigade Metrics"
44
+ --description brigade-metrics
42
45
```
43
46
44
- This command will display a token that Brigade Metrics can use for
45
- authenticating to the Brigade 2 API server. Take note of this value. It will
46
- be required in subsequent steps and cannot be retrieved later through any other
47
- means.
47
+ Make note of the __ token__ returned. This value will be used in another step.
48
+ _ It is your only opportunity to access this value, as Brigade does not save it._
48
49
49
- Now grant the service account global read permissions :
50
+ Authorize this service account with read-only access to Brigade :
50
51
51
52
``` console
52
- $ brig role grant READER --service-account brigade-metrics
53
+ $ brig role grant READER \
54
+ --service-account brigade-metrics
53
55
```
54
56
55
- ### Installing Brigade Metrics
57
+ ### 2. Installing Brigade Metrics
56
58
57
59
For now, we're using the [ GitHub Container Registry] ( https://ghcr.io ) (which is
58
60
an [ OCI registry] ( https://helm.sh/docs/topics/registries/ ) ) to host our Helm
@@ -95,6 +97,10 @@ minimum, you will need to make the following changes:
95
97
* Specify a username and password for the metrics dashboard by setting values
96
98
for ` grafana.auth.username ` and ` grafana.auth.password ` .
97
99
100
+ * ` grafana.service.type ` : If you plan to enable ingress (advanced), you can
101
+ leave this as its default -- ` ClusterIP ` . If you do not plan to enable
102
+ ingress, you probably will want to change this value to ` LoadBalancer ` .
103
+
98
104
Install Brigade Metrics, referencing your edited configuration:
99
105
100
106
``` console
@@ -103,31 +109,37 @@ $ helm install brigade-metrics \
103
109
--version v0.2.0 \
104
110
--create-namespace \
105
111
--namespace brigade-metrics \
106
- --values ~/brigade-metrics-values.yaml
112
+ --values ~/brigade-metrics-values.yaml \
113
+ --wait \
114
+ --timeout 300s
107
115
```
108
116
109
- ### Accessing the Dashboard
117
+ ### 3. (RECOMMENDED) Create a DNS Entry
110
118
111
- Use the following command to determine when the dashboard (Grafana) is ready:
119
+ If you overrode defaults and set ` grafana.service.type ` to ` LoadBalancer ` , use
120
+ this command to find the gateway's public IP address:
112
121
113
122
``` console
114
- $ kubectl get deployment brigade-metrics-grafana --namespace brigade-metrics
123
+ $ kubectl get svc brigade-metrics-grafana \
124
+ --namespace brigade-metrics \
125
+ --output jsonpath='{.status.loadBalancer.ingress[0].ip}'
115
126
```
116
127
117
- If you deployed Brigade Metrics on a public cloud _ and _ kept the default service
118
- type of ` LoadBalancer ` for the dashboard, then use the following command to
119
- determine when your dashboard has been assigned a public IP:
128
+ If you overrode defaults and enabled support for an ingress controller, you
129
+ probably know what you're doing well enough to track down the correct IP without
130
+ our help. 😉
120
131
121
- ``` console
122
- $ kubectl get service brigade-metrics-grafana --namespace brigade-metrics
123
- ```
132
+ With this public IP in hand, edit your name servers and add an ` A ` record
133
+ pointing your domain to the public IP.
134
+
135
+ ### 4. Accessing the Dashboard
124
136
125
- The dashboard should be accessible at the public IP using HTTPS. If you used
126
- the default, auto-generated certificate, expect to receive a cert warning.
137
+ If you overrode defaults and set ` grafana.service.type ` to ` LoadBalancer ` , then
138
+ the dashboard should be accessible over HTTPS at the public IP address or DNS
139
+ hostname.
127
140
128
- If you deployed Brigade Metrics on a local cluster or changed the service type
129
- for the dashboard to something like ` ClusterIP ` , then use port forwarding to
130
- access the dashboard:
141
+ If you kept the default setting of ` ClusterIP ` for ` grafana.service.type ` , then
142
+ use port forwarding to expose the dashboard on your local network interface:
131
143
132
144
``` console
133
145
$ kubectl port-forward \
@@ -136,8 +148,8 @@ $ kubectl port-forward \
136
148
8443:443
137
149
```
138
150
139
- The dashboard should be accessible at ` https://localhost:8443 ` . Expect to
140
- receive a cert warning.
151
+ In this case, the dashboard should be accessible at ` https://localhost:8443 ` .
152
+ Expect to receive a cert warning.
141
153
142
154
Log in using the username and password you selected in the previous section.
143
155
0 commit comments