Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2: Allow overriding Alloy modules configmaps name prefix #995

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

splichy
Copy link

@splichy splichy commented Dec 12, 2024

fix for #994

Using .Values.global was the simplest way to pass fullnameOverride to both umbrella & child charts.

With:

clusterMetrics:
  enabled: true
  kepler:
    fullnameOverride: kepler
  opencost:
    fullnameOverride: opencost
podLogs:
  enabled: true
nodeLogs:
  enabled: true
clusterEvents:
  enabled: true

alloy-metrics:
  fullnameOverride: alloy-metrics
  enabled: true
alloy-logs:
  fullnameOverride: alloy-logs
  enabled: true
alloy-singleton:
  fullnameOverride: alloy-singleton
  enabled: true

configmap name will be like: very-long-release-name-alloy-module-kubernetes

adding:

global:
fullnameOverride: k8s-monitoring

will render configmap name as k8s-monitoring-alloy-module-kubernetes:

---
# Source: k8s-monitoring/charts/k8s-monitoring/templates/alloy-modules-configmaps.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: k8s-monitoring-alloy-module-kubernetes
// ...REMOVED FOR CLARITY

including its reference in resulting configmap data:

---
# Source: k8s-monitoring/charts/k8s-monitoring/templates/alloy-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: alloy-metrics
  namespace: monitoring
data:
  config.alloy: |-
    // Destination: prometheus (prometheus)
// ...REMOVED FOR CLARITY
    // Feature: Cluster Metrics
    declare "cluster_metrics" {
      argument "metrics_destinations" {
        comment = "Must be a list of metric destinations where collected metrics should be forwarded to"
      }
      
      remote.kubernetes.configmap "kubernetes" {
        name = "k8s-monitoring-alloy-module-kubernetes"
        namespace = "monitoring"
      }
// ...REMOVED FOR CLARITY

@splichy splichy requested review from a team and petewall as code owners December 12, 2024 11:22
@CLAassistant
Copy link

CLAassistant commented Dec 12, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants