Skip to content

Commit 5c149ab

Browse files
committed
docs: add schema generation instructions
1 parent 5777b0f commit 5c149ab

File tree

2 files changed

+85
-33
lines changed

2 files changed

+85
-33
lines changed

charts/sentry-kubernetes/README.md

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# sentry-kubernetes
22

3-
[sentry-kubernetes](https://github.com/getsentry/sentry-kubernetes) is a utility that pushes Kubernetes events to [Sentry](https://sentry.io).
3+
[sentry-kubernetes](https://github.com/getsentry/sentry-kubernetes) is a utility that pushes Kubernetes events
4+
to [Sentry](https://sentry.io).
45

56
# Installation:
67

@@ -41,11 +42,13 @@ The following table lists the configurable parameters of the sentry-kubernetes c
4142

4243
## Usage
4344

44-
After installing the chart, you can configure various aspects of the sentry-kubernetes integration by modifying the `values.yaml` file or using `--set` flags during installation.
45+
After installing the chart, you can configure various aspects of the sentry-kubernetes integration by modifying the
46+
`values.yaml` file or using `--set` flags during installation.
4547

4648
### Example `values.yaml` Configuration
4749

48-
Here's an example `values.yaml` that sets up sentry-kubernetes with custom configurations (remove unused values for default values):
50+
Here's an example `values.yaml` that sets up sentry-kubernetes with custom configurations (remove unused values for
51+
default values):
4952

5053
```yaml
5154
sentry:
@@ -70,21 +73,21 @@ rbac:
7073
create: true
7174
# Will replace the default rules
7275
custom_rules:
73-
- verbs:
74-
- get
75-
- list
76-
- watch
77-
apiGroups:
78-
- 'apps'
79-
- 'batch'
80-
- ''
81-
resources:
82-
- events
83-
- jobs
84-
- deployments
85-
- replicasets
86-
- cronjobs
87-
- pods
76+
- verbs:
77+
- get
78+
- list
79+
- watch
80+
apiGroups:
81+
- 'apps'
82+
- 'batch'
83+
- ''
84+
resources:
85+
- events
86+
- jobs
87+
- deployments
88+
- replicasets
89+
- cronjobs
90+
- pods
8891

8992
resources:
9093
limits:
@@ -97,7 +100,24 @@ resources:
97100
98101
## 📑 Schema Validation
99102
100-
This enables autocompletion and live validation of your values.yaml file in editors that support JSON Schema (YAML Language Server, VS Code, JetBrains, etc.).
103+
The chart includes a [JSON Schema](https://json-schema.org/) for the `values.yaml` file, automatically generated from
104+
`charts/sentry/values.yaml` and hosted here:
105+
106+
[https://raw.githubusercontent.com/sentry-kubernetes/charts/develop/charts/sentry-kubernetes/values.schema.json](https://raw.githubusercontent.com/sentry-kubernetes/charts/develop/charts/sentry/values.schema.json)
107+
108+
This schema enables autocompletion and validation of `values.yaml` in editors that support JSON Schema (VS Code,
109+
IntelliJ, etc.).
110+
111+
**To regenerate the schema** (on every update to `values.yaml`):
112+
113+
```bash
114+
# 1. Install the Helm plugin
115+
helm plugin install https://github.com/dadav/helm-schema
116+
117+
# 2. Generate the schema
118+
cd charts/sentry-kubernetes
119+
helm schema
120+
```
101121

102122
**Editor support:** To enable autocompletion and live validation, choose one:
103123

@@ -118,4 +138,5 @@ This enables autocompletion and live validation of your values.yaml file in edit
118138
]
119139
}
120140
```
121-
* **JetBrains IDEs**: in **Settings > Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings**, add the schema URL for `values.yaml`.
141+
* **JetBrains IDEs**: in **Settings > Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings**, add the
142+
schema URL for `values.yaml`.

charts/sentry/README.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,24 @@ Note: this table is incomplete, so have a look at the values.yaml in case you mi
11501150

11511151
## 📑 Schema Validation
11521152

1153-
This enables autocompletion and live validation of your values.yaml file in editors that support JSON Schema (YAML Language Server, VS Code, JetBrains, etc.).
1153+
The chart includes a [JSON Schema](https://json-schema.org/) for the `values.yaml` file, automatically generated from
1154+
`charts/sentry/values.yaml` and hosted here:
1155+
1156+
[https://raw.githubusercontent.com/sentry-kubernetes/charts/develop/charts/sentry/values.schema.json](https://raw.githubusercontent.com/sentry-kubernetes/charts/develop/charts/sentry/values.schema.json)
1157+
1158+
This schema enables autocompletion and validation of `values.yaml` in editors that support JSON Schema (VS Code,
1159+
IntelliJ, etc.).
1160+
1161+
**To regenerate the schema** (on every update to `values.yaml`):
1162+
1163+
```bash
1164+
# 1. Install the Helm plugin
1165+
helm plugin install https://github.com/dadav/helm-schema
1166+
1167+
# 2. Generate the schema
1168+
cd charts/sentry
1169+
helm schema
1170+
```
11541171

11551172
**Editor support:** To enable autocompletion and live validation, choose one:
11561173

@@ -1171,22 +1188,29 @@ This enables autocompletion and live validation of your values.yaml file in edit
11711188
]
11721189
}
11731190
```
1174-
* **JetBrains IDEs**: in **Settings > Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings**, add the schema URL for `values.yaml`.
1191+
* **JetBrains IDEs**: in **Settings > Languages & Frameworks > Schemas and DTDs > JSON Schema Mappings**, add the
1192+
schema URL for `values.yaml`.
11751193

11761194
## NGINX and/or Ingress
11771195

1178-
By default, NGINX is enabled to allow sending the incoming requests to [Sentry Relay](https://getsentry.github.io/relay/) or the Django backend depending on the path. When Sentry is meant to be exposed outside of the Kubernetes cluster, it is recommended to disable NGINX and let the Ingress do the same. It's recommended to go with the go to Ingress Controller, [NGINX Ingress](https://kubernetes.github.io/ingress-nginx/) but others should work as well.
1196+
By default, NGINX is enabled to allow sending the incoming requests
1197+
to [Sentry Relay](https://getsentry.github.io/relay/) or the Django backend depending on the path. When Sentry is meant
1198+
to be exposed outside of the Kubernetes cluster, it is recommended to disable NGINX and let the Ingress do the same.
1199+
It's recommended to go with the go to Ingress Controller, [NGINX Ingress](https://kubernetes.github.io/ingress-nginx/)
1200+
but others should work as well.
11791201

11801202
## Sentry secret key
11811203

1182-
If no `sentry.existingSecret` value is specified, for your security, the [`system.secret-key`](https://develop.sentry.dev/config/#general) is generated for you on the first installation and stored in a kubernetes secret.
1204+
If no `sentry.existingSecret` value is specified, for your security, the [
1205+
`system.secret-key`](https://develop.sentry.dev/config/#general) is generated for you on the first installation and
1206+
stored in a kubernetes secret.
11831207

11841208
If `sentry.existingSecret` / `sentry.existingSecretKey` values are provided, those secrets will be used.
11851209

1186-
11871210
## Symbolicator and or JavaScript source maps
11881211

1189-
For getting native stacktraces and minidumps symbolicated with debug symbols (e.g. iOS/Android), you need to enable Symbolicator via
1212+
For getting native stacktraces and minidumps symbolicated with debug symbols (e.g. iOS/Android), you need to enable
1213+
Symbolicator via
11901214

11911215
```yaml
11921216
symbolicator:
@@ -1206,14 +1230,19 @@ filestore:
12061230
# storageClass: 'efs-storage' # see note below
12071231
```
12081232

1209-
Note: If you need to run or cannot avoid running sentry-worker and sentry-web on different cluster nodes, you need to set `filestore.filesystem.persistence.accessMode: ReadWriteMany` or might get problems. HOWEVER, [not all volume drivers support it](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes), like AWS EBS or GCP disks.
1210-
So you would want to create and use a `StorageClass` with a supported volume driver like [AWS EFS](https://github.com/kubernetes-sigs/aws-efs-csi-driver)
1233+
Note: If you need to run or cannot avoid running sentry-worker and sentry-web on different cluster nodes, you need to
1234+
set `filestore.filesystem.persistence.accessMode: ReadWriteMany` or might get problems.
1235+
HOWEVER, [not all volume drivers support it](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes),
1236+
like AWS EBS or GCP disks.
1237+
So you would want to create and use a `StorageClass` with a supported volume driver
1238+
like [AWS EFS](https://github.com/kubernetes-sigs/aws-efs-csi-driver)
12111239

12121240
Its also important having `connect_to_reserved_ips: true` in the symbolicator config file, which this Chart defaults to.
12131241

12141242
#### Source Maps
12151243

1216-
To get javascript source map processing working, you need to activate sourcemaps, which in turn activates the memcached dependency:
1244+
To get javascript source map processing working, you need to activate sourcemaps, which in turn activates the memcached
1245+
dependency:
12171246

12181247
```yaml
12191248
sourcemaps:
@@ -1222,10 +1251,10 @@ sourcemaps:
12221251

12231252
For details on the background see this blog post: https://engblog.yext.com/post/sentry-js-source-maps
12241253

1225-
12261254
## Geolocation
12271255

1228-
[Geolocation of IP addresses](https://develop.sentry.dev/self-hosted/geolocation/) is supported if you provide a GeoIP database:
1256+
[Geolocation of IP addresses](https://develop.sentry.dev/self-hosted/geolocation/) is supported if you provide a GeoIP
1257+
database:
12291258

12301259
Example values.yaml:
12311260

@@ -1344,7 +1373,8 @@ externalPostgresql:
13441373
host: host
13451374
```
13461375

1347-
it is possible to define which properties should be taken from secret or `values.yaml`, example below only takes `username` and `password` values from the secret:
1376+
it is possible to define which properties should be taken from secret or `values.yaml`, example below only takes
1377+
`username` and `password` values from the secret:
13481378

13491379
```yaml
13501380
externalPostgresql:
@@ -1357,7 +1387,8 @@ externalPostgresql:
13571387
database: sentry
13581388
```
13591389

1360-
> ⚠️ `.Values.externalPostgresql.existingSecretKey` is deprecated, `.Values.externalPostgresql.existingSecretKeys.password` should be used instead.
1390+
> ⚠️ `.Values.externalPostgresql.existingSecretKey` is deprecated,
1391+
`.Values.externalPostgresql.existingSecretKeys.password` should be used instead.
13611392

13621393
# Usage
13631394

0 commit comments

Comments
 (0)