Skip to content

Commit

Permalink
uf
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamv108 committed Sep 5, 2023
1 parent 3b3a97f commit ce8a43d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
19 changes: 19 additions & 0 deletions k8s/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ spec:
metadata:
labels:
app: server-sent-events
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: "/actuator/prometheus"
spec:
containers:
- name: server-sent-events
Expand Down Expand Up @@ -73,6 +77,21 @@ spec:
- port: 80
targetPort: 8080
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: server-sent-events-service-monitor
namespace: sse
labels:
release: prometheus-operator
spec:
selector:
matchLabels:
app: server-sent-events
endpoints:
- port: http-traffic
path: "/actuator/prometheus"
---
## Uncomment to add ingress after adding ingress controller
#apiVersion: networking.k8s.io/v1
#kind: Ingress
Expand Down
16 changes: 11 additions & 5 deletions scripts/k8s/apply.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
kubectl apply -f ../k8s/mysql.yaml
kubectl apply -f ../k8s/kafka.yaml
kubectl apply -f ../k8s/kafdrop.yaml
kubectl apply -f ../k8s/es.yaml
kubectl apply -f ../k8s/app.yaml
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl apply -f k8s/mysql.yaml
kubectl apply -f k8s/kafka.yaml
kubectl apply -f k8s/kafdrop.yaml
kubectl create -f https://download.elastic.co/downloads/eck/2.9.0/crds.yaml
kubectl apply -f https://download.elastic.co/downloads/eck/2.9.0/operator.yaml
kubectl apply -f k8s/es.yaml
kubectl create namespace prometheus
helm install prometheus bitnami/kube-prometheus
kubectl apply -f k8s/app.yaml
1 change: 1 addition & 0 deletions scripts/k8s/pf-argocd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kubectl port-forward svc/argocd-server -n argocd 8080:443
1 change: 1 addition & 0 deletions scripts/k8s/pf-prometheus.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kubectl port-forward --namespace prometheus svc/prometheus-kube-prometheus-prometheus 9090:9090
4 changes: 3 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ kafka.topic.name=userevents
spring.kafka.consumer.auto-offset-reset=earliest

# Metrics/Actuator
management.endpoints.web.exposure.include=*
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
management.health.probes.enabled=true

0 comments on commit ce8a43d

Please sign in to comment.