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(cattleAppClient projectv3.AppInterface, projectID string, ...) (*projectv3.App, error)
- func EnsureAppProjectName(agentNamespacesClient corev1.NamespaceInterface, ...) (string, error)
- func GetOverwroteAppAnswers(annotations map[string]string) map[string]string
- func GetSystemProjectID(cattleProjectsClient mgmtv3.ProjectInterface) (string, error)
- func OverwriteAppAnswers(rawAnswers map[string]string, annotations map[string]string) map[string]string
- func OwnedAppListOptions(clusterID, appName, appTargetNamespace string) metav1.ListOptions
- func OwnedLabels(appName, appTargetNamespace, appProjectName string, level AppLevel) map[string]string
- func ProjectMonitoringInfo(projectName string) (appName, appTargetNamespace string)
- func ProjectPrometheusEndpoint(projectName string) (headlessServiceName, namespace, port string)
- func SystemMonitoringInfo() (appName, appTargetNamespace string)
- func WithdrawApp(cattleAppClient projectv3.AppInterface, appLabels metav1.ListOptions) error
- type AppLevel
Constants ¶
const ( //CattlePrometheusRuleLabelKey The label info of PrometheusRule CattlePrometheusRuleLabelKey = "source" CattleAlertingPrometheusRuleLabelValue = "rancher-alert" CattleMonitoringPrometheusRuleLabelValue = "rancher-monitoring" )
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 EnsureAppProjectName ¶
func EnsureAppProjectName(agentNamespacesClient corev1.NamespaceInterface, ownedProjectID, clusterName, appTargetNamespace string) (string, error)
func GetOverwroteAppAnswers ¶
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 ProjectMonitoringInfo ¶
func SystemMonitoringInfo ¶
func SystemMonitoringInfo() (appName, appTargetNamespace string)
func WithdrawApp ¶
func WithdrawApp(cattleAppClient projectv3.AppInterface, appLabels metav1.ListOptions) error