enable prometheus ports, configure prometheus server
This commit is contained in:
parent
f7556d0e12
commit
242b70eb21
8 changed files with 272 additions and 158 deletions
0
manifests/grafana/service.yaml
Normal file
0
manifests/grafana/service.yaml
Normal file
|
|
@ -7,8 +7,13 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 80
|
- port: 80
|
||||||
|
name: http
|
||||||
targetPort: 4000
|
targetPort: 4000
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
- port: 4021
|
||||||
|
name: prometheus
|
||||||
|
targetPort: 4021
|
||||||
|
protocol: TCP
|
||||||
selector:
|
selector:
|
||||||
app: pleroma
|
app: pleroma
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ spec:
|
||||||
command: ["sh", "-c", "elixir --sname pleroma -S mix phx.server --no-compile"]
|
command: ["sh", "-c", "elixir --sname pleroma -S mix phx.server --no-compile"]
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 4000
|
- containerPort: 4000
|
||||||
|
- containerPort: 4021
|
||||||
env:
|
env:
|
||||||
- name: MIX_ENV
|
- name: MIX_ENV
|
||||||
value: prod
|
value: prod
|
||||||
|
|
|
||||||
16
manifests/prometheus/configmap.yaml
Normal file
16
manifests/prometheus/configmap.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
namespace: darkdork-dev
|
||||||
|
name: prometheus-config
|
||||||
|
data:
|
||||||
|
prometheus.yaml: |
|
||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: 'pleroma'
|
||||||
|
scheme: http
|
||||||
|
static_configs:
|
||||||
|
- targets: ['pleroma:4021']
|
||||||
40
manifests/prometheus/deployment.yaml
Normal file
40
manifests/prometheus/deployment.yaml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: prometheus
|
||||||
|
namespace: darkdork-dev
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: prometheus
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: prometheus
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: registry-credentials
|
||||||
|
containers:
|
||||||
|
- name: prometheus
|
||||||
|
image: prom/prometheus
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- containerPort: 9090
|
||||||
|
volumeMounts:
|
||||||
|
- name: prometheus-data
|
||||||
|
mountPath: /prometheus
|
||||||
|
- name: prometheus-config
|
||||||
|
mountPath: /etc/prometheus/prometheus.yaml
|
||||||
|
subPath: prometheus.yaml
|
||||||
|
volumes:
|
||||||
|
- name: prometheus-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: prometheus-pvc
|
||||||
|
- name: prometheus-config
|
||||||
|
configMap:
|
||||||
|
name: prometheus-config
|
||||||
|
securityContext:
|
||||||
|
fsGroup: 1000
|
||||||
|
---
|
||||||
20
manifests/prometheus/ingress.yaml
Normal file
20
manifests/prometheus/ingress.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: prometheus
|
||||||
|
namespace: darkdork-dev
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: darkdork.prometheus.lan
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: prometheus
|
||||||
|
port:
|
||||||
|
number: 9090
|
||||||
|
---
|
||||||
17
manifests/prometheus/pvc.yaml
Normal file
17
manifests/prometheus/pvc.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: prometheus-pvc
|
||||||
|
namespace: darkdork-dev
|
||||||
|
labels:
|
||||||
|
app: prometheus
|
||||||
|
spec:
|
||||||
|
storageClassName: longhorn-ssd
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage:
|
||||||
|
10Gi
|
||||||
|
---
|
||||||
15
manifests/prometheus/service.yaml
Normal file
15
manifests/prometheus/service.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: prometheus
|
||||||
|
namespace: darkdork-dev
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 9090
|
||||||
|
name: prometheus
|
||||||
|
targetPort: 9090
|
||||||
|
protocol: TCP
|
||||||
|
selector:
|
||||||
|
app: prometheus
|
||||||
|
---
|
||||||
Loading…
Add table
Add a link
Reference in a new issue