Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ZinxValkyria authored May 31, 2024
1 parent 22752cb commit 5067122
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions kubernetes/nodeport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: nodejs-service
spec:
selector:
app: nodejs
ports:
- protocol: TCP
port: 3000 # Port exposed by the Service
targetPort: 3000 # Port that the application is listening on inside the Pods
nodePort: 30000 # Port exposed on all nodes in the cluster
type: NodePort
17 changes: 17 additions & 0 deletions kubernetes/prometheus_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config
data:
prometheus.yml: |
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090'] # Prometheus self-monitoring
- job_name: 'nodejs-app'
static_configs:
- targets: ['nodejs-service.default.svc.cluster.local:3000'] # Service endpoint for the Node.js application
12 changes: 12 additions & 0 deletions kubernetes/prometheus_service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: prometheus-service
spec:
selector:
app: prometheus
ports:
- protocol: TCP
port: 9090 # Port exposed by the Service
targetPort: 9090 # Port that Prometheus is listening on inside the Pods
type: ClusterIP

0 comments on commit 5067122

Please sign in to comment.