monitoring

package
v2.2.0-alpha6+incompat... Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (

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

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(cattleAppsGetter projectv3.AppsGetter, projectID string, createApp *projectv3.App) error

func DeploySystemMonitor

func DeploySystemMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, agentRBACClient rbacv1.Interface, cattleAppsGetter projectv3.AppsGetter, cattleProjectsGetter mgmtv3.ProjectsGetter, cattleTemplateVersionsClient mgmtv3.CatalogTemplateVersionInterface) (backErr 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 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(appName, appTargetNamespace string) metav1.ListOptions

func OwnedLabels

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

func ProjectMonitoringInfo

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

func RevokePermissions

func RevokePermissions(agentRBACClient rbacv1.Interface, agentCoreClient corev1.Interface, appServiceAccountName, appClusterRoleName, appClusterRoleBindingName, appTargetNamespace string) error

func SyncServiceMonitor

func SyncServiceMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, agentRBACClient rbacv1.Interface, cattleAppsGetter projectv3.AppsGetter, cattleProjectsGetter mgmtv3.ProjectsGetter, cattleTemplateVersionsClient mgmtv3.CatalogTemplateVersionInterface) error

func SystemMonitoringInfo

func SystemMonitoringInfo() (appName, appTargetNamespace string)

func WithdrawApp

func WithdrawApp(cattleAppsGetter projectv3.AppsGetter, appLabels metav1.ListOptions) error

func WithdrawSystemMonitor

func WithdrawSystemMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, agentRBACClient rbacv1.Interface, cattleAppsGetter projectv3.AppsGetter) error

Types

type Level

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

Jump to

Keyboard shortcuts

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