Skip to content

Instantly share code, notes, and snippets.

@jcpowermac
Created December 18, 2020 19:34
Show Gist options
  • Save jcpowermac/221f1f1f563533f9aa3327ae1deb4aa5 to your computer and use it in GitHub Desktop.
Save jcpowermac/221f1f1f563533f9aa3327ae1deb4aa5 to your computer and use it in GitHub Desktop.
vsphere exporter in openshift (will submit pr)
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: prometheus-k8s
namespace: openshift-vsphere-infra
rules:
- verbs:
- get
- list
- watch
apiGroups:
- ''
resources:
- services
- endpoints
- pods
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: prometheus-k8s
namespace: openshift-vsphere-infra
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: openshift-monitoring
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-k8s
apiVersion: v1
kind: Service
metadata:
labels:
k8s-app: vmware-exporter
name: metrics
namespace: openshift-vsphere-infra
spec:
ports:
- name: vmware-metrics
port: 9272
protocol: TCP
targetPort: 9272
selector:
k8s-app: vmware-exporter
sessionAffinity: None
type: ClusterIP
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
k8s-app: vmware-exporter
name: vmware-exporter-monitor
namespace: openshift-vsphere-infra
spec:
endpoints:
- interval: 30s
port: vmware-metrics
scheme: http
jobLabel: app
namespaceSelector:
matchNames:
- openshift-vsphere-infra
selector:
matchLabels:
k8s-app: vmware-exporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment