55 lines
1.3 KiB
YAML
55 lines
1.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: severed-blog
|
|
namespace: severed-apps
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: severed-blog
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: severed-blog
|
|
spec:
|
|
containers:
|
|
- name: web
|
|
image: severed-blog:v0.3
|
|
imagePullPolicy: Never
|
|
ports:
|
|
- containerPort: 80
|
|
resources:
|
|
requests:
|
|
cpu: "50m"
|
|
memory: "64Mi"
|
|
limits:
|
|
cpu: "200m"
|
|
memory: "128Mi"
|
|
volumeMounts:
|
|
- name: nginx-config-vol
|
|
mountPath: /etc/nginx/conf.d/default.conf
|
|
subPath: default.conf
|
|
|
|
# --- ADD THE EXPORTER SIDECAR HERE ---
|
|
- name: exporter
|
|
image: nginx/nginx-prometheus-exporter:latest
|
|
args:
|
|
- -nginx.scrape-uri=http://localhost:80/metrics
|
|
ports:
|
|
- containerPort: 9113
|
|
name: metrics
|
|
resources:
|
|
requests:
|
|
cpu: "10m"
|
|
memory: "32Mi"
|
|
limits:
|
|
cpu: "50m"
|
|
memory: "64Mi"
|
|
# -------------------------------------
|
|
|
|
volumes:
|
|
- name: nginx-config-vol
|
|
configMap:
|
|
name: severed-blog-config
|