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

Add remaining [plugin] fields to Grafanas.spec.config.plugins #802

Merged
merged 1 commit into from
Jul 27, 2022
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
12 changes: 12 additions & 0 deletions api/integreatly/v1alpha1/grafana_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,19 @@ type GrafanaConfigPanels struct {

type GrafanaConfigPlugins struct {
// +nullable
// Set to true if you want to test alpha plugins that are not yet ready for general usage. Default is false.
EnableAlpha *bool `json:"enable_alpha,omitempty" ini:"enable_alpha"`
// Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
// We do not recommend using this option. For more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-signatures
AllowLoadingUnsignedPlugins string `json:"allow_loading_unsigned_plugins,omitempty" ini:"allow_loading_unsigned_plugins"`
// +nullable
// Available to Grafana administrators only, enables installing / uninstalling / updating plugins directly from the Grafana UI. Set to true by default. Setting it to false will hide the install / uninstall / update controls.
// For more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-catalog
PluginAdminEnabled *bool `json:"plugin_admin_enabled" ini:"plugin_admin_enabled"`
// Custom install/learn more URL for enterprise plugins. Defaults to https://grafana.com/grafana/plugins/.
PluginCatalogURL string `json:"plugin_catalog_url,omitempty" ini:"plugin_catalog_url"`
// Enter a comma-separated list of plugin identifiers to hide in the plugin catalog.
PluginCatalogHiddenPlugins string `json:"plugin_catalog_hidden_plugins,omitempty" ini:"plugin_catalog_hidden_plugins"`
}

type GrafanaConfigRendering struct {
Expand Down
5 changes: 5 additions & 0 deletions api/integreatly/v1alpha1/zz_generated.deepcopy.go

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

26 changes: 26 additions & 0 deletions config/crd/bases/integreatly.org_grafanas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,35 @@ spec:
type: object
plugins:
properties:
allow_loading_unsigned_plugins:
description: Enter a comma-separated list of plugin identifiers
to identify plugins to load even if they are unsigned. Plugins
with modified signatures are never loaded. We do not recommend
using this option. For more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-signatures
type: string
enable_alpha:
description: Set to true if you want to test alpha plugins
that are not yet ready for general usage. Default is false.
nullable: true
type: boolean
plugin_admin_enabled:
description: Available to Grafana administrators only, enables
installing / uninstalling / updating plugins directly from
the Grafana UI. Set to true by default. Setting it to false
will hide the install / uninstall / update controls. For
more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-catalog
nullable: true
type: boolean
plugin_catalog_hidden_plugins:
description: Enter a comma-separated list of plugin identifiers
to hide in the plugin catalog.
type: string
plugin_catalog_url:
description: Custom install/learn more URL for enterprise
plugins. Defaults to https://grafana.com/grafana/plugins/.
type: string
required:
- plugin_admin_enabled
type: object
remote_cache:
properties:
Expand Down
4 changes: 4 additions & 0 deletions controllers/config/grafanaIni.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ func (i *GrafanaIni) parseConfig(config map[string][]string) map[string][]string
if i.cfg.Plugins != nil {
var items []string
items = appendBool(items, "enable_alpha", i.cfg.Plugins.EnableAlpha)
items = appendStr(items, "allow_loading_unsigned_plugins", i.cfg.Plugins.AllowLoadingUnsignedPlugins)
items = appendBool(items, "plugin_admin_enabled", i.cfg.Plugins.PluginAdminEnabled)
items = appendStr(items, "plugin_catalog_url", i.cfg.Plugins.PluginCatalogURL)
items = appendStr(items, "plugin_catalog_hidden_items", i.cfg.Plugins.PluginCatalogHiddenPlugins)
config["plugins"] = items
}

Expand Down
45 changes: 45 additions & 0 deletions deploy/examples/GrafanaDevEnv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This example shows how to create a Grafana that allows alpha and unsigned plugins for testing custom plugins
apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
name: example-dev-env-grafana
spec:
client:
preferService: true
ingress:
enabled: True
pathType: Prefix
path: "/"
config:
log:
mode: "console"
level: "error"
log.frontend:
enabled: true
auth:
disable_login_form: False
disable_signout_menu: True
auth.anonymous:
enabled: True
plugins:
enable_alpha: true
allow_loading_unsigned_plugins: 'my-internal-plugin1,my-internal-plugin2'
plugin_admin_enabled: true
plugin_catalog_url: http://my-internal-plugin-repo.example.com
plugin_catalog_hidden_plugins: 'hidden-plugin1,hidden-plugin2'
service:
name: "grafana-service"
labels:
app: "grafana"
type: "grafana-service"
dashboardLabelSelector:
- matchExpressions:
- { key: app, operator: In, values: [grafana] }
resources:
# Optionally specify container resources
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
26 changes: 26 additions & 0 deletions deploy/manifests/latest/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1224,9 +1224,35 @@ spec:
type: object
plugins:
properties:
allow_loading_unsigned_plugins:
description: Enter a comma-separated list of plugin identifiers
to identify plugins to load even if they are unsigned. Plugins
with modified signatures are never loaded. We do not recommend
using this option. For more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-signatures
type: string
enable_alpha:
description: Set to true if you want to test alpha plugins
that are not yet ready for general usage. Default is false.
nullable: true
type: boolean
plugin_admin_enabled:
description: Available to Grafana administrators only, enables
installing / uninstalling / updating plugins directly from
the Grafana UI. Set to true by default. Setting it to false
will hide the install / uninstall / update controls. For
more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-catalog
nullable: true
type: boolean
plugin_catalog_hidden_plugins:
description: Enter a comma-separated list of plugin identifiers
to hide in the plugin catalog.
type: string
plugin_catalog_url:
description: Custom install/learn more URL for enterprise
plugins. Defaults to https://grafana.com/grafana/plugins/.
type: string
required:
- plugin_admin_enabled
type: object
remote_cache:
properties:
Expand Down
30 changes: 29 additions & 1 deletion documentation/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4380,10 +4380,38 @@ GrafanaConfig is the configuration for grafana
</tr>
</thead>
<tbody><tr>
<td><b>plugin_admin_enabled</b></td>
<td>boolean</td>
<td>
Available to Grafana administrators only, enables installing / uninstalling / updating plugins directly from the Grafana UI. Set to true by default. Setting it to false will hide the install / uninstall / update controls. For more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-catalog<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>allow_loading_unsigned_plugins</b></td>
<td>string</td>
<td>
Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded. We do not recommend using this option. For more information, refer to https://grafana.com/docs/grafana/next/administration/plugin-management/#plugin-signatures<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>enable_alpha</b></td>
<td>boolean</td>
<td>
<br/>
Set to true if you want to test alpha plugins that are not yet ready for general usage. Default is false.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>plugin_catalog_hidden_plugins</b></td>
<td>string</td>
<td>
Enter a comma-separated list of plugin identifiers to hide in the plugin catalog.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>plugin_catalog_url</b></td>
<td>string</td>
<td>
Custom install/learn more URL for enterprise plugins. Defaults to https://grafana.com/grafana/plugins/.<br/>
</td>
<td>false</td>
</tr></tbody>
Expand Down