grafana

package
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathsSectionName         = "paths"
	SecuritySectionName      = "security"
	LogSectionName           = "log"
	AuthSectionName          = "auth"
	AuthBasicSectionName     = "auth.basic"
	AuthAnonymousSectionName = "auth.anonymous"
)
View Source
const (
	PhaseConfigFiles int = iota
	PhaseInstallGrafana
	PhaseDone
	PhaseReconcile
)
View Source
const (
	// DefaultLogLevel is the default logging level
	DefaultLogLevel = "info"
)
View Source
const OpenShiftOAuthRedirect = "serviceaccounts.openshift.io/oauth-redirectreference.primary"

Variables

View Source
var MockCR = v1alpha1.Grafana{
	ObjectMeta: v1.ObjectMeta{
		Name:      "test",
		Namespace: "dummy",
	},
	Spec: v1alpha1.GrafanaSpec{
		Containers: []v12.Container{},
	},
}
View Source
var MockGrafana = v1alpha1.Grafana{
	Status: v1alpha1.GrafanaStatus{
		Phase:            0,
		InstalledPlugins: v1alpha1.PluginList{},
	},
}
View Source
var Mockplugina100 = v1alpha1.GrafanaPlugin{
	Name:    "a",
	Version: "1.0.0",
}
View Source
var Mockplugina101 = v1alpha1.GrafanaPlugin{
	Name:    "a",
	Version: "1.0.1",
}
View Source
var Mockplugina102 = v1alpha1.GrafanaPlugin{
	Name:    "a",
	Version: "1.0.2",
}
View Source
var Mockpluginb100 = v1alpha1.GrafanaPlugin{
	Name:    "b",
	Version: "1.0.0",
}
View Source
var Mockpluginc100 = v1alpha1.GrafanaPlugin{
	Name:    "c",
	Version: "1.0.0",
}

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new Grafana Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type GrafanaParameters

type GrafanaParameters struct {
	AdminPassword                   string
	AdminUser                       string
	Anonymous                       bool
	BasicAuth                       bool
	DisableLoginForm                bool
	DisableSignoutMenu              bool
	GrafanaConfigHash               string
	GrafanaConfigMapName            string
	GrafanaDashboardsConfigMapName  string
	GrafanaDatasourcesConfigMapName string
	GrafanaDeploymentName           string
	GrafanaImage                    string
	GrafanaIngressAnnotations       map[string]string
	GrafanaIngressLabels            map[string]string
	GrafanaIngressName              string
	GrafanaIngressPath              string
	GrafanaProvidersConfigMapName   string
	GrafanaRouteName                string
	GrafanaServiceAccountName       string
	GrafanaServiceAnnotations       map[string]string
	GrafanaServiceLabels            map[string]string
	GrafanaServiceName              string
	GrafanaServiceType              string
	GrafanaVersion                  string
	Hostname                        string
	LogLevel                        string
	Namespace                       string
	PluginsInitContainerImage       string
	PluginsInitContainerTag         string
	PodLabelValue                   string
	Replicas                        int
}

GrafanaParameters provides the context for the template

type IniConfig added in v1.2.0

type IniConfig struct {
	Cr       *v1alpha1.Grafana
	Contents string
	Hash     string
}

func NewIniConfig added in v1.2.0

func NewIniConfig(cr *v1alpha1.Grafana) *IniConfig

func (*IniConfig) Build added in v1.2.0

func (i *IniConfig) Build() error

Creates the ini config from the CR

func (*IniConfig) DiffersFrom added in v1.2.0

func (i *IniConfig) DiffersFrom(lastConfigHash string) bool

type PluginsHelperImpl

type PluginsHelperImpl struct {
	BaseUrl    string
	HttpClient *http.Client
}

func (*PluginsHelperImpl) BuildEnv

func (h *PluginsHelperImpl) BuildEnv(cr *integreatly.Grafana) string

Turns an array of plugins into a string representation of the form `<name>:<version>,...` that is used as the value for the GRAFANA_PLUGINS environment variable

func (*PluginsHelperImpl) CanUpdatePlugins

func (h *PluginsHelperImpl) CanUpdatePlugins() bool

func (*PluginsHelperImpl) FilterPlugins

Creates the list of plugins that can be added or updated Does not directly deal with removing plugins: if a plugin is not in the list and the env var is updated, it will automatically be removed

func (*PluginsHelperImpl) PickLatestVersions

func (h *PluginsHelperImpl) PickLatestVersions(requested integreatly.PluginList) (integreatly.PluginList, error)

Append a status message to the origin dashboard of a plugin

func (*PluginsHelperImpl) PluginExists

func (h *PluginsHelperImpl) PluginExists(plugin integreatly.GrafanaPlugin) bool

Query the Grafana plugin database for the given plugin and version A 200 OK response indicates that the plugin exists and can be downloaded

type ReconcileGrafana

type ReconcileGrafana struct {
	// contains filtered or unexported fields
}

ReconcileGrafana reconciles a Grafana object

func (*ReconcileGrafana) Reconcile

func (r *ReconcileGrafana) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a Grafana object and makes changes based on the state read and what is in the Grafana.Spec

func (*ReconcileGrafana) ReconcileDashboardPlugins

func (r *ReconcileGrafana) ReconcileDashboardPlugins(cr *i8ly.Grafana) error

ReconcileDashboardPlugins is responsible for reconciling the grafana dashboards

func (*ReconcileGrafana) ReconcileGrafana added in v1.2.0

func (r *ReconcileGrafana) ReconcileGrafana(cr *i8ly.Grafana) (reconcile.Result, error)

ReconcileGrafana is constantly reconcile the grafana config and plugins

func (*ReconcileGrafana) ReconcilePlugins

func (r *ReconcileGrafana) ReconcilePlugins(cr *i8ly.Grafana, plugins []i8ly.GrafanaPlugin) error

type ResourceHelper

type ResourceHelper struct {
	// contains filtered or unexported fields
}

Helps with creating kubernetes resources from yaml templates

type TemplateHelper

type TemplateHelper struct {
	Parameters   GrafanaParameters
	TemplatePath string
}

TemplateHelper is the deployment helper object

type UnstructuredResourceMap

type UnstructuredResourceMap struct {
	Values map[string]interface{}
}

An abstraction type that allows easier access to the contents of an unstructured resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL