-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(add_openshift): Adding openshift configurations
This PR includes manifests to support installing vmware_exporter in OpenShift and sending prometheus data directly to the existing instance. Co-authored-by: Daniel Pryor <daniel@pryorda.net>
- Loading branch information
1 parent
a45f0cf
commit c6a428e
Showing
6 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
### Installing vmware_exporter in OpenShift | ||
|
||
Create the secret as described in the kubernetes documentation | ||
|
||
TODO: Use existing secret | ||
``` | ||
read -s VSPHERE_PASSWORD | ||
oc create secret generic -n openshift-vsphere-infra vmware-exporter-password --from-literal=VSPHERE_PASSWORD=$VSPHERE_PASSWORD | ||
``` | ||
|
||
Modify the `configmap.yaml` for your configuration and apply. | ||
|
||
``` | ||
oc apply -f configmap.yaml | ||
``` | ||
|
||
Apply the role, rolebinding, service, deployment and ServiceMonitor | ||
|
||
``` | ||
oc apply -f rolebinding.yaml | ||
oc apply -f service.yaml | ||
oc apply -f deployment.yaml | ||
oc apply -f servicemonitor.yaml | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
data: | ||
VSPHERE_COLLECT_DATASTORES: "True" | ||
VSPHERE_COLLECT_HOSTS: "True" | ||
VSPHERE_COLLECT_SNAPSHOTS: "False" | ||
VSPHERE_COLLECT_VMGUESTS: "True" | ||
VSPHERE_COLLECT_VMS: "True" | ||
VSPHERE_FETCH_ALARMS: "True" | ||
VSPHERE_FETCH_CUSTOM_ATTRIBUTES: "True" | ||
VSPHERE_FETCH_TAGS: "True" | ||
VSPHERE_HOST: vcenter | ||
VSPHERE_IGNORE_SSL: "True" | ||
VSPHERE_USER: user | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
app: vmware-exporter | ||
name: vmware-exporter-config | ||
namespace: openshift-vsphere-infra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: vmware-exporter | ||
namespace: openshift-vsphere-infra | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: vmware-exporter | ||
k8s-app: vmware-exporter | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 25% | ||
maxUnavailable: 25% | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: vmware-exporter | ||
k8s-app: vmware-exporter | ||
release: vmware-exporter | ||
spec: | ||
containers: | ||
- envFrom: | ||
- configMapRef: | ||
name: vmware-exporter-config | ||
- secretRef: | ||
name: vmware-exporter-password | ||
image: quay.io/jcallen/vmware_exporter:add_metrics | ||
imagePullPolicy: Always | ||
name: vmware-exporter | ||
ports: | ||
- containerPort: 9272 | ||
name: http | ||
protocol: TCP | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
terminationGracePeriodSeconds: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
k8s-app: vmware-exporter | ||
name: metrics | ||
namespace: openshift-vsphere-infra | ||
spec: | ||
ports: | ||
- name: metrics | ||
port: 9272 | ||
protocol: TCP | ||
targetPort: 9272 | ||
selector: | ||
k8s-app: vmware-exporter | ||
sessionAffinity: None | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
labels: | ||
k8s-app: vmware-exporter | ||
name: vmware | ||
namespace: openshift-monitoring | ||
spec: | ||
endpoints: | ||
- interval: 30s | ||
port: metrics | ||
scheme: http | ||
jobLabel: app | ||
namespaceSelector: | ||
matchNames: | ||
- openshift-vsphere-infra | ||
selector: | ||
matchLabels: | ||
k8s-app: vmware-exporter |