Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add array exporter YAMLs #397

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions yaml/array-exporter/v1.0.3/hpe-array-exporter-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# The HPE Storage Array Exporter for Prometheus uses a Secret to
# identify the target storage system and provide its login
# credentials.
#
# Modify this sample file to:
# - Use a unique name for each storage system
# - Match the namespace where the exporter will be deployed
# - Specify the address, user name, and password for the target
# storage system
#
# For convenience, a Secret used by the HPE CSI Driver can be
# reused without modification.

---
kind: Secret
apiVersion: v1
metadata:
name: hpe-backend
namespace: hpe-storage
stringData:
address: 192.168.1.1
username: admin
password: admin
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# A Service Monitor can enable a Prometheus Operator within the cluster
# to discover the HPE Storage Array Exporter for Prometheus as a scrape
# target.
#
# Modify this sample file to:
# - Match the namespace of the hpe-array-exporter-service
# - Match the selector used by the Prometheus Operator installation
# - Customize the scrape configuration, including desired target labels

---
kind: ServiceMonitor
apiVersion: monitoring.coreos.com/v1
metadata:
name: hpe-array-exporter-servicemonitor
namespace: hpe-storage
labels:
# A selector for this label is used by a Prometheus Operator
# installed via OLM
k8s-app: prometheus
# A "release" label selector is used by the Helm Kube Prometheus Stack,
# with the value as the release specified on chart installation
release: prometheus
spec:
# Match the namespace of the target Array Exporter service,
# or omit the namespaceSelector
namespaceSelector:
matchNames:
- hpe-storage
selector:
matchLabels:
app: hpe-array-exporter
endpoints:
- port: http-metrics
scheme: http
interval: 1m
# Corresponding labels on the Array Exporter service are added to
# the scraped metrics
#targetLabels:
# - array
87 changes: 87 additions & 0 deletions yaml/array-exporter/v1.0.3/hpe-array-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Deploy the HPE Storage Array Exporter for Prometheus.
#
# Modify this sample file to:
# - Uncomment the --accept-eula option in the Deployment to indicate
# your acceptance of the HPE End User License Agreement at
# https://www.hpe.com/us/en/software/licensing.html
# - Specify the name of a Secret containing storage array access
# information in the storage-system-config volume spec
# - Optionally set the Service type to NodePort, if necessary for
# access by a Prometheus instance running outside the cluster
# - Optionally add labels to the Service, for example to facilitate
# the use of targetLabels in a ServiceMonitor spec

---
kind: Deployment
apiVersion: apps/v1
metadata:
name: hpe-array-exporter
namespace: hpe-storage
spec:
selector:
matchLabels:
app: hpe-array-exporter
replicas: 1
template:
metadata:
labels:
app: hpe-array-exporter
spec:
containers:
- name: array-exporter
image: quay.io/hpestorage/array-exporter:v1.0.3
ports:
- containerPort: 8080
args:
- "--telemetry.addr=:8080"
- "--telemetry.path=/metrics"
# IMPORTANT: Uncomment this argument to confirm your
# acceptance of the HPE End User License Agreement at
# https://www.hpe.com/us/en/software/licensing.html
#- "--accept-eula"
- "/etc/config"
env:
- name: LOG_LEVEL
value: info
imagePullPolicy: Always
volumeMounts:
- name: storage-system-config
mountPath: /etc/config
volumes:
- name: storage-system-config
secret:
# Specify the name of a Secret in the same namespace as this
# deployment providing storage array access information:
# "address" (or "backend"), "username", and "password".
secretName: hpe-backend

---
kind: Service
apiVersion: v1
metadata:
name: hpe-array-exporter
namespace: hpe-storage
labels:
app: hpe-array-exporter
# Optionally add labels, for example to be included in Prometheus
# metrics via a targetLabels setting in a ServiceMonitor spec
#array: 192.168.0.1
# Optionally add annotations, for example to configure it as a
# scrape target when using the Prometheus Helm chart's default
# configuration.
#annotations:
# "prometheus.io/scrape": "true"
spec:
# Optionally expose the metrics service outside the cluster
#type: NodePort
ports:
- name: http-metrics
port: 9090
# Optionally choose a TCP port at which to expose the metrics
# service externally at each cluster node, when the Service
# type is NodePort
#nodePort: 30902
protocol: TCP
targetPort: 8080
selector:
app: hpe-array-exporter
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# A Service Monitor can enable a Prometheus Operator within the cluster
# to discover the HPE CSI Info Metrics Provider for Prometheus as a
# scrape target.
#
# Modify this sample file to:
# - Match the namespace of the hpe-csi-info-metrics-service
# - Match the selector used by the Prometheus Operator installation
# - Customize the scrape configuration, including desired target labels

---
kind: ServiceMonitor
apiVersion: monitoring.coreos.com/v1
metadata:
name: hpe-csi-info-metrics-servicemonitor
namespace: hpe-storage
labels:
# A selector for this label is used by a Prometheus Operator
# installed via OLM
k8s-app: prometheus
# A "release" label selector is used by the Helm Kube Prometheus Stack,
# with the value as the release specified on chart installation
release: prometheus
spec:
# Match the namespace of the target CSI Info Metrics service,
# or omit the namespaceSelector
namespaceSelector:
matchNames:
- hpe-storage
selector:
matchLabels:
app: hpe-csi-info-metrics
endpoints:
- port: http-metrics
scheme: http
interval: 1m
# Corresponding labels on the CSI Info Metrics service are added to
# the scraped metrics
#targetLabels:
# - cluster
112 changes: 112 additions & 0 deletions yaml/csi-info-metrics/v1.0.3/hpe-csi-info-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Deploy the HPE CSI Info Metrics Provider for Prometheus.
#
# Modify this sample file to:
# - Uncomment the --accept-eula option in the Deployment to indicate
# your acceptance of the HPE End User License Agreement at
# https://www.hpe.com/us/en/software/licensing.html.
# - Optionally set the Service type to NodePort, if necessary for
# access by a Prometheus instance running outside the cluster
# - Optionally add labels to the Service, for example to facilitate
# the use of targetLabels in a ServiceMonitor spec

---
kind: ServiceAccount
apiVersion: v1
metadata:
name: hpe-csi-info-metrics-serviceaccount
namespace: hpe-storage

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hpe-csi-info-metrics-role
rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hpe-csi-info-metrics-rolebinding
subjects:
- kind: ServiceAccount
name: hpe-csi-info-metrics-serviceaccount
namespace: hpe-storage
roleRef:
kind: ClusterRole
name: hpe-csi-info-metrics-role
apiGroup: rbac.authorization.k8s.io

---
kind: Deployment
apiVersion: apps/v1
metadata:
name: hpe-csi-info-metrics
namespace: hpe-storage
spec:
selector:
matchLabels:
app: hpe-csi-info-metrics
replicas: 1
template:
metadata:
labels:
app: hpe-csi-info-metrics
spec:
serviceAccount: hpe-csi-info-metrics-serviceaccount
containers:
- name: csi-info-metrics
image: quay.io/hpestorage/csi-info-metrics:v1.0.3
ports:
- containerPort: 9099
args:
- "--telemetry.addr=:9099"
- "--telemetry.path=/metrics"
# IMPORTANT: Uncomment this argument to confirm your
# acceptance of the HPE End User License Agreement at
# https://www.hpe.com/us/en/software/licensing.html
#- "--accept-eula"
env:
- name: LOG_LEVEL
value: info
imagePullPolicy: Always

---
kind: Service
apiVersion: v1
metadata:
name: hpe-csi-info-metrics-service
namespace: hpe-storage
labels:
app: hpe-csi-info-metrics
# Optionally add labels, for example to be included in Prometheus
# metrics via a targetLabels setting in a ServiceMonitor spec
#cluster: my-cluster
# Optionally add annotations, for example to configure it as a
# scrape target when using the Prometheus Helm chart's default
# configuration.
#annotations:
# "prometheus.io/scrape": "true"
spec:
# Optionally expose the metrics service outside the cluster
#type: NodePort
ports:
- name: http-metrics
port: 9090
# Optionally choose a TCP port at which to expose the metrics
# service externally at each cluster node, when the Service
# type is NodePort
#nodePort: 30901
protocol: TCP
targetPort: 9099
selector:
app: hpe-csi-info-metrics