Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- "containers/ironic-nautobot-client/**"
- "containers/ironic-vnc-client/**"
- "containers/understack-tests/**"
- "containers/ironic-prometheus-exporter/**"
- "python/**"
- ".github/workflows/containers.yaml"
- ".github/workflows/build-container-reuse.yaml"
Expand Down Expand Up @@ -46,6 +47,8 @@ jobs:
target: prod
- name: nautobot
target: prod
- name: ironic-prometheus-exporter
target: prod
uses: ./.github/workflows/build-container-reuse.yaml
secrets: inherit
with:
Expand Down
6 changes: 6 additions & 0 deletions apps/site/ironic-prometheus-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
component: ironic-prometheus-exporter
componentNamespace: openstack
sources:
- ref: understack
path: 'components/ironic-prometheus-exporter'
2 changes: 1 addition & 1 deletion charts/argocd-understack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "1.16.1"

maintainers:
- name: rackerlabs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if or (eq (include "understack.isEnabled" (list $.Values.global "ironic_prometheus_exporter")) "true") (eq (include "understack.isEnabled" (list $.Values.site "ironic_prometheus_exporter")) "true") }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ printf "%s-%s" $.Release.Name "ironic-prometheus-exporter" }}
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
spec:
destination:
namespace: openstack
server: {{ $.Values.cluster_server }}
project: understack
sources:
- path: components/ironic-prometheus-exporter
ref: understack
repoURL: {{ include "understack.understack_url" $ }}
targetRevision: {{ include "understack.understack_ref" $ }}
syncPolicy:
automated:
prune: true
selfHeal: true
managedNamespaceMetadata:
annotations:
argocd.argoproj.io/sync-options: Delete=false
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- RespectIgnoreDifferences=true
- ApplyOutOfSyncOnly=true
{{- end }}
9 changes: 9 additions & 0 deletions charts/argocd-understack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,15 @@ site:
# renovate: datasource=helm depName=ironic registryUrl=https://tarballs.opendev.org/openstack/openstack-helm
chartVersion: 2025.2.8+01c93d867

# -- ironic-prometheus-exporter
ironic_prometheus_exporter:
# -- Enable/disable deploying ironic-prometheus-exporter
# @default -- true
enabled: true
# -- Sync wave for deployment ordering
# @default -- 4
wave: 4

# -- Neutron (Networking Service)
neutron:
# -- Enable/disable deploying Neutron
Expand Down
16 changes: 8 additions & 8 deletions components/images-openstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ images:
keystone_fernet_setup: "ghcr.io/rackerlabs/understack/keystone:2025.2"

# ironic
ironic_api: "ghcr.io/rackerlabs/understack/ironic:2025.2"
ironic_conductor: "ghcr.io/rackerlabs/understack/ironic:2025.2"
ironic_pxe: "ghcr.io/rackerlabs/understack/ironic:2025.2"
ironic_pxe_init: "ghcr.io/rackerlabs/understack/ironic:2025.2"
ironic_api: "ghcr.io/rackerlabs/understack/ironic:pr-1673"
ironic_conductor: "ghcr.io/rackerlabs/understack/ironic:pr-1673"
ironic_pxe: "ghcr.io/rackerlabs/understack/ironic:pr-1673"
ironic_pxe_init: "ghcr.io/rackerlabs/understack/ironic:pr-1673"
ironic_pxe_http: "docker.io/nginx:1.29.4"
ironic_db_sync: "ghcr.io/rackerlabs/understack/ironic:2025.2"
ironic_db_sync: "ghcr.io/rackerlabs/understack/ironic:pr-1673"
# these want curl which apparently is in the openstack-client image
ironic_manage_cleaning_network: "ghcr.io/rackerlabs/understack/openstack-client:2025.2"
ironic_retrive_cleaning_network: "ghcr.io/rackerlabs/understack/openstack-client:2025.2"
ironic_retrive_swift_config: "ghcr.io/rackerlabs/understack/openstack-client:2025.2"
ironic_manage_cleaning_network: "ghcr.io/rackerlabs/understack/openstack-client:pr-1673"
ironic_retrive_cleaning_network: "ghcr.io/rackerlabs/understack/openstack-client:pr-1673"
ironic_retrive_swift_config: "ghcr.io/rackerlabs/understack/openstack-client:pr-1673"

# neutron
neutron_db_sync: "ghcr.io/rackerlabs/understack/neutron:2025.2"
Expand Down
46 changes: 46 additions & 0 deletions components/ironic-prometheus-exporter/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ironic-prometheus-exporter
namespace: openstack
labels:
app: ironic-prometheus-exporter
spec:
replicas: 1
selector:
matchLabels:
app: ironic-prometheus-exporter
template:
metadata:
labels:
app: ironic-prometheus-exporter
spec:
containers:
- name: ironic-prometheus-exporter
image: ghcr.io/rackerlabs/understack/ironic-prometheus-exporter:pr-1673
imagePullPolicy: IfNotPresent
ports:
- name: metrics
containerPort: 8000
protocol: TCP
volumeMounts:
- name: ironic-prometheus-exporter
mountPath: /opt/stack/node_metrics
readOnly: true
# Uncomment and adjust if your container requires explicit arguments
# args:
# - --metrics-path
# - /opt/stack/node_metrics
# - --port
# - "8000"
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 256Mi
volumes:
- name: ironic-prometheus-exporter
persistentVolumeClaim:
claimName: pvc-ironic-prometheus-exporter
7 changes: 7 additions & 0 deletions components/ironic-prometheus-exporter/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- deployment.yaml
- service.yaml
- service-monitor.yaml
16 changes: 16 additions & 0 deletions components/ironic-prometheus-exporter/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: ironic-prometheus-exporter
namespace: openstack
spec:
selector:
matchLabels:
app: ironic-prometheus-exporter
namespaceSelector:
matchNames:
- openstack
endpoints:
- port: metrics
interval: 30s
path: /metrics
16 changes: 16 additions & 0 deletions components/ironic-prometheus-exporter/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: ironic-prometheus-exporter
namespace: openstack
labels:
app: ironic-prometheus-exporter
spec:
type: ClusterIP
selector:
app: ironic-prometheus-exporter
ports:
- name: metrics
port: 8000
targetPort: 8000
protocol: TCP
25 changes: 25 additions & 0 deletions components/ironic/ironic-prometheus-exporter-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# labels:
# undercloud.local/purpose: ironic-prometheus-exporter
# name: pvc-ironic-prometheus-exporter
# namespace: openstack
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 1Gi
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-ironic-prometheus-exporter
namespace: openstack
spec:
storageClassName: ceph-fs-ec
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
2 changes: 2 additions & 0 deletions components/ironic/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ resources:
# Alerting
- pr-clean-failed-servers.yaml
- pr-resource-availability.yaml
# ironic-prometheus-exporter
- ironic-prometheus-exporter-pvc.yaml
5 changes: 5 additions & 0 deletions components/ironic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ pod:
- name: ironic-etc-snippets
mountPath: /etc/ironic/ironic.conf.d
readOnly: true
- name: ironic-prometheus-exporter
mountPath: /opt/stack/node_metrics
volumes:
- name: dnsmasq-ironic
persistentVolumeClaim:
Expand All @@ -247,6 +249,9 @@ pod:
name: ironic-ks-etc
- name: pod-usr-share-novnc
emptyDir: {}
- name: ironic-prometheus-exporter
persistentVolumeClaim:
claimName: pvc-ironic-prometheus-exporter
ironic_api:
ironic_api:
volumeMounts:
Expand Down
35 changes: 35 additions & 0 deletions containers/ironic-prometheus-exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM python:3.12-slim AS prod

ENV PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY containers/ironic-prometheus-exporter/requirements.txt /

RUN --mount=type=cache,target=/root/.cache/pip pip install -r /requirements.txt dumb-init==1.2.5

RUN useradd -m -d /runner -s /bin/bash runner
WORKDIR /runner
USER runner

# RUN --mount=type=cache,target=/root/.cache/pip ansible-galaxy collection install -r /requirements.yml

# ENTRYPOINT ["dumb-init"]
# CMD ["ansible-runner"]
CMD ["python", "-m", "flask", "run"]
# gunicorn3 -b <ip_address>:9608 \
# --env IRONIC_CONFIG=$IRONIC_CONFIG \
# --env FLASK_DEBUG=1 -w 4 \
# --access-logfile=ipe_access.log \
# --error-logfile=ipe_errors.log \
# -D ironic_prometheus_exporter.app.wsgi:application
# CMD [
# "gunicorn", "-b", "0.0.0.0:9608"
# ]
5 changes: 5 additions & 0 deletions containers/ironic-prometheus-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ironic-prometheus-exporter

``` bash
docker build -t ironic-prometheus-exporter -f containers/ironic-prometheus-exporter/Dockerfile .
```
2 changes: 2 additions & 0 deletions containers/ironic-prometheus-exporter/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ironic-prometheus-exporter
gunicorn
3 changes: 2 additions & 1 deletion containers/ironic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ RUN --mount=type=cache,target=/root/.cache/uv \
/src/ironic \
/src/understack/ironic-understack \
/src/understack/understack-flavor-matcher \
proliantutils==2.16.3
proliantutils==2.16.3 \
ironic-prometheus-exporter==4.7.0

COPY containers/ironic/patches /tmp/patches/
RUN cd /var/lib/openstack/lib/python3.12/site-packages && \
Expand Down
Loading