-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22752cb
commit 5067122
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |