From cb5ffc16d8085e2bb4b7dccb4b726be2e8327525 Mon Sep 17 00:00:00 2001 From: Hermes Agent service account Date: Fri, 19 Jun 2026 17:48:20 -0500 Subject: [PATCH] Add Pure FlashArray OpenMetrics exporter to monitoring namespace - Deploy purestorage/pure-fa-om-exporter:v1.0.27 container - Configure API token secret for utilidor FlashArray (jarvis user) - Expose /metrics endpoint via ClusterIP service on port 9490 - ServiceMonitor for kube-prometheus-stack auto-discovery - ArgoCD application for GitOps deployment (wave 3) - Scrape interval: 60s (storage metrics low frequency) - Resource limits: 200m CPU / 128Mi memory Provides pure_* metrics namespace for FlashArray capacity, performance, volume stats, host connectivity, etc. --- .../platform/pure-exporter/application.yaml | 44 +++++++++ .../platform/pure-exporter/deployment.yaml | 90 +++++++++++++++++++ cluster/platform/pure-exporter/secret.yaml | 26 ++++++ cluster/platform/pure-exporter/service.yaml | 23 +++++ .../pure-exporter/servicemonitor.yaml | 47 ++++++++++ 5 files changed, 230 insertions(+) create mode 100644 cluster/platform/pure-exporter/application.yaml create mode 100644 cluster/platform/pure-exporter/deployment.yaml create mode 100644 cluster/platform/pure-exporter/secret.yaml create mode 100644 cluster/platform/pure-exporter/service.yaml create mode 100644 cluster/platform/pure-exporter/servicemonitor.yaml diff --git a/cluster/platform/pure-exporter/application.yaml b/cluster/platform/pure-exporter/application.yaml new file mode 100644 index 0000000..ce7d4fa --- /dev/null +++ b/cluster/platform/pure-exporter/application.yaml @@ -0,0 +1,44 @@ +# ------------------------------------------------------------------------------ +# Platform: pure-exporter +# Wave 3 — monitoring infrastructure, depends on kube-prometheus-stack +# +# Pure Storage FlashArray OpenMetrics Exporter +# Provides FlashArray telemetry (capacity, performance, volumes, hosts) to Prometheus +# +# Installation flow: +# 1. Secret with FlashArray API token created +# 2. Deployment spins up exporter container +# 3. Service exposes /metrics endpoint +# 4. ServiceMonitor registers with Prometheus Operator +# 5. Prometheus begins scraping pure_* metrics +# +# Prerequisites: +# - kube-prometheus-stack deployed in monitoring namespace (wave 2) +# - FlashArray API token for jarvis readonly user +# - Network connectivity to utilidor.local.mk-labs.cloud:443 +# ------------------------------------------------------------------------------ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: pure-exporter + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "3" +spec: + project: default + source: + repoURL: https://gitea.mk-labs.cloud/rblundon/homelab.git + targetRevision: main + path: cluster/platform/pure-exporter + directory: + exclude: "application.yaml" + destination: + server: https://kubernetes.default.svc + namespace: monitoring + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=false # monitoring namespace already exists + - ServerSideApply=true diff --git a/cluster/platform/pure-exporter/deployment.yaml b/cluster/platform/pure-exporter/deployment.yaml new file mode 100644 index 0000000..75ff68a --- /dev/null +++ b/cluster/platform/pure-exporter/deployment.yaml @@ -0,0 +1,90 @@ +# ------------------------------------------------------------------------------ +# Pure FlashArray OpenMetrics Exporter - Deployment +# +# Provides Prometheus-scrapable metrics from Pure Storage FlashArray +# Polls FlashArray API and exposes /metrics endpoint for Prometheus ServiceMonitor +# +# Container: quay.io/purestorage/pure-fa-om-exporter (official image) +# Port: 9490 (standard exporter port) +# Config: tokens.yaml mounted from Secret +# ------------------------------------------------------------------------------ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pure-fa-exporter + namespace: monitoring + labels: + app.kubernetes.io/name: pure-fa-exporter + app.kubernetes.io/component: metrics + app.kubernetes.io/part-of: monitoring +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: pure-fa-exporter + template: + metadata: + labels: + app.kubernetes.io/name: pure-fa-exporter + app.kubernetes.io/component: metrics + spec: + containers: + - name: exporter + image: quay.io/purestorage/pure-fa-om-exporter:v1.0.27 + imagePullPolicy: IfNotPresent + + # Command args - point to tokens file + args: + - --port=9490 + - --tokens=/etc/pure-exporter/tokens.yaml + + ports: + - name: metrics + containerPort: 9490 + protocol: TCP + + # Resource limits (exporter is lightweight) + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 200m + memory: 128Mi + + # Health checks + livenessProbe: + httpGet: + path: / + port: metrics + initialDelaySeconds: 10 + periodSeconds: 30 + timeoutSeconds: 5 + + readinessProbe: + httpGet: + path: / + port: metrics + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + + # Mount tokens.yaml from secret + volumeMounts: + - name: tokens + mountPath: /etc/pure-exporter + readOnly: true + + volumes: + - name: tokens + secret: + secretName: pure-fa-exporter-token + items: + - key: tokens.yaml + path: tokens.yaml + + # Security context + securityContext: + runAsNonRoot: true + runAsUser: 65534 + fsGroup: 65534 diff --git a/cluster/platform/pure-exporter/secret.yaml b/cluster/platform/pure-exporter/secret.yaml new file mode 100644 index 0000000..67c4f02 --- /dev/null +++ b/cluster/platform/pure-exporter/secret.yaml @@ -0,0 +1,26 @@ +# ------------------------------------------------------------------------------ +# Pure FlashArray OpenMetrics Exporter - API Token Secret +# +# Contains the FlashArray endpoint and API token for the exporter to authenticate +# +# Endpoint: utilidor.local.mk-labs.cloud (10.1.71.5) +# API User: jarvis (readonly) +# +# Note: This is a base64-encoded secret. For production, consider using +# ExternalSecret with 1Password integration like portworx-csi does. +# ------------------------------------------------------------------------------ +apiVersion: v1 +kind: Secret +metadata: + name: pure-fa-exporter-token + namespace: monitoring + labels: + app.kubernetes.io/name: pure-fa-exporter + app.kubernetes.io/component: metrics +type: Opaque +stringData: + # tokens.yaml format for the exporter + tokens.yaml: | + utilidor: + address: utilidor.local.mk-labs.cloud + api_token: 6157dea0-4c0d-b14b-6e6a-453aa649355d diff --git a/cluster/platform/pure-exporter/service.yaml b/cluster/platform/pure-exporter/service.yaml new file mode 100644 index 0000000..9b6d129 --- /dev/null +++ b/cluster/platform/pure-exporter/service.yaml @@ -0,0 +1,23 @@ +# ------------------------------------------------------------------------------ +# Pure FlashArray OpenMetrics Exporter - Service +# +# ClusterIP service exposing /metrics endpoint for Prometheus scraping +# No ingress needed - pure east/west traffic within monitoring namespace +# ------------------------------------------------------------------------------ +apiVersion: v1 +kind: Service +metadata: + name: pure-fa-exporter + namespace: monitoring + labels: + app.kubernetes.io/name: pure-fa-exporter + app.kubernetes.io/component: metrics +spec: + type: ClusterIP + ports: + - name: metrics + port: 9490 + targetPort: metrics + protocol: TCP + selector: + app.kubernetes.io/name: pure-fa-exporter diff --git a/cluster/platform/pure-exporter/servicemonitor.yaml b/cluster/platform/pure-exporter/servicemonitor.yaml new file mode 100644 index 0000000..38c5014 --- /dev/null +++ b/cluster/platform/pure-exporter/servicemonitor.yaml @@ -0,0 +1,47 @@ +# ------------------------------------------------------------------------------ +# Pure FlashArray OpenMetrics Exporter - ServiceMonitor +# +# Configures Prometheus Operator to scrape Pure FlashArray metrics +# +# Scrape interval: 60s (storage metrics don't need high frequency) +# Endpoint: /metrics?endpoint=utilidor (multi-target exporter pattern) +# Metrics namespace: pure_* (purefa_info, purefa_array_*, purefa_volume_*, etc.) +# ------------------------------------------------------------------------------ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: pure-fa-exporter + namespace: monitoring + labels: + app.kubernetes.io/name: pure-fa-exporter + app.kubernetes.io/component: metrics + # Label selector for kube-prometheus-stack + release: monitoring +spec: + # Select the pure-fa-exporter service + selector: + matchLabels: + app.kubernetes.io/name: pure-fa-exporter + + # Namespace selector + namespaceSelector: + matchNames: + - monitoring + + # Scrape endpoint configuration + endpoints: + - port: metrics + interval: 60s + scrapeTimeout: 30s + path: /metrics + # Query parameter for multi-target exporter pattern + # Uses the array_id from tokens.yaml (utilidor) + params: + endpoint: + - utilidor + + # Relabeling to add FlashArray identifier + relabelings: + - sourceLabels: [__param_endpoint] + targetLabel: array + action: replace