Skip to content

Commit

Permalink
add db metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
bxy4543 committed Oct 12, 2023
1 parent 89fc6f3 commit d4b04f4
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
83 changes: 83 additions & 0 deletions deploy/cloud/manifests/db-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: database-monitor
name: database-monitor-config
namespace: sealos
data:
config.yml: |
server:
addr: ":9090"
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: database-monitor
name: database-monitor-deployment
namespace: sealos
spec:
replicas: 1
selector:
matchLabels:
app: database-monitor
strategy:
type: Recreate
template:
metadata:
labels:
app: database-monitor
spec:
containers:
- args:
- /config/config.yml
command:
- /manager
env:
- name: PROMETHEUS_SERVICE_HOST
value: http://kb-addon-prometheus-server.
image: ghcr.io/labring/sealos-cloud-database-monitor:latest
imagePullPolicy: Always
name: database-monitor
ports:
- containerPort: 9090
protocol: TCP
resources:
requests:
cpu: 1m
memory: 500M
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
runAsNonRoot: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /config
name: config-vol
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- configMap:
defaultMode: 420
name: database-monitor-config
name: config-vol
---
apiVersion: v1
kind: Service
metadata:
labels:
app: database-monitor
name: database-monitor
namespace: sealos
spec:
ports:
- name: http
port: 9090
protocol: TCP
targetPort: 9090
selector:
app: database-monitor
3 changes: 3 additions & 0 deletions deploy/cloud/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ function prepare {
# apply notifications crd
kubectl apply -f manifests/notifications_crd.yaml

# apply kb database metrics
kubectl apply -f manifests/db-metrics.yaml

# gen mongodb uri
gen_mongodbUri

Expand Down

0 comments on commit d4b04f4

Please sign in to comment.