-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
273 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Guidelines on Contributing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# `Project` | ||
|
||
The `Project` custom resource allows for the provisioning and management of Sentry projects. | ||
|
||
## Usage | ||
|
||
A `Project` supports the following fields in its spec: | ||
|
||
- `team` (required) | ||
|
||
Slug of the Sentry team that this project should be created under. | ||
|
||
- `name` (required) | ||
|
||
Name of the Sentry project. | ||
|
||
- `slug` (required) | ||
|
||
Slug of the Sentry project. | ||
|
||
It is generally recommended to use the same value as the project's name, as Sentry has some quirky behaviour about handling the uniqueness of slugs. | ||
|
||
## Examples | ||
|
||
#### Basic `Project` | ||
|
||
```yaml | ||
apiVersion: sentry.kubernetes.jaceys.me/v1alpha1 | ||
kind: Project | ||
metadata: | ||
name: bar | ||
spec: | ||
team: foo | ||
name: bar | ||
slug: bar | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# `ProjectKey` | ||
|
||
The `ProjectKey` custom resource allows for the provisioning and management of client keys that belong to a Sentry project. These client keys contain a [Sentry DSN](https://docs.sentry.io/error-reporting/quickstart/#configure-the-sdk) value that tells your application's Sentry SDK where to send events to. | ||
|
||
## Usage | ||
|
||
A `ProjectKey` supports the following fields in its spec: | ||
|
||
- `project` (required) | ||
|
||
Slug of the Sentry project that this project key should be created under. | ||
|
||
- `name` (required) | ||
|
||
Name of the Sentry project key. | ||
|
||
### `ProjectKey` Secrets | ||
|
||
When creating a `ProjectKey`, the Sentry operator will automatically provision a Kubernetes Secret containing the associated Sentry DSN in the same namespace. It will inherit the name of your `ProjectKey`, suffixed with `sentry-projectkey-`. | ||
|
||
Any labels and annotations attached to `ProjectKey`s are also automatically propagated to their affiliated Secret. | ||
|
||
For example, the [basic `ProjectKey` example](#basic-projectkey) below will result in the creation of a Secret like the following: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: sentry-projectkey-bar-production | ||
type: Opaque | ||
data: | ||
SENTRY_DSN: <dsn-value> | ||
``` | ||
You can then configure your Pods to automatically consume the injected Sentry DSN value using a `secretKeyRef` to the above Secret: | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: bar | ||
spec: | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: bar | ||
image: ubuntu:18.04 | ||
command: | ||
- echo | ||
args: | ||
- $(SENTRY_DSN) | ||
env: | ||
- name: SENTRY_DSN | ||
valueFrom: | ||
secretKeyRef: | ||
name: sentry-projectkey-bar-production | ||
key: SENTRY_DSN | ||
``` | ||
|
||
## Examples | ||
|
||
#### Basic `ProjectKey` | ||
|
||
```yaml | ||
apiVersion: sentry.kubernetes.jaceys.me/v1alpha1 | ||
kind: ProjectKey | ||
metadata: | ||
name: bar-production | ||
spec: | ||
project: bar | ||
name: production | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# `Team` | ||
|
||
The `Team` custom resource allows for the provisioning and management of Sentry teams. | ||
|
||
## Usage | ||
|
||
A `Team` supports the following fields in its spec: | ||
|
||
- `name` (required) | ||
|
||
Name of the Sentry team. | ||
|
||
- `slug` (required) | ||
|
||
Slug of the Sentry team. | ||
|
||
It is generally recommended to use the same value as the team's name, as Sentry has some quirky behaviour about handling the uniqueness of slugs. | ||
|
||
## Examples | ||
|
||
#### Basic `Team` | ||
|
||
```yaml | ||
apiVersion: sentry.kubernetes.jaceys.me/v1alpha1 | ||
kind: Team | ||
metadata: | ||
name: foo | ||
spec: | ||
name: foo | ||
slug: foo | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Installing Sentry Operator | ||
|
||
## Requirements | ||
|
||
- An existing Kubernetes cluster | ||
|
||
## Installation | ||
|
||
To install the operator into your cluster, run: | ||
|
||
```shell | ||
kubectl apply -f https://github.com/jace-ys/sentry-operator/releases/download/v0.1.0/release.yaml | ||
``` | ||
|
||
You can install a specific release using a different version number. Find all possible versions under [releases](https://github.com/jace-ys/sentry-operator/releases). | ||
|
||
## Configuration | ||
|
||
The Sentry operator assumes you have a single Sentry organization under which it will create its resources; you will need to configure the operator with access to your organization for it to work. | ||
|
||
To do this, the operator is configured to read environment variables from a Kubernetes Secret with the name `sentry-operator-config` in the `sentry-operator-system` namespace. | ||
|
||
To create the Secret, run: | ||
|
||
```shell | ||
kubectl create secret generic sentry-operator-config \ | ||
--namespace sentry-operator-system \ | ||
--from-literal SENTRY_ORGANIZATION=<required> \ | ||
--from-literal SENTRY_TOKEN=<required> \ | ||
--from-literal SENTRY_URL=<optional> | ||
``` | ||
|
||
#### Configuration Options | ||
|
||
The following configuration options are available: | ||
|
||
- `SENTRY_ORGANIZATION` (required) | ||
|
||
The slug of the Sentry organization to be managed. | ||
|
||
- `SENTRY_TOKEN` (required) | ||
|
||
The authentication token for communicating with the Sentry API. This token requires the following scopes: | ||
|
||
- `org:admin`, `org:write`, `org:read` | ||
- `team:admin`, `team:write`, `team:read` | ||
- `project:admin`, `project:write`, `project:read` | ||
|
||
- `SENTRY_URL` (optional) | ||
|
||
The URL of the Sentry server. Defaults to `https://sentry.io/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: bar | ||
spec: | ||
restartPolicy: OnFailure | ||
containers: | ||
- name: bar | ||
image: ubuntu:18.04 | ||
command: | ||
- echo | ||
args: | ||
- $(SENTRY_DSN) | ||
env: | ||
- name: SENTRY_DSN | ||
valueFrom: | ||
secretKeyRef: | ||
name: sentry-projectkey-bar-production | ||
key: SENTRY_DSN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters