-
Notifications
You must be signed in to change notification settings - Fork 49
neo edited this page Sep 3, 2020
·
12 revisions
apiVersion: v1
kind: ServiceAccount
metadata:
name: monitor
namespace: platform
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: platform:monitor
subjects:
- kind: ServiceAccount
name: monitor
namespace: platform
roleRef:
kind: ClusterRole
name: view
apiGroup: rbac.authorization.k8s.io
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: monitor
namespace: platform
spec:
replicas: 1
selector:
matchLabels:
app: monitor
revisionHistoryLimit: 10
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels:
app: monitor
spec:
nodeSelector:
pool: ops
serviceAccountName: monitor
containers:
- name: monitor
image: neowu/monitor:7.5.7
env:
- name: JAVA_OPTS
value: "-XX:+UseG1GC -XX:MaxRAMPercentage=85 -Xss256k"
- name: SYS_KAFKA_URI
value: "log-kafka-0.log-kafka:9092"
- name: APP_SLACK_TOKEN
value: "xxxxxxx"
- name: APP_ALERT_CONFIG
value: |
{
"ignoreErrors": [
{"apps": ["backoffice", "log-collector"], "severity": "WARN", "errorCodes": ["FORBIDDEN", "PATH_NOT_FOUND", "UNAUTHORIZED", "METHOD_NOT_ALLOWED"]}
],
"criticalErrors": [
{"errorCodes": ["FAILED_TO_START", "POD_FAILURE"]},
{"errorCodes": ["RUNTIME_ERROR", "LIFECYCLE_ERROR", "API_VALIDATION_ERROR"]}
],
"site": "dev / platform",
"kibanaURL": "http://kube.example.com:30101",
"channels": {
"xxx": {"severity": "ERROR", "indices": ["trace", "stat"]},
"xxx": {"severity": "WARN", "indices": ["trace", "stat"]},
"xxx": {"severity": "ERROR", "indices": ["event"]},
"xxx": {"severity": "WARN", "indices": ["event"]}
}
}
- name: APP_MONITOR_CONFIG
value: |
{
"redis": {
"cache": { "hosts": ["cache"] },
"session": { "hosts": ["session-0.session"] }
},
"es": {
"log": { "host": "log-es-0.log-es", "highHeapUsageThreshold": 0.8 }
},
"kafka": {
"log": { "host": "log-kafka-0.log-kafka", "highHeapUsageThreshold": 0.8 }
},
"kube": {
"namespaces": ["platform", "ops"]
}
}
readinessProbe:
httpGet:
path: /health-check
scheme: HTTPS
port: 8443
initialDelaySeconds: 10
periodSeconds: 10
resources:
limits:
memory: 256Mi