Documentation ¶
Index ¶
- Constants
- Variables
- func AppendAppOverwritingAnswers(toAnnotations map[string]string, appOverwriteAnswers string) map[string]string
- func ClusterAlertManagerEndpoint() (headlessServiceName, namespace, port string)
- func ClusterAlertManagerInfo() (appName, appTargetNamespace string)
- func ClusterMonitoringInfo() (appName, appTargetNamespace string)
- func ClusterPrometheusEndpoint() (headlessServiceName, namespace, port string)
- func CopyCreatorID(toAnnotations, fromAnnotations map[string]string) map[string]string
- func DeployApp(cattleAppsGetter projectv3.AppsGetter, projectID string, ...) error
- func DeploySystemMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, ...) (backErr error)
- func DetectAppCatalogExistence(appCatalogID string, ...) error
- func EnsureAppProjectName(agentNamespacesClient corev1.NamespaceInterface, ...) (string, error)
- func GetSystemProjectID(cattleProjectsClient mgmtv3.ProjectInterface) (string, error)
- func OverwriteAppAnswers(rawAnswers map[string]string, annotations map[string]string) map[string]string
- func OwnedAppListOptions(appName, appTargetNamespace string) metav1.ListOptions
- func OwnedLabels(appName, appTargetNamespace string, level Level) map[string]string
- func ProjectMonitoringInfo(projectName string) (appName, appTargetNamespace string)
- func RevokePermissions(agentRBACClient rbacv1.Interface, agentCoreClient corev1.Interface, ...) error
- func SyncServiceMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, ...) error
- func SystemMonitoringInfo() (appName, appTargetNamespace string)
- func WithdrawApp(cattleAppsGetter projectv3.AppsGetter, appLabels metav1.ListOptions) error
- func WithdrawSystemMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, ...) error
- type Level
Constants ¶
const ( //CattlePrometheusRuleLabelKey The label info of PrometheusRule CattlePrometheusRuleLabelKey = "source" CattleAlertingPrometheusRuleLabelValue = "rancher-alert" )
Variables ¶
var (
APIVersion = types.APIVersion{
Version: "v1",
Group: "monitoring.coreos.com",
Path: "/v3/project",
}
)
Functions ¶
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 DeploySystemMonitor ¶
func DeploySystemMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, agentRBACClient rbacv1.Interface, cattleAppsGetter projectv3.AppsGetter, cattleProjectsGetter mgmtv3.ProjectsGetter, cattleTemplateVersionsClient mgmtv3.TemplateVersionInterface) (backErr error)
func DetectAppCatalogExistence ¶
func DetectAppCatalogExistence(appCatalogID string, cattleTemplateVersionsClient mgmtv3.TemplateVersionInterface) 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 ProjectMonitoringInfo ¶
func RevokePermissions ¶
func SyncServiceMonitor ¶
func SyncServiceMonitor(cluster *mgmtv3.Cluster, agentCoreClient corev1.Interface, agentRBACClient rbacv1.Interface, cattleAppsGetter projectv3.AppsGetter, cattleProjectsGetter mgmtv3.ProjectsGetter, cattleTemplateVersionsClient mgmtv3.TemplateVersionInterface) error
func SystemMonitoringInfo ¶
func SystemMonitoringInfo() (appName, appTargetNamespace string)
func WithdrawApp ¶
func WithdrawApp(cattleAppsGetter projectv3.AppsGetter, appLabels metav1.ListOptions) error