Skip to content

Commit 90fb6a0

Browse files
suntalaDanCech
andauthored
Update unified storage readme (grafana#79934)
* Update unified storage readme Co-authored-by: Dan Cech <[email protected]>
1 parent 494f36e commit 90fb6a0

File tree

1 file changed

+53
-7
lines changed

1 file changed

+53
-7
lines changed

pkg/services/store/entity/README.md

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,18 @@ idForwarding = true
4141
storage_type = unified
4242
```
4343

44-
With this configuration, you can run everything in-process with:
44+
With this configuration, you can run everything in-process. Run the Grafana backend with:
4545

4646
```sh
4747
bra run
4848
```
4949

50+
or
51+
52+
```sh
53+
make run
54+
```
55+
5056
The default kubeconfig sends requests directly to the apiserver, to authenticate as a grafana user, create `grafana.kubeconfig`:
5157
```yaml
5258
apiVersion: v1
@@ -70,13 +76,22 @@ users:
7076
username: <username>
7177
password: <password>
7278
```
73-
Where `<username>` and `<password>` are credentials for basic auth against Grafana.
79+
Where `<username>` and `<password>` are credentials for basic auth against Grafana. For example, with the [default credentials](https://github.com/grafana/grafana/blob/HEAD/contribute/developer-guide.md#backend):
80+
```yaml
81+
username: admin
82+
password: admin
83+
```
7484

75-
In this mode, you can interact with the k8s api via:
85+
In this mode, you can interact with the k8s api. Make sure you are in the directory where you created `grafana.kubeconfig`. Then run:
7686
```sh
7787
kubectl --kubeconfig=./grafana.kubeconfig get playlist
7888
```
7989

90+
If this is your first time running the command, a successful response would be:
91+
```sh
92+
No resources found in default namespace.
93+
```
94+
8095
To create a playlist, create a file `playlist-generate.yaml`:
8196
```yaml
8297
apiVersion: playlist.grafana.app/v0alpha1
@@ -99,20 +114,51 @@ then run:
99114
kubectl --kubeconfig=./grafana.kubeconfig create -f playlist-generate.yaml
100115
```
101116

117+
For example, a successful response would be:
118+
```sh
119+
playlist.playlist.grafana.app/u394j4d3-s63j-2d74-g8hf-958773jtybf2 created
120+
```
121+
122+
When running
123+
```sh
124+
kubectl --kubeconfig=./grafana.kubeconfig get playlist
125+
```
126+
you should now see something like:
127+
```sh
128+
NAME TITLE INTERVAL CREATED AT
129+
u394j4d3-s63j-2d74-g8hf-958773jtybf2 Playlist with auto generated UID 5m 2023-12-14T13:53:35Z
130+
```
131+
102132
### Use a separate database
103133

104-
To run against a separate database, update custom.ini:
134+
By default Unified Storage uses the Grafana database. To run against a separate database, update `custom.ini` by adding the following section to it:
105135

106136
```
107137
[entity_api]
108138
db_type = mysql
109139
db_host = localhost:3306
110140
db_name = grafana
111-
db_user = grafanauser
112-
db_pass = grafanapass
141+
db_user = <username>
142+
db_pass = <password>
143+
```
144+
145+
MySQL and Postgres are both supported. The `<username>` and `<password>` values can be found in the following devenv docker compose files: [MySQL](https://github.com/grafana/grafana/blob/main/devenv/docker/blocks/mysql/docker-compose.yaml#L6-L7) and [Postgres](https://github.com/grafana/grafana/blob/main/devenv/docker/blocks/postgres/docker-compose.yaml#L4-L5).
146+
147+
Then, run
148+
```sh
149+
make devenv sources=<source>
113150
```
151+
where source is either `mysql` or `postgres`.
152+
153+
Finally, run the Grafana backend with
114154

115-
MySQL and Postgres are both supported.
155+
```sh
156+
bra run
157+
```
158+
or
159+
```sh
160+
make run
161+
```
116162

117163
### Run as a GRPC service
118164

0 commit comments

Comments
 (0)