GithubHelp home page GithubHelp logo

Comments (8)

mblaschke avatar mblaschke commented on June 15, 2024 2

23.6.0 released with workload identity support

from azure-resourcemanager-exporter.

mblaschke avatar mblaschke commented on June 15, 2024

working on a new release

from azure-resourcemanager-exporter.

mblaschke avatar mblaschke commented on June 15, 2024

please try webdevops/azure-resourcemanager-exporter:main

from azure-resourcemanager-exporter.

mickeder avatar mickeder commented on June 15, 2024

Thanks a lot @mblaschke, it works like a charm. Patiently waiting for the official release.

One thing worth noting is that with Managed Identity on AKS cluster, the first scrape could fail (all subsequent scrapes are fine) with below error log (IMDS token request timed out):

2022-09-28T10:46:59.165161333Z {"file":"/go/src/github.com/webdevops/azure-resourcemanager-exporter/main.go:65","func":"main.main","level":"info","msg":"starting http server on 0.0.0.0:8080"}

2022-09-28T10:46:59.165165633Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:172","func":"collector.(*Collector).collectionStart","level":"info","msg":"starting metrics collection"}
2022-09-28T10:47:00.156569240Z {"collector":"GraphApps","file":"/go/src/github.com/webdevops/azure-resourcemanager-exporter/metrics_graph_apps.go:69","func":"main.(*MetricsCollectorGraphApps).Collect","level":"panic","msg":"DefaultAzureCredential: failed to acquire a token.\nAttempted credentials:\n\tEnvironmentCredential: missing environment variable AZURE_TENANT_ID\n\tManagedIdentityCredential: IMDS token request timed out\n\tAzureCLICredential: fork/exec /bin/sh: no such file or directory"}
2022-09-28T10:47:00.156619941Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:130","func":"collector.(*Collector).collect.func1.1","level":"error","msg":"panic occurred (panic threshold 1 of 5): DefaultAzureCredential: failed to acquire a token.\nAttempted credentials:\n\tEnvironmentCredential: missing environment variable AZURE_TENANT_ID\n\tManagedIdentityCredential: IMDS token request timed out\n\tAzureCLICredential: fork/exec /bin/sh: no such file or directory"}
2022-09-28T10:47:00.156635241Z {"collector":"GraphApps","duration":1.000991064,"file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:182","func":"collector.(*Collector).collectionFinish","level":"info","msg":"finished metrics collection"}

2022-09-28T10:49:00.157199560Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:172","func":"collector.(*Collector).collectionStart","level":"info","msg":"starting metrics collection"}
2022-09-28T10:49:00.511749569Z {"collector":"GraphApps","duration":0.35457381,"file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:182","func":"collector.(*Collector).collectionFinish","level":"info","msg":"finished metrics collection"}

2022-09-28T10:51:00.512476397Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:172","func":"collector.(*Collector).collectionStart","level":"info","msg":"starting metrics collection"}
2022-09-28T10:51:00.656298987Z {"collector":"GraphApps","duration":0.144378199,"file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:182","func":"collector.(*Collector).collectionFinish","level":"info","msg":"finished metrics collection"}

It can be avoided by adding to the pod an initContainer with a delay (e.g. 5 seconds).
(see Azure/aad-pod-identity#992)

2022-09-28T10:52:40.455113835Z {"file":"/go/src/github.com/webdevops/azure-resourcemanager-exporter/main.go:65","func":"main.main","level":"info","msg":"starting http server on 0.0.0.0:8080"}

2022-09-28T10:52:40.455285945Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:172","func":"collector.(*Collector).collectionStart","level":"info","msg":"starting metrics collection"}
2022-09-28T10:52:40.669964387Z {"collector":"GraphApps","duration":0.214674741,"file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:182","func":"collector.(*Collector).collectionFinish","level":"info","msg":"finished metrics collection"}

2022-09-28T10:54:40.670674096Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:172","func":"collector.(*Collector).collectionStart","level":"info","msg":"starting metrics collection"}
2022-09-28T10:54:40.802757687Z {"collector":"GraphApps","duration":0.13204079,"file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:182","func":"collector.(*Collector).collectionFinish","level":"info","msg":"finished metrics collection"}

2022-09-28T10:56:40.803182200Z {"collector":"GraphApps","file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:172","func":"collector.(*Collector).collectionStart","level":"info","msg":"starting metrics collection"}
2022-09-28T10:56:40.936933704Z {"collector":"GraphApps","duration":0.134056515,"file":"/go/pkg/mod/github.com/webdevops/[email protected]/prometheus/collector/collector.go:182","func":"collector.(*Collector).collectionFinish","level":"info","msg":"finished metrics collection"}

from azure-resourcemanager-exporter.

mblaschke avatar mblaschke commented on June 15, 2024

are you using aad-pod-identity or azure workload identity?

from azure-resourcemanager-exporter.

mickeder avatar mickeder commented on June 15, 2024

aad-pod-identity 1.8.5 deployed using helm chart 4.1.6

from azure-resourcemanager-exporter.

megakid avatar megakid commented on June 15, 2024

What configuration did you use here? I've successfully configured azure workload identity for other pods but I cannot get this one working.

EDIT: got it working.

For the sake of others, here's my values file for the helm chart that made this work (you have to have setup your workload identity etc first) - this is for use in by terraform templatefile function.

image:
  # See https://github.com/webdevops/azure-resourcemanager-exporter/issues/18
  tag: main

secrets:
  AZURE_SUBSCRIPTION_ID: "${join(" ", subscription_ids)}"

serviceAccount:
  name: "${service_account_name}"
  labels:
    azure.workload.identity/use: "true"
  annotations:
    azure.workload.identity/client-id: "${client_id}"
    azure.workload.identity/tenant-id: "${tenant_id}"
    azure.workload.identity/service-account-token-expiration: "86400"

podLabels:
  azure.workload.identity/use: "true"

from azure-resourcemanager-exporter.

mblaschke avatar mblaschke commented on June 15, 2024

@megakid
tag :23.3.0-beta1 should give you workload identity support but keep in mind that this part of the azure-sdk-for-go is still in beta and they won't release it until AKS workload identity support is GA.

from azure-resourcemanager-exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.