monitoring

package
v2.2.0-rc10+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//CattlePrometheusRuleLabelKey The label info of PrometheusRule
	CattlePrometheusRuleLabelKey             = "source"
	CattleAlertingPrometheusRuleLabelValue   = "rancher-alert"
	CattleMonitoringPrometheusRuleLabelValue = "rancher-monitoring"
)

Variables

View Source
var (
	APIVersion = types.APIVersion{
		Version: "v1",
		Group:   "monitoring.coreos.com",
		Path:    "/v3/project",
	}
)

Functions

func AppendAppOverwritingAnswers

func AppendAppOverwritingAnswers(toAnnotations map[string]string, appOverwriteAnswers string) map[string]string

func ClusterAlertManagerEndpoint

func ClusterAlertManagerEndpoint() (headlessServiceName, namespace, port string)

func ClusterAlertManagerInfo

func ClusterAlertManagerInfo() (appName, appTargetNamespace string)

func ClusterMonitoringInfo

func ClusterMonitoringInfo() (appName, appTargetNamespace string)

func ClusterPrometheusEndpoint

func ClusterPrometheusEndpoint() (headlessServiceName, namespace, port string)

func CopyCreatorID

func CopyCreatorID(toAnnotations, fromAnnotations map[string]string) map[string]string

func DeployApp

func DeployApp(cattleAppClient projectv3.AppInterface, projectID string, createOrUpdateApp *projectv3.App) error

func DetectAppCatalogExistence

func DetectAppCatalogExistence(appCatalogID string, cattleTemplateVersionsClient mgmtv3.CatalogTemplateVersionInterface) error

func EnsureAppProjectName

func EnsureAppProjectName(agentNamespacesClient corev1.NamespaceInterface, ownedProjectID, clusterName, appTargetNamespace string) (string, error)

func GetOverwroteAppAnswers

func GetOverwroteAppAnswers(annotations map[string]string) map[string]string

func GetSystemProjectID

func GetSystemProjectID(cattleProjectsClient mgmtv3.ProjectInterface) (string, error)

func OverwriteAppAnswers

func OverwriteAppAnswers(rawAnswers map[string]string, annotations map[string]string) map[string]string

OverwriteAppAnswers Usage ## special key prefix _tpl- [priority low] -> regex ${value} = ${middle-prefix}#(${root1,root2,...}), then generate ${root*}.${middle-prefix} as prefix-key

## example

### input

key 				 	|           			value

----------------------------------------------------------------------------------------------- _tpl-Node_Selector | nodeSelector#(prometheus,grafana,exporter-kube-state) _tpl-Storage_Class | persistence#(prometheus,grafana) ----------------------------------------------------------------------------------------------- prometheus.retention | 360h exporter-node.ports.metrics.port | 9100 grafana.persistence.enabled | false nodeSelector.region | region-a nodeSelector.zone | zone-b persistence.enabled | true persistence.storageClass | default persistence.accessMode | ReadWriteOnce persistence.size | 50Gi

### output

key 				 	|           			value

----------------------------------------------------------------------------------------------- prometheus.retention | 360h exporter-node.ports.metrics.port | 9100 prometheus.nodeSelector.region | region-a prometheus.nodeSelector.zone | zone-b grafana.nodeSelector.region | region-a grafana.nodeSelector.zone | zone-b exporter-kube-state.nodeSelector.region | region-a exporter-kube-state.nodeSelector.zone | zone-b prometheus.persistence.enabled | true prometheus.persistence.storageClass | default prometheus.persistence.accessMode | ReadWriteOnce prometheus.persistence.size | 50Gi grafana.persistence.enabled | false // can't overwrite by low priority grafana.persistence.storageClass | default grafana.persistence.accessMode | ReadWriteOnce grafana.persistence.size | 50Gi

func OwnedAppListOptions

func OwnedAppListOptions(clusterID, appName, appTargetNamespace string) metav1.ListOptions

func OwnedLabels

func OwnedLabels(appName, appTargetNamespace, appProjectName string, level AppLevel) map[string]string

func ProjectMonitoringInfo

func ProjectMonitoringInfo(projectName string) (appName, appTargetNamespace string)

func ProjectPrometheusEndpoint

func ProjectPrometheusEndpoint(projectName string) (headlessServiceName, namespace, port string)

func SystemMonitoringInfo

func SystemMonitoringInfo() (appName, appTargetNamespace string)

func WithdrawApp

func WithdrawApp(cattleAppClient projectv3.AppInterface, appLabels metav1.ListOptions) error

Types

type AppLevel

type AppLevel string
const (
	SystemLevel  AppLevel = "system"
	ClusterLevel AppLevel = "cluster"
	ProjectLevel AppLevel = "project"
)

Jump to

Keyboard shortcuts

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