Add manifests to deploy+monitor example app
This commit is contained in:
39
manifests/examples/example-app/example-app-dev-depl.yaml
Normal file
39
manifests/examples/example-app/example-app-dev-depl.yaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
kind: Service
|
||||||
|
apiVersion: "v1"
|
||||||
|
metadata:
|
||||||
|
name: example-app
|
||||||
|
namespace: development
|
||||||
|
labels:
|
||||||
|
tier: frontend
|
||||||
|
team: frontend
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: 'true'
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: example-app
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
protocol: TCP
|
||||||
|
port: 8080
|
||||||
|
targetPort: web
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: example-app
|
||||||
|
namespace: development
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: example-app
|
||||||
|
version: 1.2.0
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: example-app
|
||||||
|
image: quay.io/fabxc/prometheus_demo_service
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
containerPort: 8080
|
||||||
|
protocol: TCP
|
39
manifests/examples/example-app/example-app-prod-depl.yaml
Normal file
39
manifests/examples/example-app/example-app-prod-depl.yaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
kind: Service
|
||||||
|
apiVersion: "v1"
|
||||||
|
metadata:
|
||||||
|
name: example-app
|
||||||
|
namespace: production
|
||||||
|
labels:
|
||||||
|
tier: frontend
|
||||||
|
team: frontend
|
||||||
|
annotations:
|
||||||
|
prometheus.io/scrape: 'true'
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: example-app
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
protocol: TCP
|
||||||
|
port: 8080
|
||||||
|
targetPort: web
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: example-app
|
||||||
|
namespace: production
|
||||||
|
spec:
|
||||||
|
replicas: 5
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: example-app
|
||||||
|
version: 1.1.3
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: example-app
|
||||||
|
image: quay.io/fabxc/prometheus_demo_service
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
containerPort: 8080
|
||||||
|
protocol: TCP
|
14
manifests/examples/example-app/prometheus-frontend-svc.yaml
Normal file
14
manifests/examples/example-app/prometheus-frontend-svc.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: prometheus-frontend
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
nodePort: 30100
|
||||||
|
port: 9090
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: web
|
||||||
|
selector:
|
||||||
|
prometheus.coreos.com: prometheus-frontend
|
11
manifests/examples/example-app/prometheus-frontend.yaml
Normal file
11
manifests/examples/example-app/prometheus-frontend.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: prometheus.coreos.com/v1alpha1
|
||||||
|
kind: Prometheus
|
||||||
|
metadata:
|
||||||
|
name: prometheus-frontend
|
||||||
|
labels:
|
||||||
|
prometheus: frontend
|
||||||
|
spec:
|
||||||
|
serviceMonitors:
|
||||||
|
- selector:
|
||||||
|
matchLabels:
|
||||||
|
team: frontend
|
13
manifests/examples/example-app/servicemonitor-frontend.yaml
Normal file
13
manifests/examples/example-app/servicemonitor-frontend.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: prometheus.coreos.com/v1alpha1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: frontend
|
||||||
|
labels:
|
||||||
|
team: frontend
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
team: frontend
|
||||||
|
scrapeInterval: 10s
|
||||||
|
endpoints:
|
||||||
|
- port: web
|
Reference in New Issue
Block a user