Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.96 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.96 KB

Openshift Builds Exporter

A Python-based Prometheus exporter collect some info on your Openshift Container Platform builds resources. Using AsyncIO Prometheus client for Python 3+. /metrics example : enter image description here

Requirements

Configuration

  • Uses environment variables to define the connection to OCP environment and other configurations.
  • You can give your user cluster-reader role with 2 options:
  1. Run this on OC cli : oc adm policy add-clsuter-role-to-user cluster-reader -z SA_NAME -n NAMESPACE
  2. Create cluster-role binding with this .yaml file :
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: build-metric
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: default
    namespace: build-metric-dev

There is official documentation by Openshift.com on how to give cluster role for your OCP user.

How to Use

  • First choose your exporter OCP namespace, such as kubesystem.
  • Delpoy new Python application from OCP catalog.
  • Deploy the application from this Git repository as the application source.
  • Edit your Deployment environment variables, here's a nice example : Environment variables example

Notes

  • More documentation will be comming soon !