Skip to content

CFP: Cilium ServiceMonitor objects gets created without 'relabelings.action' in the relabelings stanza #30755

@kdandersen

Description

@kdandersen

Cilium Feature Proposal

Don't know for sure if this a bug or a feature requset...

We have discovered the following issue when deploying Cilium in collaboration with ArgoCD as deployment engine for the Helm chart.

When enabling ServiceMonitor objects to be discovered via Prometheus Operator the ServiceMonitor object relabelling defininition gets created like this:

...
spec:
  selector:
    matchLabels:
      k8s-app: cilium
  namespaceSelector:
    matchNames:
    - kube-system
  endpoints:
  - port: metrics
    interval: "10s"
    honorLabels: true
    path: /metrics
    relabelings:
    - replacement: ${1}
      sourceLabels:
      - __meta_kubernetes_pod_node_name
      targetLabel: node
  targetLabels:
  - k8s-app

This gets modified by the Prometheus Operator admission webhook to the following format (adding action: replace):

...
spec:
  selector:
    matchLabels:
      k8s-app: cilium
  namespaceSelector:
    matchNames:
    - pl-cilium
  endpoints:
  - port: metrics
    interval: 10s
    honorLabels: true
    path: /metrics
    relabelings:
    - replacement: ${1}
      action: replace
      sourceLabels:
      - __meta_kubernetes_pod_node_name
      targetLabel: node
  targetLabels:
  - k8s-app

This again results in ArgoCD detecting drift and reconciling the ServiceMonitor back to its original spec. without the action: replace section. Resulting in an eternal OutOfSynch reconciliation loop.

For now we will try to solve this via ArgoCD ignoreDifferences configuration. But we would like/propose the Cilium ServiceMonitor objects to include the action: replace in a future release.

Kind regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/agentCilium agent related.area/helmImpacts helm charts and user deployment experiencearea/metricsImpacts statistics / metrics gathering, eg via Prometheus.kind/featureThis introduces new functionality.staleThe stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions