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
[Local Dev Environment] Remove Anonymous Auth in local dev environmen… (#738)
Remove Anonymous Auth in local dev environment grafana instance, update
docs to reflect this change.
Related to #737, as the
anonymous role of `Admin` is being deprecated, and a `Viewer` anonymous
role doesn't show the plugin, so for ease-of-use anonymous auth will be
turned off. It can be re-enabled with the `Viewer` role via
`local/config.yaml` by adding
```
grafanaWithAnonymousAuth: true
```
We could also have `grafanaAnonymousAuth` be a string key that allows
for specifying a specific role, rather than an on/off switch, I have no
strong opinions on that, and would love any opinions on it.
Copy file name to clipboardExpand all lines: docs/local-development.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,7 +201,9 @@ With those extra two steps done, you should now have a working local deployment.
201
201
202
202
## Accessing Your Deployment
203
203
204
-
Once up, your local grafana can be accessed via [grafana.k3d.localhost:9999](http://grafana.k3d.localhost:9999) (if you used a `port` other than 9999 in your `local/config.yaml`, use that instead in the URL).
204
+
Once up, your local grafana can be accessed via [grafana.k3d.localhost:9999](http://grafana.k3d.localhost:9999) (if you used a `port` other than 9999 in your `local/config.yaml`, use that instead in the URL).
205
+
The default username and password for the local grafana is `admin`/`admin`.
206
+
You can enable anonymous auth using a `Viewer` role by setting `grafanaWithAnonymousAuth: true` in `local/config.yaml`.
205
207
206
208
If you use kubectl, your kubeconfig should have its default context changed to the local cluster, so you can get any resources that way.
Copy file name to clipboardExpand all lines: docs/tutorials/issue-tracker/05-local-deployment.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -217,11 +217,19 @@ Though not recommended, you can deploy without using tilt, if you desire. Not us
217
217
### Interacting With Our Local Deployment
218
218
219
219
Our grafana is now available at [grafana.k3d.localhost:9999](http://grafana.k3d.localhost:9999).
220
+
By default, the credentials to log in are `admin`/`admin`. You'll be prompted to change the password upon logging in.
221
+
Note that if you do, you'll need to modify the cURL commands used later in this tutorial. You can also click `Skip` to avoid updating the password.
220
222
Since our plugin is automatically installed, we can go to [grafana.k3d.localhost:9999/a/issuetrackerproject-app/](http://grafana.k3d.localhost:9999/a/issuetrackerproject-app/) and see the simple landing page that got generated for us, and we can interact with our backend APIs at [grafana.k3d.localhost:9999/api/plugins/issuetrackerproject-app/resources/v1/issues](http://grafana.k3d.localhost:9999/api/plugins/issuetrackerproject-app/resources/v1/issues).
221
223
222
224
Right now, if I do a curl to our list endpoint, we'll get back a response with an empty list:
Our kinds are also available via the grafana API server, located at [http://grafana.k3d.localhost:9999/apis]. This is a kubernetes-compatible API server, and we can interact with it via cURL, or kubectl.
We can see the output is nearly identical, as the plugin backend is just a proxy to the API server. From this point, we could use the plugin backend or API server API,
250
261
but seeing as the plugin backend will eventually be phased out of the default path, let's use the API server here, and create an Issue:
251
262
```shell
252
-
$ curl -X POST -H "content-type:application/json" -d '{"kind":"Issue","apiVersion":"issuetrackerproject.ext.grafana.com/v1","metadata":{"name":"test-issue","namespace":"default"},"spec":{"title":"Test","description":"A test issue","status":"open"}}' http://grafana.k3d.localhost:9999/apis/issuetrackerproject.ext.grafana.com/v1/namespaces/default/issues
263
+
curl -u admin:admin -X POST -H "content-type:application/json" -d '{"kind":"Issue","apiVersion":"issuetrackerproject.ext.grafana.com/v1","metadata":{"name":"test-issue","namespace":"default"},"spec":{"title":"Test","description":"A test issue","status":"open"}}' http://grafana.k3d.localhost:9999/apis/issuetrackerproject.ext.grafana.com/v1/namespaces/default/issues
264
+
```
265
+
```shell
266
+
$ curl -u admin:admin -X POST -H "content-type:application/json" -d '{"kind":"Issue","apiVersion":"issuetrackerproject.ext.grafana.com/v1","metadata":{"name":"test-issue","namespace":"default"},"spec":{"title":"Test","description":"A test issue","status":"open"}}' http://grafana.k3d.localhost:9999/apis/issuetrackerproject.ext.grafana.com/v1/namespaces/default/issues
The client uses grafana libraries to make fetch requests to perform relevent actions, and uses the generated `Issue` type in `generated/issue/v1/issue_object_gen.ts` that mirrors our generated go `v1.Issue` type. We have methods for `get`, `list`, `create`, `update`, and `delete`. We'll use these methods in our update to the main page of the plugin.
15
+
The client uses grafana libraries to make fetch requests to perform relevant actions, and uses the generated `Issue` type in `generated/issue/v1/issue_object_gen.ts` that mirrors our generated go `v1.Issue` type. We have methods for `get`, `list`, `create`, `update`, and `delete`. We'll use these methods in our update to the main page of the plugin.
16
16
17
17
## Main Page
18
18
@@ -92,11 +92,11 @@ That we'll use in our display output to show the correct Issue status and displa
92
92
93
93
Now we want to redeploy our plugin front-end to see the changes. Since we don't need to rebuild the operator or the plugin's backend, we can just do
94
94
```bash
95
-
$ make build/plugin-frontend
95
+
make build/plugin-frontend
96
96
```
97
97
After that completes, we can redploy to our active local environment with
98
98
```bash
99
-
$ make local/deploy_plugin
99
+
make local/deploy_plugin
100
100
```
101
101
And just like that, we can refresh or go to [http://grafana.k3d.localhost:9999/a/issuetrackerproject-app/], and see our brand-new plugin UI.
102
102
If we create a new issue, we can see that it shows up in the list, or via a `kubectl get issues`.
0 commit comments