Skip to content

Commit

Permalink
Kubernetes deployment descriptor & instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
krishofmans committed Aug 9, 2018
1 parent 4b0d552 commit 8e48868
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
13 changes: 13 additions & 0 deletions kubernetes/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: ConfigMap
metadata:
labels:
app: vmware-exporter
name: vmware-exporter-config
apiVersion: v1
data:
VSPHERE_USER: "<USER>"
VSPHERE_HOST: "<HOST>"
VSPHERE_IGNORE_SSL: "True"
VSPHERE_COLLECT_HOSTS: "True"
VSPHERE_COLLECT_DATASTORES: "True"
VSPHERE_COLLECT_VMS: "True"
15 changes: 15 additions & 0 deletions kubernetes/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Vmware node exporter on kubernetes

First edit the config.yml file to match your setup.
Afterwards, using the read command interactively type in your password,
then run the command to create your secret on the cluster.
And finally deploy the exporter container.

The pod has prometheus annotations so when there's a prometheus on the cluster it will auto scrape the pod.

```
read -s VSPHERE_PASSWORD
kubectl create secret generic vmware-exporter-password --from-literal=VSPHERE_PASSWORD=$VSPHERE_PASSWORD
kubectl apply -f .
```
30 changes: 30 additions & 0 deletions kubernetes/vmware-exporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: vmware-exporter
spec:
selector:
matchLabels:
app: vmware-exporter
template:
metadata:
labels:
app: vmware-exporter
release: vmware-exporter
annotations:
prometheus.io/path: "/metrics"
prometheus.io/port: "9272"
prometheus.io/scrape: "true"
spec:
containers:
- name: vmware-exporter
image: "pryorda/vmware_exporter:latest"
imagePullPolicy: Always
ports:
- containerPort: 9272
name: http
envFrom:
- configMapRef:
name: vmware-exporter-config
- secretRef:
name: vmware-exporter-password

0 comments on commit 8e48868

Please sign in to comment.