Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Make KUBECONFIG a template variable that is interpolated in templates (config map, cli, env)  #230

@razvan

Description

@razvan

Problem

Prometheus requires the kube configuration file to be present for service discovery with Kubernetes. The only process who has access to this file on the nodes is the agent. It cannot be set by the operators.

Proposed solution

Make KUBECONFIG a variable known by the agent similarly to {{packageroot}} or {{configroot}}. Allow operators to use this variable in templates and replace it with the appropriate path.

Example

The monitoring operator creates a configmap with the fils prometheus.yaml. Therein the k8s service discovery is configured like this snipped shows:

    kubernetes_sd_configs:
      - role: pod
        kubeconfig_file: {{KUBECONFIG}} 
        namespaces:
          names:
            - {}
        selectors:
          - role: pod

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions