diff --git a/charts/gardener-extension-registry-cache/templates/clusterrole.yaml b/charts/gardener-extension-registry-cache/templates/clusterrole.yaml index 88fd7de7..14fdea7c 100644 --- a/charts/gardener-extension-registry-cache/templates/clusterrole.yaml +++ b/charts/gardener-extension-registry-cache/templates/clusterrole.yaml @@ -78,8 +78,6 @@ rules: - patch - delete resourceNames: -# TODO(dimitar-kostadinov): Remove 'extension-registry-cache-monitoring' after August 2024. - - extension-registry-cache-monitoring - registry-cache-dashboards - apiGroups: - "" @@ -108,13 +106,4 @@ rules: - create - update - patch - - delete -# TODO(dimitar-kostadinov): Remove this after August 2024. -- apiGroups: - - apps - resources: - - statefulsets - verbs: - - get - - list - - watch \ No newline at end of file + - delete \ No newline at end of file diff --git a/example/controller-registration.yaml b/example/controller-registration.yaml index 24cd5b71..1be27306 100644 --- a/example/controller-registration.yaml +++ b/example/controller-registration.yaml @@ -4,7 +4,7 @@ kind: ControllerDeployment metadata: name: extension-registry-cache helm: - rawChart: H4sIAAAAAAAAA+0da2/bOLKf9St47gJtD5X8TLJnoAdkE28bbJsYSS53h8UikCXG5kYStaTk1Nv2fvsNRT0oybakpOs0uxoUsU2RwyE5M5wZDtW5yWzsYabjjwH2OKGezvCc8ICtdMu0Frj77MHQAzjY24s+AYqf0ff+cNQf7A3290V5f3+wP3yG9h7edTWEPDAZQs8YpcG2elXPnyjMK9ffWGDHJXOPMnzPPsQC749GG9cflj2//oPeaNB7hnpfdaQb4C++/s/R1AwCzDyOAorkMqO7BfbQLCSOTbw58k3r1pxjbmjP0eWCcMRD36csgC/AGg6aO3SGXDOwFlD7NWLYMQOyxNAuWCjlpmcDAg/P4Sn10Euf4RvyEdvojkC9v70y0JnnrBD1opaCJORjhhziYUMzji+uLwKgDVAcUdcFBFdHF8gmjGvGnATd6K8kXzNmv7Nu9DcpWMy74k/yky+9boZoBuMLfXRDHMy1vxv8zoe/M/MW/gYufP8fVL0yGaEhRyfHE+jQZ/RXbAWaQWxsdmU9KNKMJbeojbvaY69qfa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z3SSOnG/lXPPVYf5xbPEwsHVhnPMCuraNIfqmaUSp0ZHoI+tRp8s3GP/x8rS3N4MqL3/MSjv/6P+fnv/YydQ9v/KNkDqVrSOXqaFwZ1jcRpAcYou2S2BCbzBriBPRx81kf9FgO/1HuC6+M9B5fy3fzBq3/+7EyhZEnKJlRXhlG59Sa4XNph2YBaWI0JQKaTwbMKcw6QamAP3UBkm9L+l2kgttBUDSK1WPQW4WKZ0jZZtBYVUz8LJHjVLgEbIo/6h8gL0nBiPeIyrRGVOfo8oJw7qrCfZyrFYqimiImvZ2TDYFS21dCcPv19BnB1EDSjLUFjQbnuyis0KSWuNJyfH1XRyKi31SyBprrGjEIzROeAkIhQyj8so5W4pGzVLB111hUqWV65R5RlS2/CUOvfQeVaVqAQpzTaWg9UrW3m9zXcO6/X/QvXwgBfA1+r/Ufn+f2+0157/7gSS6xYk4iwgpsPsW/Dxg9uZ5ZBFN2OO5D886AbRFLgrK+9qr5crcs04thhCo3JV4/TmjIUTkEspDIZ+n01m2xjPwb8O5WviRPwO5MQvfYGINbPUC7GkYztdojj8kl9AMpKaUkiKXnCWgPk8zS5MsUqJCJi8uUV97bXK6S0fI3Vmf+j90JOkasefPNEMyT4iFehezzN0bbY/eksNEMucIicjZdVmVN04UkzDAWBarb7jngel+oNXtFZ1dOQ+3TGMPOE5HiesgHblIiY9e6V1umXqd1hUrnN2aDtWF0ZW3SaBYfTk07W3OFLL2Si4+WMju5GkiByNhklRmiTdl6+LMozq9ZMx+uVXw1iV8Qqq81PMESpLfhx/z8MaKSsnxdBdvFrnJGBCvrgN5nhGw3k0le9t6zqyrnzjOQyi8CNrzrWGWwoaVyaP6A65063QE2Jg687Q6lk9cwpWltWHpUxxjNXRefJ/OHSejivSQgsttNBCCy200EILLbTQwp8I/we1cfEsAHgAAA== values: image: europe-docker.pkg.dev/gardener-project/public/gardener/extensions/registry-cache:v0.10.0-dev --- diff --git a/pkg/component/registrycaches/alerting-rules/registry-cache.rules.yaml b/pkg/component/registrycaches/alerting-rules/registry-cache.rules.yaml deleted file mode 100644 index 346da792..00000000 --- a/pkg/component/registrycaches/alerting-rules/registry-cache.rules.yaml +++ /dev/null @@ -1,45 +0,0 @@ -groups: -- name: registry-cache.rules - rules: - - alert: RegistryCachePersistentVolumeUsageCritical - expr: | - 100 * ( - kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - / - kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - ) < 5 - for: 1h - labels: - service: registry-cache-extension - severity: warning - type: shoot - visibility: owner - annotations: - summary: Registry cache PersistentVolume almost full. - description: The registry-cache PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} is only {{ printf "%0.2f" $value }}% free. When there is no available disk space, no new images will be cached. However, image pull operations are not affected. - - alert: RegistryCachePersistentVolumeFullInFourDays - expr: | - 100 * ( - kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - / - kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - ) < 15 - and - predict_linear(kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"}[30m], 4 * 24 * 3600) <= 0 - for: 1h - labels: - service: registry-cache-extension - severity: warning - type: shoot - visibility: owner - annotations: - summary: Registry cache PersistentVolume will be full in four days. - description: Based on recent sampling, the registry cache PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ printf "%0.2f" $value }}% is available. - - # We rely on the implicit contract that recording rules in format "shoot:(.+):(.+)" will be - # automatically federated to the aggregate prometheus and then to the garden-prometheus. - # Ref https://github.com/gardener/gardener/blob/v1.90.0/pkg/component/observability/monitoring/prometheus/aggregate/servicemonitors.go#L45 - - record: shoot:registry_proxy_pushed_bytes_total:sum - expr: sum by (upstream_host) (rate(registry_proxy_pushed_bytes_total[5m])) - - record: shoot:registry_proxy_pulled_bytes_total:sum - expr: sum by (upstream_host) (rate(registry_proxy_pulled_bytes_total[5m])) diff --git a/pkg/component/registrycaches/monitoring.go b/pkg/component/registrycaches/monitoring.go index 9baaee6c..1ab8ad1d 100644 --- a/pkg/component/registrycaches/monitoring.go +++ b/pkg/component/registrycaches/monitoring.go @@ -7,247 +7,163 @@ package registrycaches import ( "context" _ "embed" - "fmt" "strconv" v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" kubeapiserverconstants "github.com/gardener/gardener/pkg/component/kubernetes/apiserver/constants" monitoringutils "github.com/gardener/gardener/pkg/component/observability/monitoring/utils" "github.com/gardener/gardener/pkg/controllerutils" - "github.com/gardener/gardener/pkg/utils" - kutil "github.com/gardener/gardener/pkg/utils/kubernetes" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" monitoringv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" - appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" ) var ( - scrapeConfigYAML = `- job_name: registry-cache-metrics - scheme: https - tls_config: - ca_file: /etc/prometheus/seed/ca.crt - authorization: - type: Bearer - credentials_file: /var/run/secrets/gardener.cloud/shoot/token/token - honor_labels: false - kubernetes_sd_configs: - - role: pod - api_server: https://` + v1beta1constants.DeploymentNameKubeAPIServer + `:` + strconv.Itoa(kubeapiserverconstants.Port) + ` - namespaces: - names: [ kube-system ] - tls_config: - ca_file: /etc/prometheus/seed/ca.crt - authorization: - type: Bearer - credentials_file: /var/run/secrets/gardener.cloud/shoot/token/token - relabel_configs: - - source_labels: [__meta_kubernetes_pod_label_upstream_host, __meta_kubernetes_pod_container_port_name] - action: keep - regex: (.+);debug - - action: labelmap - regex: __meta_kubernetes_pod_label_(.+) - - target_label: __address__ - action: replace - replacement: ` + v1beta1constants.DeploymentNameKubeAPIServer + `:` + strconv.Itoa(kubeapiserverconstants.Port) + ` - - source_labels: [__meta_kubernetes_pod_name, __meta_kubernetes_pod_container_port_number] - action: replace - target_label: __metrics_path__ - regex: (.+);(.+) - replacement: /api/v1/namespaces/kube-system/pods/${1}:${2}/proxy/metrics - metric_relabel_configs: - - source_labels: [ __name__ ] - regex: registry_proxy_.+ - action: keep -` - //go:embed alerting-rules/registry-cache.rules.yaml - monitoringAlertingRules string //go:embed monitoring/dashboard.json dashboard string ) -func (r *registryCaches) alertingRules() string { - return fmt.Sprintf("registry-cache.rules.yaml: |\n %s\n", utils.Indent(monitoringAlertingRules, 2)) -} - -func (r *registryCaches) dashboard() string { - return fmt.Sprintf("registry-cache.dashboard.json: '%s'", dashboard) -} - -func (r *registryCaches) scrapeConfig() string { - return scrapeConfigYAML -} - func (r *registryCaches) deployMonitoringConfig(ctx context.Context) error { - // TODO(dimitar-kostadinov): Delete this if-condition after August 2024. - if r.client.Get(ctx, client.ObjectKey{Name: "prometheus-shoot", Namespace: r.namespace}, &appsv1.StatefulSet{}) == nil { - if err := kutil.DeleteObject(ctx, r.client, &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "extension-registry-cache-monitoring", Namespace: r.namespace}}); err != nil { - return fmt.Errorf("failed deleting %s ConfigMap: %w", "extension-registry-cache-monitoring", err) - } - - configMapDashboards := &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "registry-cache-dashboards", Namespace: r.namespace}} - if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, configMapDashboards, func() error { - metav1.SetMetaDataLabel(&configMapDashboards.ObjectMeta, "component", "registry-cache") - metav1.SetMetaDataLabel(&configMapDashboards.ObjectMeta, "dashboard.monitoring.gardener.cloud/shoot", "true") - configMapDashboards.Data = map[string]string{"registry-cache.dashboard.json": dashboard} - return nil - }); err != nil { - return err - } + configMapDashboards := &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "registry-cache-dashboards", Namespace: r.namespace}} + if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, configMapDashboards, func() error { + metav1.SetMetaDataLabel(&configMapDashboards.ObjectMeta, "component", "registry-cache") + metav1.SetMetaDataLabel(&configMapDashboards.ObjectMeta, "dashboard.monitoring.gardener.cloud/shoot", "true") + configMapDashboards.Data = map[string]string{"registry-cache.dashboard.json": dashboard} + return nil + }); err != nil { + return err + } - prometheusRule := &monitoringv1.PrometheusRule{ObjectMeta: monitoringutils.ConfigObjectMeta("registry-cache", r.namespace, "shoot")} - if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, prometheusRule, func() error { - metav1.SetMetaDataLabel(&prometheusRule.ObjectMeta, "component", "registry-cache") - metav1.SetMetaDataLabel(&prometheusRule.ObjectMeta, "prometheus", "shoot") - prometheusRule.Spec = monitoringv1.PrometheusRuleSpec{ - Groups: []monitoringv1.RuleGroup{{ - Name: "registry-cache.rules", - Rules: []monitoringv1.Rule{ - { - Alert: "RegistryCachePersistentVolumeUsageCritical", - Expr: intstr.FromString(`100 * ( - kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - / - kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - ) < 5`), - For: ptr.To(monitoringv1.Duration("1h")), - Labels: map[string]string{ - "service": "registry-cache-extension", - "severity": "warning", - "type": "shoot", - "visibility": "owner", - }, - Annotations: map[string]string{ - "description": `The registry-cache PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} is only {{ printf "%0.2f" $value }}% free. When there is no available disk space, no new images will be cached. However, image pull operations are not affected.`, - "summary": "Registry cache PersistentVolume almost full.", - }, - }, - { - Alert: "RegistryCachePersistentVolumeFullInFourDays", - Expr: intstr.FromString(`100 * ( - kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - / - kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} - ) < 15 - and - predict_linear(kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"}[30m], 4 * 24 * 3600) <= 0`), - For: ptr.To(monitoringv1.Duration("1h")), - Labels: map[string]string{ - "service": "registry-cache-extension", - "severity": "warning", - "type": "shoot", - "visibility": "owner", - }, - Annotations: map[string]string{ - "description": `Based on recent sampling, the registry cache PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ printf "%0.2f" $value }}% is available.`, - "summary": "Registry cache PersistentVolume will be full in four days.", - }, - }, - // We rely on the implicit contract that recording rules in format "shoot:(.+):(.+)" will be - // automatically federated to the aggregate prometheus and then to the garden-prometheus. - // Ref https://github.com/gardener/gardener/blob/v1.90.0/pkg/component/observability/monitoring/prometheus/aggregate/servicemonitors.go#L45 - { - Record: "shoot:registry_proxy_pushed_bytes_total:sum", - Expr: intstr.FromString("sum by (upstream_host) (rate(registry_proxy_pushed_bytes_total[5m]))"), + prometheusRule := &monitoringv1.PrometheusRule{ObjectMeta: monitoringutils.ConfigObjectMeta("registry-cache", r.namespace, "shoot")} + if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, prometheusRule, func() error { + metav1.SetMetaDataLabel(&prometheusRule.ObjectMeta, "component", "registry-cache") + metav1.SetMetaDataLabel(&prometheusRule.ObjectMeta, "prometheus", "shoot") + prometheusRule.Spec = monitoringv1.PrometheusRuleSpec{ + Groups: []monitoringv1.RuleGroup{{ + Name: "registry-cache.rules", + Rules: []monitoringv1.Rule{ + { + Alert: "RegistryCachePersistentVolumeUsageCritical", + Expr: intstr.FromString(`100 * ( + kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} + / + kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} +) < 5`), + For: ptr.To(monitoringv1.Duration("1h")), + Labels: map[string]string{ + "service": "registry-cache-extension", + "severity": "warning", + "type": "shoot", + "visibility": "owner", }, - { - Record: "shoot:registry_proxy_pulled_bytes_total:sum", - Expr: intstr.FromString("sum by (upstream_host) (rate(registry_proxy_pulled_bytes_total[5m]))"), + Annotations: map[string]string{ + "description": `The registry-cache PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} is only {{ printf "%0.2f" $value }}% free. When there is no available disk space, no new images will be cached. However, image pull operations are not affected.`, + "summary": "Registry cache PersistentVolume almost full.", }, }, - }}, - } - return nil - }); err != nil { - return err - } - - scrapeConfig := &monitoringv1alpha1.ScrapeConfig{ObjectMeta: monitoringutils.ConfigObjectMeta("registry-cache", r.namespace, "shoot")} - if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, scrapeConfig, func() error { - metav1.SetMetaDataLabel(&scrapeConfig.ObjectMeta, "component", "registry-cache") - metav1.SetMetaDataLabel(&scrapeConfig.ObjectMeta, "prometheus", "shoot") - scrapeConfig.Spec = monitoringv1alpha1.ScrapeConfigSpec{ - HonorLabels: ptr.To(false), - ScrapeTimeout: ptr.To(monitoringv1.Duration("10s")), - Scheme: ptr.To("HTTPS"), - // This is needed because the kubelets' certificates are not are generated for a specific pod IP - TLSConfig: &monitoringv1.SafeTLSConfig{InsecureSkipVerify: ptr.To(true)}, - Authorization: &monitoringv1.SafeAuthorization{Credentials: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: "shoot-access-prometheus-shoot"}, - Key: "token", - }}, - KubernetesSDConfigs: []monitoringv1alpha1.KubernetesSDConfig{{ - APIServer: ptr.To("https://" + v1beta1constants.DeploymentNameKubeAPIServer + ":" + strconv.Itoa(kubeapiserverconstants.Port)), - Role: "endpoints", - Namespaces: &monitoringv1alpha1.NamespaceDiscovery{Names: []string{metav1.NamespaceSystem}}, - Authorization: &monitoringv1.SafeAuthorization{Credentials: &corev1.SecretKeySelector{ - LocalObjectReference: corev1.LocalObjectReference{Name: "shoot-access-prometheus-shoot"}, - Key: "token", - }}, - // This is needed because we do not fetch the correct cluster CA bundle right now - TLSConfig: &monitoringv1.SafeTLSConfig{InsecureSkipVerify: ptr.To(true)}, - FollowRedirects: ptr.To(true), - }}, - RelabelConfigs: []monitoringv1.RelabelConfig{ - { - Action: "replace", - Replacement: ptr.To("registry-cache-metrics"), - TargetLabel: "job", - }, { - SourceLabels: []monitoringv1.LabelName{"__meta_kubernetes_pod_label_upstream_host", "__meta_kubernetes_pod_container_port_name"}, - Action: "keep", - Regex: `(.+);debug`, - }, - { - Action: "labelmap", - Regex: `__meta_kubernetes_pod_label_(.+)`, + Alert: "RegistryCachePersistentVolumeFullInFourDays", + Expr: intstr.FromString(`100 * ( + kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} + / + kubelet_volume_stats_capacity_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"} +) < 15 +and +predict_linear(kubelet_volume_stats_available_bytes{persistentvolumeclaim=~"^cache-volume-registry-.+$"}[30m], 4 * 24 * 3600) <= 0`), + For: ptr.To(monitoringv1.Duration("1h")), + Labels: map[string]string{ + "service": "registry-cache-extension", + "severity": "warning", + "type": "shoot", + "visibility": "owner", + }, + Annotations: map[string]string{ + "description": `Based on recent sampling, the registry cache PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ printf "%0.2f" $value }}% is available.`, + "summary": "Registry cache PersistentVolume will be full in four days.", + }, }, + // We rely on the implicit contract that recording rules in format "shoot:(.+):(.+)" will be + // automatically federated to the aggregate prometheus and then to the garden-prometheus. + // Ref https://github.com/gardener/gardener/blob/v1.90.0/pkg/component/observability/monitoring/prometheus/aggregate/servicemonitors.go#L45 { - TargetLabel: "__address__", - Action: "replace", - Replacement: ptr.To(v1beta1constants.DeploymentNameKubeAPIServer + ":" + strconv.Itoa(kubeapiserverconstants.Port)), + Record: "shoot:registry_proxy_pushed_bytes_total:sum", + Expr: intstr.FromString("sum by (upstream_host) (rate(registry_proxy_pushed_bytes_total[5m]))"), }, { - SourceLabels: []monitoringv1.LabelName{"__meta_kubernetes_pod_name", "__meta_kubernetes_pod_container_port_number"}, - Action: "replace", - TargetLabel: "__metrics_path__", - Regex: `(.+);(.+)`, - Replacement: ptr.To("/api/v1/namespaces/kube-system/pods/${1}:${2}/proxy/metrics"), + Record: "shoot:registry_proxy_pulled_bytes_total:sum", + Expr: intstr.FromString("sum by (upstream_host) (rate(registry_proxy_pulled_bytes_total[5m]))"), }, }, - MetricRelabelConfigs: monitoringutils.StandardMetricRelabelConfig("registry_proxy_.+"), - } - return nil - }); err != nil { - return err + }}, } - return nil + }); err != nil { + return err } - // TODO(dimitar-kostadinov): Delete this, scrapeConfigYAML & monitoringAlertingRules vars and alerting-rules/registry-cache.rules.yaml file after August 2024. - monitoringConfigMap := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "extension-registry-cache-monitoring", - Namespace: r.namespace, - }, - } - _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, monitoringConfigMap, func() error { - metav1.SetMetaDataLabel(&monitoringConfigMap.ObjectMeta, v1beta1constants.LabelExtensionConfiguration, v1beta1constants.LabelMonitoring) - - monitoringConfigMap.Data = map[string]string{ - v1beta1constants.PrometheusConfigMapAlertingRules: r.alertingRules(), - v1beta1constants.PrometheusConfigMapScrapeConfig: r.scrapeConfig(), - v1beta1constants.PlutonoConfigMapOperatorDashboard: r.dashboard(), + scrapeConfig := &monitoringv1alpha1.ScrapeConfig{ObjectMeta: monitoringutils.ConfigObjectMeta("registry-cache", r.namespace, "shoot")} + if _, err := controllerutils.GetAndCreateOrMergePatch(ctx, r.client, scrapeConfig, func() error { + metav1.SetMetaDataLabel(&scrapeConfig.ObjectMeta, "component", "registry-cache") + metav1.SetMetaDataLabel(&scrapeConfig.ObjectMeta, "prometheus", "shoot") + scrapeConfig.Spec = monitoringv1alpha1.ScrapeConfigSpec{ + HonorLabels: ptr.To(false), + ScrapeTimeout: ptr.To(monitoringv1.Duration("10s")), + Scheme: ptr.To("HTTPS"), + // This is needed because the kubelets' certificates are not are generated for a specific pod IP + TLSConfig: &monitoringv1.SafeTLSConfig{InsecureSkipVerify: ptr.To(true)}, + Authorization: &monitoringv1.SafeAuthorization{Credentials: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: "shoot-access-prometheus-shoot"}, + Key: "token", + }}, + KubernetesSDConfigs: []monitoringv1alpha1.KubernetesSDConfig{{ + APIServer: ptr.To("https://" + v1beta1constants.DeploymentNameKubeAPIServer + ":" + strconv.Itoa(kubeapiserverconstants.Port)), + Role: "endpoints", + Namespaces: &monitoringv1alpha1.NamespaceDiscovery{Names: []string{metav1.NamespaceSystem}}, + Authorization: &monitoringv1.SafeAuthorization{Credentials: &corev1.SecretKeySelector{ + LocalObjectReference: corev1.LocalObjectReference{Name: "shoot-access-prometheus-shoot"}, + Key: "token", + }}, + // This is needed because we do not fetch the correct cluster CA bundle right now + TLSConfig: &monitoringv1.SafeTLSConfig{InsecureSkipVerify: ptr.To(true)}, + FollowRedirects: ptr.To(true), + }}, + RelabelConfigs: []monitoringv1.RelabelConfig{ + { + Action: "replace", + Replacement: ptr.To("registry-cache-metrics"), + TargetLabel: "job", + }, + { + SourceLabels: []monitoringv1.LabelName{"__meta_kubernetes_pod_label_upstream_host", "__meta_kubernetes_pod_container_port_name"}, + Action: "keep", + Regex: `(.+);debug`, + }, + { + Action: "labelmap", + Regex: `__meta_kubernetes_pod_label_(.+)`, + }, + { + TargetLabel: "__address__", + Action: "replace", + Replacement: ptr.To(v1beta1constants.DeploymentNameKubeAPIServer + ":" + strconv.Itoa(kubeapiserverconstants.Port)), + }, + { + SourceLabels: []monitoringv1.LabelName{"__meta_kubernetes_pod_name", "__meta_kubernetes_pod_container_port_number"}, + Action: "replace", + TargetLabel: "__metrics_path__", + Regex: `(.+);(.+)`, + Replacement: ptr.To("/api/v1/namespaces/kube-system/pods/${1}:${2}/proxy/metrics"), + }, + }, + MetricRelabelConfigs: monitoringutils.StandardMetricRelabelConfig("registry_proxy_.+"), } - return nil - }) + }); err != nil { + return err + } - return err + return nil } diff --git a/pkg/component/registrycaches/registry_caches_test.go b/pkg/component/registrycaches/registry_caches_test.go index 91deeeb5..ff71a01a 100644 --- a/pkg/component/registrycaches/registry_caches_test.go +++ b/pkg/component/registrycaches/registry_caches_test.go @@ -22,7 +22,6 @@ import ( . "github.com/onsi/gomega" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" monitoringv1alpha1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1alpha1" - appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -515,79 +514,50 @@ status: {} }) }) - // TODO(dimitar-kostadinov) delete this after August 2024. - It("should deploy a monitoring ConfigMap", func() { + It("should deploy a monitoring objects", func() { Expect(registryCaches.Deploy(ctx)).To(Succeed()) - monitoringConfigMap := &corev1.ConfigMap{ + configMapDashboards := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ - Name: "extension-registry-cache-monitoring", + Name: "registry-cache-dashboards", Namespace: namespace, }, } - Expect(c.Get(ctx, client.ObjectKeyFromObject(monitoringConfigMap), monitoringConfigMap)).To(Succeed()) - Expect(monitoringConfigMap.Labels).To(HaveKeyWithValue("extensions.gardener.cloud/configuration", "monitoring")) - Expect(monitoringConfigMap.Data).To(HaveKey("alerting_rules")) - Expect(monitoringConfigMap.Data).To(HaveKey("scrape_config")) - }) - - // TODO(dimitar-kostadinov) remove 'When' condition after August 2024. - When("prometheus-shoot statefulset set exist", func() { - BeforeEach(func() { - prometheusShoot := &appsv1.StatefulSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "prometheus-shoot", - Namespace: namespace, - }, - } - Expect(c.Create(ctx, prometheusShoot)).To(Succeed()) - }) + Expect(c.Get(ctx, client.ObjectKeyFromObject(configMapDashboards), configMapDashboards)).To(Succeed()) + Expect(configMapDashboards.Labels).To(HaveKeyWithValue("dashboard.monitoring.gardener.cloud/shoot", "true")) + Expect(configMapDashboards.Labels).To(HaveKeyWithValue("component", "registry-cache")) + Expect(configMapDashboards.Data).To(HaveKey("registry-cache.dashboard.json")) - It("should deploy a monitoring objects", func() { - Expect(registryCaches.Deploy(ctx)).To(Succeed()) - - configMapDashboards := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: "registry-cache-dashboards", - Namespace: namespace, - }, - } - Expect(c.Get(ctx, client.ObjectKeyFromObject(configMapDashboards), configMapDashboards)).To(Succeed()) - Expect(configMapDashboards.Labels).To(HaveKeyWithValue("dashboard.monitoring.gardener.cloud/shoot", "true")) - Expect(configMapDashboards.Labels).To(HaveKeyWithValue("component", "registry-cache")) - Expect(configMapDashboards.Data).To(HaveKey("registry-cache.dashboard.json")) - - prometheusRule := &monitoringv1.PrometheusRule{ - ObjectMeta: metav1.ObjectMeta{ - Name: "shoot-registry-cache", - Namespace: namespace, - }, - } - Expect(c.Get(ctx, client.ObjectKeyFromObject(prometheusRule), prometheusRule)).To(Succeed()) - Expect(prometheusRule.Labels).To(HaveKeyWithValue("prometheus", "shoot")) - Expect(prometheusRule.Labels).To(HaveKeyWithValue("component", "registry-cache")) - Expect(prometheusRule.Spec.Groups[0].Name).To(Equal("registry-cache.rules")) - Expect(prometheusRule.Spec.Groups[0].Rules).To(HaveLen(4)) - Expect(prometheusRule.Spec.Groups[0].Rules[0].Alert).To(Equal("RegistryCachePersistentVolumeUsageCritical")) - Expect(prometheusRule.Spec.Groups[0].Rules[1].Alert).To(Equal("RegistryCachePersistentVolumeFullInFourDays")) - Expect(prometheusRule.Spec.Groups[0].Rules[2].Record).To(Equal("shoot:registry_proxy_pushed_bytes_total:sum")) - Expect(prometheusRule.Spec.Groups[0].Rules[3].Record).To(Equal("shoot:registry_proxy_pulled_bytes_total:sum")) - - scrapeConfig := &monitoringv1alpha1.ScrapeConfig{ - ObjectMeta: metav1.ObjectMeta{ - Name: "shoot-registry-cache", - Namespace: namespace, - }, - } - Expect(c.Get(ctx, client.ObjectKeyFromObject(scrapeConfig), scrapeConfig)).To(Succeed()) - Expect(scrapeConfig.Labels).To(HaveKeyWithValue("prometheus", "shoot")) - Expect(scrapeConfig.Labels).To(HaveKeyWithValue("component", "registry-cache")) - Expect(scrapeConfig.Spec.Authorization.Credentials.LocalObjectReference.Name).To(Equal("shoot-access-prometheus-shoot")) - Expect(scrapeConfig.Spec.KubernetesSDConfigs[0].APIServer).To(Equal(ptr.To("https://kube-apiserver:443"))) - Expect(scrapeConfig.Spec.RelabelConfigs).To(HaveLen(5)) - Expect(scrapeConfig.Spec.MetricRelabelConfigs).To(HaveLen(1)) - Expect(scrapeConfig.Spec.MetricRelabelConfigs[0].Regex).To(Equal("^(registry_proxy_.+)$")) - }) + prometheusRule := &monitoringv1.PrometheusRule{ + ObjectMeta: metav1.ObjectMeta{ + Name: "shoot-registry-cache", + Namespace: namespace, + }, + } + Expect(c.Get(ctx, client.ObjectKeyFromObject(prometheusRule), prometheusRule)).To(Succeed()) + Expect(prometheusRule.Labels).To(HaveKeyWithValue("prometheus", "shoot")) + Expect(prometheusRule.Labels).To(HaveKeyWithValue("component", "registry-cache")) + Expect(prometheusRule.Spec.Groups[0].Name).To(Equal("registry-cache.rules")) + Expect(prometheusRule.Spec.Groups[0].Rules).To(HaveLen(4)) + Expect(prometheusRule.Spec.Groups[0].Rules[0].Alert).To(Equal("RegistryCachePersistentVolumeUsageCritical")) + Expect(prometheusRule.Spec.Groups[0].Rules[1].Alert).To(Equal("RegistryCachePersistentVolumeFullInFourDays")) + Expect(prometheusRule.Spec.Groups[0].Rules[2].Record).To(Equal("shoot:registry_proxy_pushed_bytes_total:sum")) + Expect(prometheusRule.Spec.Groups[0].Rules[3].Record).To(Equal("shoot:registry_proxy_pulled_bytes_total:sum")) + + scrapeConfig := &monitoringv1alpha1.ScrapeConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "shoot-registry-cache", + Namespace: namespace, + }, + } + Expect(c.Get(ctx, client.ObjectKeyFromObject(scrapeConfig), scrapeConfig)).To(Succeed()) + Expect(scrapeConfig.Labels).To(HaveKeyWithValue("prometheus", "shoot")) + Expect(scrapeConfig.Labels).To(HaveKeyWithValue("component", "registry-cache")) + Expect(scrapeConfig.Spec.Authorization.Credentials.LocalObjectReference.Name).To(Equal("shoot-access-prometheus-shoot")) + Expect(scrapeConfig.Spec.KubernetesSDConfigs[0].APIServer).To(Equal(ptr.To("https://kube-apiserver:443"))) + Expect(scrapeConfig.Spec.RelabelConfigs).To(HaveLen(5)) + Expect(scrapeConfig.Spec.MetricRelabelConfigs).To(HaveLen(1)) + Expect(scrapeConfig.Spec.MetricRelabelConfigs[0].Regex).To(Equal("^(registry_proxy_.+)$")) }) }) diff --git a/skaffold.yaml b/skaffold.yaml index fda09e67..05f6dd30 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -25,7 +25,6 @@ build: - pkg/apis/registry/v1alpha3 - pkg/cmd - pkg/component/registrycaches - - pkg/component/registrycaches/alerting-rules/registry-cache.rules.yaml - pkg/component/registrycaches/monitoring/dashboard.json - pkg/component/registrycaches/templates/config.yml.tpl - pkg/constants