argocd-metrics-server

by christianhuth

Helm chartv1.2.1App v1.1.1Verified publisher

A Helm chart for installing the Argo CD Metrics Server, which connects to Prometheus and can be used to display Metrics in the Argo CD UI

About this chart

argocd-metrics-server

A Helm chart for installing the Argo CD Metrics Server, which connects to Prometheus and can be used to display Metrics in the Argo CD UI

TL;DR;

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/argocd-metrics-server

Or install it from the OCI registry:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/argocd-metrics-server

Introduction

This chart bootstraps the ArgoCD Metrics Server on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.19+
  • Argo CD version 2.6+
  • Prometheus

Installing the Chart

To install the chart with the release name my-release:

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/argocd-metrics-server

The chart is also published as an OCI artifact which can be installed like this:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/argocd-metrics-server

These commands deploy the ArgoCD Metrics Server on the Kubernetes cluster in the default configuration. The Values section lists the values that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall the my-release deployment:

helm uninstall my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity settings for pod assignment
deploymentStrategyobject{}Update strategy for the deployment
extraEnvlist[]additional environment variables to be added to the pods
fullnameOverridestring""String to fully override "argocd-extension-metrics.fullname"
image.pullPolicystring"Always"image pull policy
image.registrystring"quay.io"image registory
image.repositorystring"argoprojlabs/argocd-extension-metrics"image repository
image.tagstring"v1.1.1"Overrides the image tag
imagePullSecretslist[]If defined, uses a Secret to pull an image from a private Docker registry or repository.
nameOverridestring""Provide a name in place of argocd-extension-metrics
networkPolicy.additionalAnnotationsobject{}Annotations to be added to the NetworkPolicies
networkPolicy.additionalLabelsobject{}Labels to be added to the NetworkPolicies
networkPolicy.argocd.enabledbooltrue- allow incoming traffic from Argo CD
networkPolicy.argocd.namespaceSelectorobject{}The labels of the namespace where Argo CD is running
networkPolicy.argocd.podSelectorobject{}The labels of the Argo CD Pods
networkPolicy.dns.enabledbooltrueallow outgoing traffic to the Kubernetes DNS
networkPolicy.dns.namespaceSelectorobject{"kubernetes.io/metadata.name":"kube-system"}The labels of the namespace where the Kubernetes DNS is running
networkPolicy.dns.podSelectorobject{"k8s-app":"kube-dns"}The labels of the Kubernetes DNS Pods
networkPolicy.enabledboolfalse- create a NetworkPolicy resource to limit the allowed traffic
networkPolicy.prometheus.enabledbooltrue- allow outgoing traffic to Prometheus
networkPolicy.prometheus.podSelectorobject{"app.kubernetes.io/name":"prometheus"}The labels of the Prometheus Pods
nodeSelectorobject{}Node labels for pod assignment
podSecurityContextobject{}pod-level security context
prometheus.dashboardsstringsee values.yamlThe dashboards that will be displayed in the Argo CD UI
prometheus.namespacestring"monitoring"The namespace where Prometheus is running
prometheus.pathstring""The path of the Prometheus
prometheus.portint9090The port on which the Prometheus service is listening for traffic
prometheus.servicestring"prometheus-operated"The name of the Prometheus service
replicaCountint1Number of replicas
resourcesobject{"requests":{"cpu":"100m","memory":"100Mi"}}Resource limits and requests for the controller pods.
revisionHistoryLimitint0The number of old ReplicaSets to retain
securityContextobject{}container-level security context
service.portint9003Kubernetes port where service is exposed
service.typestring"ClusterIP"Kubernetes service type
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
tolerationslist[]Toleration labels for pod assignment

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

helm install my-release -f values.yaml christianhuth/argocd-metrics-server

Configuring Argo CD

After a successful installation of the Argo CD Metrics Server you need to configure Argo CD to display Metrics in the UI.

Assuming you are using the official Argo CD Helm Chart, this can be achieved with the following values:

configs:
  # this part configures the UI extension to use the Argo CD Metrics Server
  # make sure to adjust the URL to your installation
  cm:
    extension.config: |-
      extensions:
        - name: metrics
          backend:
            services:
              - url: http://argocd-metrics-server.argo.svc:9003
  # this part enables the proxy extension feature of Argo CD
  params:
    server.enable.proxy.extension: true
  # this part authorizes users to use the Metrics extension
  rbac:
    policy.csv: |
      p, role:readonly, extensions, invoke, metrics, allow
server:
  # this part downloads the UI extension and integrates it into the Argo CD UI
  extensions:
    enabled: true
    extensionList:
      - name: extension-metrics
        env:
          - name: EXTENSION_URL
            value: https://github.com/argoproj-labs/argocd-extension-metrics/releases/download/v1.0.3/extension.tar.gz
          - name: EXTENSION_CHECKSUM_URL
            value: https://github.com/argoproj-labs/argocd-extension-metrics/releases/download/v1.0.3/extension_checksums.txt

Deploy argocd-metrics-server with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has argocd-metrics-server on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartargocd-metrics-server is pinned at v1.2.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply