feat: pre-release correctures (#1682)

* chore(metrics): cleanup emitted metrics

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* chore(ci): bump kind 1.34

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* feat(chart): specific crd names for job rbac

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

---------

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
Oliver Bähler
2025-10-06 19:21:01 +02:00
committed by GitHub
parent 5ac0f83c5a
commit 14e09ead3c
7 changed files with 17 additions and 35 deletions

View File

@@ -19,7 +19,7 @@ CAPSULE_IMG ?= $(REGISTRY)/$(IMG_BASE)
CLUSTER_NAME ?= capsule
## Kubernetes Version Support
KUBERNETES_SUPPORTED_VERSION ?= "v1.33.0"
KUBERNETES_SUPPORTED_VERSION ?= "v1.34.0"
## Tool Binaries
KUBECTL ?= kubectl

View File

@@ -135,7 +135,7 @@ The following Values have changed key or Value:
| monitoring.dashboards.labels | object | `{}` | Labels for dashboard configmaps |
| monitoring.dashboards.namespace | string | `""` | Custom namespace for dashboard configmaps |
| monitoring.dashboards.operator.allowCrossNamespaceImport | bool | `true` | Allow the Operator to match this resource with Grafanas outside the current namespace |
| monitoring.dashboards.operator.enabled | bool | `true` | Enable Operator Resources (GrafanaDashboard) |
| monitoring.dashboards.operator.enabled | bool | `false` | Enable Operator Resources (GrafanaDashboard) |
| monitoring.dashboards.operator.folder | string | `""` | folder assignment for dashboard |
| monitoring.dashboards.operator.instanceSelector | object | `{}` | Selects Grafana instances for import |
| monitoring.dashboards.operator.resyncPeriod | string | `"10m"` | How often the resource is synced, defaults to 10m0s if not set |

View File

@@ -24,7 +24,6 @@ spec:
ignoreUserWithGroups:
{{- toYaml .Values.manager.options.ignoreUserWithGroups | nindent 4 }}
protectedNamespaceRegex: {{ .Values.manager.options.protectedNamespaceRegex | quote }}
defaultRegistry: {{ .Values.manager.options.defaultRegistry }}
{{- with .Values.manager.options.nodeMetadata }}
nodeMetadata:
{{- toYaml . | nindent 4 }}

View File

@@ -23,11 +23,19 @@ rules:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
resourceNames:
- capsuleconfigurations.capsule.clastix.io
- resourcepoolclaims.capsule.clastix.io
- resourcepools.capsule.clastix.io
- tenantresources.capsule.clastix.io
- globaltenantresources.capsule.clastix.io
- tenants.capsule.clastix.io
verbs:
- create
- delete
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding

View File

@@ -314,7 +314,7 @@ monitoring:
# Grafana Operator
operator:
# -- Enable Operator Resources (GrafanaDashboard)
enabled: true
enabled: false
# -- Allow the Operator to match this resource with Grafanas outside the current namespace
allowCrossNamespaceImport: true
# -- How often the resource is synced, defaults to 10m0s if not set

View File

@@ -12,8 +12,6 @@ import (
// Exposing Status Metrics for tenant.
func (r *Manager) syncTenantStatusMetrics(tenant *capsulev1beta2.Tenant) {
var cordoned float64 = 0
// Expose namespace-tenant relationship
for _, ns := range tenant.Status.Namespaces {
r.Metrics.TenantNamespaceRelationshipGauge.WithLabelValues(tenant.GetName(), ns).Set(1)
@@ -22,10 +20,6 @@ func (r *Manager) syncTenantStatusMetrics(tenant *capsulev1beta2.Tenant) {
// Expose cordoned status
r.Metrics.TenantNamespaceCounterGauge.WithLabelValues(tenant.Name).Set(float64(tenant.Status.Size))
if tenant.Spec.Cordoned {
cordoned = 1
}
// Expose Status Metrics
for _, status := range []string{meta.ReadyCondition, meta.CordonedCondition} {
var value float64
@@ -43,13 +37,6 @@ func (r *Manager) syncTenantStatusMetrics(tenant *capsulev1beta2.Tenant) {
r.Metrics.TenantConditionGauge.WithLabelValues(tenant.GetName(), status).Set(value)
}
// Expose the namespace counter (Deprecated)
if tenant.Spec.Cordoned {
cordoned = 1
}
r.Metrics.TenantCordonedStatusGauge.WithLabelValues(tenant.Name).Set(cordoned)
}
// Exposing Status Metrics for tenant.

View File

@@ -12,7 +12,6 @@ type TenantRecorder struct {
TenantNamespaceRelationshipGauge *prometheus.GaugeVec
TenantNamespaceConditionGauge *prometheus.GaugeVec
TenantConditionGauge *prometheus.GaugeVec
TenantCordonedStatusGauge *prometheus.GaugeVec
TenantNamespaceCounterGauge *prometheus.GaugeVec
TenantResourceUsageGauge *prometheus.GaugeVec
TenantResourceLimitGauge *prometheus.GaugeVec
@@ -32,14 +31,14 @@ func NewTenantRecorder() *TenantRecorder {
Namespace: metricsPrefix,
Name: "tenant_namespace_relationship",
Help: "Mapping metric showing namespace to tenant relationships",
}, []string{"tenant", "namespace"},
}, []string{"tenant", "target_namespace"},
),
TenantNamespaceConditionGauge: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: metricsPrefix,
Name: "tenant_namespace_condition",
Help: "Provides per namespace within a tenant condition status for each condition",
}, []string{"tenant", "namespace", "condition"},
}, []string{"tenant", "target_namespace", "condition"},
),
TenantConditionGauge: prometheus.NewGaugeVec(
@@ -49,13 +48,6 @@ func NewTenantRecorder() *TenantRecorder {
Help: "Provides per tenant condition status for each condition",
}, []string{"tenant", "condition"},
),
TenantCordonedStatusGauge: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: metricsPrefix,
Name: "tenant_status",
Help: "DEPRECATED: Tenant cordon state indicating if tenant operations are restricted (1) or allowed (0) for resource creation and modification",
}, []string{"tenant"},
),
TenantNamespaceCounterGauge: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: metricsPrefix,
@@ -85,7 +77,6 @@ func (r *TenantRecorder) Collectors() []prometheus.Collector {
r.TenantNamespaceRelationshipGauge,
r.TenantNamespaceConditionGauge,
r.TenantConditionGauge,
r.TenantCordonedStatusGauge,
r.TenantNamespaceCounterGauge,
r.TenantResourceUsageGauge,
r.TenantResourceLimitGauge,
@@ -100,20 +91,20 @@ func (r *TenantRecorder) DeleteAllMetricsForNamespace(namespace string) {
// DeleteCondition deletes the condition metrics for the ref.
func (r *TenantRecorder) DeleteNamespaceRelationshipMetrics(namespace string) {
r.TenantNamespaceRelationshipGauge.DeletePartialMatch(map[string]string{
"namespace": namespace,
"target_namespace": namespace,
})
}
func (r *TenantRecorder) DeleteTenantNamespaceConditionMetrics(namespace string) {
r.TenantNamespaceConditionGauge.DeletePartialMatch(map[string]string{
"namespace": namespace,
"target_namespace": namespace,
})
}
func (r *TenantRecorder) DeleteTenantNamespaceConditionMetricByType(namespace string, condition string) {
r.TenantNamespaceConditionGauge.DeletePartialMatch(map[string]string{
"namespace": namespace,
"condition": condition,
"target_namespace": namespace,
"condition": condition,
})
}
@@ -152,9 +143,6 @@ func (r *TenantRecorder) DeleteTenantStatusMetrics(tenant string) {
r.TenantNamespaceCounterGauge.DeletePartialMatch(map[string]string{
"tenant": tenant,
})
r.TenantCordonedStatusGauge.DeletePartialMatch(map[string]string{
"tenant": tenant,
})
r.TenantNamespaceRelationshipGauge.DeletePartialMatch(map[string]string{
"tenant": tenant,
})