Skip to content

Commit 4cb1cc3

Browse files
committed
Added k8s example
1 parent 0d42e17 commit 4cb1cc3

11 files changed

+262
-0
lines changed

examples/config/docker/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Start the exporter with default settings
2+
3+
Launch the exporter using the docker command according to the following:
4+
5+
```shell
6+
7+
docker run -d -p 9491:9491 --rm --name pure-fa-om-exporter quai.io/purestorage/pure-fa-om-exporter:<version>
8+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: grafana-datasources
5+
namespace: monitoring
6+
data:
7+
prometheus.yaml: |-
8+
{
9+
"apiVersion": 1,
10+
"datasources": [
11+
{
12+
"access":"proxy",
13+
"editable": true,
14+
"name": "prometheus",
15+
"orgId": 1,
16+
"type": "prometheus",
17+
"url": "http://prometheus-service.monitoring.svc:8080",
18+
"version": 1
19+
}
20+
]
21+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: grafana
5+
namespace: monitoring
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: grafana
11+
template:
12+
metadata:
13+
name: grafana
14+
labels:
15+
app: grafana
16+
spec:
17+
containers:
18+
- name: grafana
19+
image: grafana/grafana:latest
20+
ports:
21+
- name: grafana
22+
containerPort: 3000
23+
volumeMounts:
24+
- mountPath: /var/lib/grafana
25+
name: grafana-storage
26+
- mountPath: /etc/grafana/provisioning/datasources
27+
name: grafana-datasources
28+
readOnly: false
29+
volumes:
30+
- name: grafana-storage
31+
persistentVolumeClaim:
32+
claimName: grafana-pvc
33+
- name: grafana-datasources
34+
configMap:
35+
defaultMode: 420
36+
name: grafana-datasources
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: grafana-pvc
5+
namespace: monitoring
6+
labels:
7+
app: grafana
8+
spec:
9+
storageClassName: px-db
10+
accessModes:
11+
- ReadWriteOnce
12+
resources:
13+
requests:
14+
storage: 3Gi
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: grafana
5+
namespace: monitoring
6+
annotations:
7+
prometheus.io/scrape: 'true'
8+
prometheus.io/port: '3000'
9+
spec:
10+
selector:
11+
app: grafana
12+
type: NodePort
13+
ports:
14+
- port: 3000
15+
targetPort: 3000
16+
nodePort: 32000
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: prometheus-config
5+
namespace: monitoring
6+
data:
7+
prometheus.yml: |
8+
# Here you may want to set the scrpa interval and timeout according
9+
# to the time it takes to the exprter to succesfully return.
10+
global:
11+
scrape_interval: 60s
12+
scrape_timeout: 50s
13+
14+
# Alertmanager configuration
15+
alerting:
16+
alertmanagers:
17+
- static_configs:
18+
- targets:
19+
# - alertmanager:9093
20+
21+
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
22+
rule_files:
23+
# - "first_rules.yml"
24+
# - "second_rules.yml"
25+
26+
# A scrape configuration containing exactly one endpoint to scrape:
27+
scrape_configs:
28+
- job_name: 'purestorage-fb'
29+
metrics_path: /metrics/array
30+
authorization:
31+
credentials: T-2b74f9eb-a35f-40d9-a6a6-33c13775a53c
32+
params:
33+
endpoint: ['10.11.112.6']
34+
static_configs:
35+
- targets:
36+
- pure-fb-exporter.monitoring.svc:9491
37+
labels:
38+
location: uk
39+
site: London
40+
instance: fb-prod-01
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: prometheus
5+
namespace: monitoring
6+
labels:
7+
app: prometheus
8+
spec:
9+
replicas: 1
10+
strategy:
11+
rollingUpdate:
12+
maxSurge: 1
13+
maxUnavailable: 1
14+
type: RollingUpdate
15+
selector:
16+
matchLabels:
17+
app: prometheus
18+
template:
19+
metadata:
20+
labels:
21+
app: prometheus
22+
annotations:
23+
prometheus.io/scrape: "true"
24+
prometheus.io/port: "9090"
25+
spec:
26+
containers:
27+
- name: prometheus
28+
image: prom/prometheus
29+
args:
30+
- '--storage.tsdb.retention=60d'
31+
- '--storage.tsdb.path=/prometheus'
32+
- '--config.file=/etc/prometheus/prometheus.yml'
33+
ports:
34+
- name: web
35+
containerPort: 9090
36+
volumeMounts:
37+
- name: prometheus-config-volume
38+
mountPath: /etc/prometheus
39+
- name: prometheus-storage-volume
40+
mountPath: /prometheus
41+
restartPolicy: Always
42+
43+
volumes:
44+
- name: prometheus-config-volume
45+
configMap:
46+
defaultMode: 420
47+
name: prometheus-config
48+
49+
- name: prometheus-storage-volume
50+
persistentVolumeClaim:
51+
claimName: prometheus-pvc
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: prometheus-pvc
5+
namespace: monitoring
6+
labels:
7+
app: prometheus-deployment
8+
spec:
9+
storageClassName: px-db
10+
accessModes:
11+
- ReadWriteOnce
12+
resources:
13+
requests:
14+
storage: 4Gi
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: prometheus-service
5+
namespace: monitoring
6+
annotations:
7+
prometheus.io/scrape: 'true'
8+
prometheus.io/port: '9090'
9+
10+
spec:
11+
selector:
12+
app: prometheus
13+
type: NodePort
14+
ports:
15+
- port: 8080
16+
targetPort: 9090
17+
nodePort: 30000
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: pure-fa-om-exporter
5+
namespace: monitoring
6+
labels:
7+
app: pure-fa-exporter
8+
spec:
9+
replicas: 1
10+
strategy:
11+
rollingUpdate:
12+
maxSurge: 1
13+
maxUnavailable: 1
14+
type: RollingUpdate
15+
selector:
16+
matchLabels:
17+
app: pure-fa-exporter
18+
template:
19+
metadata:
20+
labels:
21+
app: pure-fa-exporter
22+
spec:
23+
containers:
24+
- name: pure-fa-om-exporter
25+
image: quay.io/purestorage/pure-fa-om-exporter
26+
args:
27+
- '--host=0.0.0.0'
28+
- '--port=9490'
29+
ports:
30+
- name: web
31+
containerPort: 9490
32+
restartPolicy: Always

0 commit comments

Comments
 (0)