Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable config #28

Merged
merged 3 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 35 additions & 27 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ required = [
"k8s.io/code-generator/cmd/lister-gen",
"k8s.io/code-generator/cmd/informer-gen",
"k8s.io/code-generator/cmd/openapi-gen",
"github.com/go-ini/ini",
"k8s.io/gengo/args",
]

Expand Down Expand Up @@ -43,11 +44,15 @@ required = [
name = "github.com/ghodss/yaml"
version = "=v1.0.0"

[[constraint]]
name = "github.com/go-ini/ini"
version = "=v1.42.0"

[[constraint]]
name = "github.com/operator-framework/operator-sdk"
# The version rule is used for a specific release and the master branch for in between releases.
# branch = "v0.2.x" #osdk_branch_annotation
version = "=v0.8.1" #osdk_version_annotation
version = "=v0.9.0" #osdk_version_annotation

[[constraint]]
name = "github.com/blang/semver"
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ Prerequisites:
```sh
$ operator-sdk up local --namespace=<namespace> --operator-flags="<flags to pass>"
```

# Grafana features not yet supported in the operator

## Notifier provisioning

Grafana has provisioning support for multiple channels (notifiers) of alerts. The operator does currently not support this type of provisioning. An empty directory is mounted at the expected location to prevent a warning in the grafana log. This feature might be supported in the future.
3 changes: 3 additions & 0 deletions deploy/crds/Grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
anonymous:
type: boolean
description: Anonymous auth enabled
config:
type: object
description: Grafana config
dashboardLabelSelectors:
type: array
items:
Expand Down
23 changes: 16 additions & 7 deletions deploy/examples/Grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,22 @@ metadata:
name: example-grafana
spec:
hostname: "grafana.apps.127.0.0.1.nip.io"
logLevel: "error"
adminUser: "admin"
adminPassword: "Password1"
basicAuth: False
disableLoginForm: False
disableSignoutMenu: True
anonymous: True
config:
log:
mode: "console"
level: "warn"
dashboards:
versions_to_keep: 2
security:
admin_user: "root"
admin_password: "secret"
auth:
disable_login_form: False
disable_signout_menu: True
auth.basic:
enabled: False
auth.anonymous:
enabled: True
dashboardLabelSelector:
- matchExpressions:
- {key: app, operator: In, values: [grafana]}
3 changes: 2 additions & 1 deletion deploy/examples/datasources/Prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ spec:
isDefault: true
version: 1
editable: true
jsonData: '{"timeInterval": "5s"}'
jsonData:
timeInterval: "5s"
3 changes: 2 additions & 1 deletion documentation/deploy_grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ The resource accepts the following properties in it's `spec`:
* *dashboardLabelSelector*: A list of either `matchLabels` or `matchExpressions` to filter the dashboards before importing them.
* *containers*: Extra containers to be added to the Grafana deployment. Can be used for example to add auth proxy side cars.
* *secrets*: A list of secrets that are added as volumes to the deployment. Mostly useful in combination with extra `containers`.
* *config*: The properties used to generate `grafana.ini`. All properties defined in the [official documentation](https://grafana.com/docs/installation/configuration/) are supported although some of them are not allowed to be overridden (path configuration). See `deploy/examples/Grafana.yaml` for an example.

The other accepted properties are `logLevel`, `adminUser`, `adminPassword`, `basicAuth`, `disableLoginForm`, `disableSignoutMenu` and `anonymous`. They map to the properties described in the [official documentation](https://grafana.com/docs/installation/configuration/#configuration), just use camel case instead of underscores.
The other accepted properties are `logLevel`, `adminUser`, `adminPassword`, `basicAuth`, `disableLoginForm`, `disableSignoutMenu` and `anonymous`. They are supported for legacy reasons, but new instances should use the `config` field. If a value is set in `config` then it will override the legacy field.

*NOTE*: setting `hostname` on Ingresses is not permitted on OpenShift. We recommend using the `--openshift` flag which will use a `Route` with an automatically assigned host instead. You can still use `Ingress` on OpenShift if you don't provide a `hostname` in the `Grafana` resource.

Expand Down
Loading