add logstash alert imgpull

main
ycz008 2024-02-26 15:34:17 +08:00
parent 872c3e3447
commit 28cbe7f7b2
1 changed files with 14 additions and 10 deletions

View File

@ -54,28 +54,31 @@ data:
command => "/usr/local/bin/log-alert.sh '%{@timestamp}' '%{serviceName}' '%{env}' '%{level}' '%{message}'" command => "/usr/local/bin/log-alert.sh '%{@timestamp}' '%{serviceName}' '%{env}' '%{level}' '%{message}'"
} }
} }
logstash.yml: |-
http.host: "0.0.0.0"
xpack.monitoring.elasticsearch.hosts: [ "http://elastic:9200" ]
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: logstash name: logstash-alert
labels: labels:
app: logstash app: logstash-alert
spec: spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: logstash app: logstash-alert
template: template:
metadata: metadata:
labels: labels:
app: logstash app: logstash-alert
spec: spec:
imagePullSecrets: imagePullSecrets:
- name: docker-hub - name: deploy-regcred
containers: containers:
- name: logstash - name: logstash-alert
image: beaconfireiic/logstash:7.16.3 image: beaconfireiic/logstash:7.16.3
ports: ports:
- containerPort: 5044 - containerPort: 5044
@ -98,7 +101,7 @@ spec:
volumes: volumes:
- name: config - name: config
configMap: configMap:
name: logstash-config-alert name: logstash-alert-config
items: items:
- key: logstash.conf - key: logstash.conf
path: logstash.conf path: logstash.conf
@ -109,13 +112,14 @@ spec:
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: logstash name: logstash-alert
labels: labels:
app: logstash app: logstash-alert
spec: spec:
ports: ports:
- port: 5044 - port: 5044
targetPort: 5044 targetPort: 5044
nodePort: 30011
selector: selector:
app: logstash app: logstash-alert
type: ClusterIP type: ClusterIP