This commit is contained in:
2024-02-20 17:15:27 +08:00
committed by huty
parent 6706e1a633
commit 34158042ad
1529 changed files with 177765 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-db
namespace: kiamol-ch14-test
spec:
selector:
matchLabels:
app: todo-db
template:
metadata:
labels:
app: todo-db
annotations:
prometheus.io/port: "9187"
spec:
containers:
- name: db
image: postgres:11.6-alpine
env:
- name: POSTGRES_PASSWORD_FILE
value: /secrets/postgres_password
volumeMounts:
- name: secret
mountPath: "/secrets"
- name: data
mountPath: /var/lib/postgresql/data
- name: exporter
image: wrouesnel/postgres_exporter:v0.8.0
ports:
- name: metrics
containerPort: 9187
env:
- name: DATA_SOURCE_URI
value: localhost?sslmode=disable
- name: DATA_SOURCE_USER
value: postgres
- name: DATA_SOURCE_PASS
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: todo-db-secret
volumeMounts:
- name: secret
mountPath: "/secrets"
volumes:
- name: secret
secret:
secretName: todo-db-secret
defaultMode: 0400
items:
- key: POSTGRES_PASSWORD
path: postgres_password
- name: data
emptyDir: {}

View File

@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: todo-proxy
namespace: kiamol-ch14-test
spec:
selector:
matchLabels:
app: todo-proxy
template:
metadata:
labels:
app: todo-proxy
annotations:
prometheus.io/port: "9113"
spec:
containers:
- name: nginx
image: nginx:1.17-alpine
ports:
- name: http
containerPort: 80
volumeMounts:
- name: config
mountPath: "/etc/nginx/"
readOnly: true
- name: exporter
image: nginx/nginx-prometheus-exporter:0.8.0
ports:
- name: metrics
containerPort: 9113
args:
- -nginx.scrape-uri=http://localhost/stub_status
volumes:
- name: config
configMap:
name: todo-proxy-config