Skip to content
Snippets Groups Projects
Unverified Commit 5d62237b authored by Oliver's avatar Oliver Committed by GitHub
Browse files

Merge pull request #151 from ivanovaleksandar/master

Adding support for Openshift
parents e0df0163 3f1f5311
No related branches found
No related tags found
No related merge requests found
Loading
@@ -43,6 +43,40 @@ To run on Cloud Foundry, use:
Loading
@@ -43,6 +43,40 @@ To run on Cloud Foundry, use:
cf push -f contrib/manifest.yml cf push -f contrib/manifest.yml
``` ```
   
#### Run on Openshift
In order to deploy the exporter on Openshift environment.
```
oc project <myproject>
oc process -f https://raw.githubusercontent.com/ivanovaleksandar/redis_exporter/master/contrib/openshift-template.yaml \
-p REDIS_ADDR=<redis-service>:<redis-port> \
-p REDIS_PASSWORD=<redis-pass> \
-p REDIS_ALIAS=<redis-alias> \
-p REDIS_FILE=<redis-file> \
| oc create -f -
```
*NOTE*: Some of the parameters can be ommited if no authentication is used or the default redis config is applied.
```
oc process -f https://raw.githubusercontent.com/ivanovaleksandar/redis_exporter/contrib/openshift-template.yaml \
-p REDIS_ADDR=<redis-service>:<redis-port> \
| oc create -f -
```
If you are running Prometheus on Openshift on the same cluster, **target** in `prometheus.yml` should point to the correct service name of the exporter
```
scrape_configs:
...
- job_name: redis_exporter
static_configs:
- targets: ['<redis-exporter.myproject.svc>:9121']
...
```
   
### Flags ### Flags
   
Loading
Loading
apiVersion: v1
kind: Template
labels:
template: redis-exporter
app: redis-exporter
tier: redis
metadata:
annotations:
openshift.io/display-name: Openshift Redis Exporter deployment template
description: >-
Deploy a Redis exporter for Prometheus into a specific namespace together with image stream
tags: 'redis-exporter'
name: redis-exporter
parameters:
- name: NAME
description: The name of the application
displayName: Name
required: true
value: redis-exporter
- name: NAMESPACE
description: The namespace of the application
displayName: Namespace
required: true
- name: SOURCE_REPOSITORY_URL
description: The URL of the repository with your application source code.
displayName: Git Repository URL
required: true
value: 'https://github.com/ivanovaleksandar/redis_exporter.git'
- name: SOURCE_REPOSITORY_REF
description: Set the branch name if you are not using master branch
displayName: Git Reference
value: master
required: false
- name: REDIS_ADDR
description: Set the service names of the Redis instances that you like to export
displayName: Redis Addresses
required: true
- name: REDIS_PASSWORD
description: Set the password for the Redis instances that you like to export
displayName: Redis Password
required: false
- name: REDIS_ALIAS
description: Set the service alias of the Redis instances that you like to export
displayName: Redis Alias
required: false
- name: REDIS_FILE
description: Set the Redis file that contains one or more redis nodes, separated by newline
displayName: Redis file
required: false
objects:
- apiVersion: v1
kind: ImageStream
metadata:
generation: 2
labels:
app: redis-exporter
name: redis-exporter
name: redis-exporter
spec:
dockerImageRepository: oliver006/redis_exporter
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: redis-exporter
name: redis-exporter
spec:
replicas: 1
selector:
app: redis-exporter
template:
metadata:
labels:
app: redis-exporter
spec:
containers:
- image: docker-registry.default.svc:5000/${NAMESPACE}/redis-exporter
imagePullPolicy: Always
name: redis-exporter
ports:
- containerPort: 9121
env:
- name: REDIS_ADDR
value: "${REDIS_ADDR}"
- name: REDIS_PASSWORD
value: "${REDIS_PASSWORD}"
- name: REDIS_ALIAS
value: "${REDIS_ALIAS}"
- name: REDIS_FILE
value: "${REDIS_FILE}"
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
test: false
triggers: []
status: {}
- apiVersion: v1
kind: Service
metadata:
labels:
name: redis-exporter
role: service
name: redis-exporter
spec:
ports:
- port: 9121
targetPort: 9121
selector:
app: "redis-exporter"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment