Skip to content

Commit

Permalink
Update current feature
Browse files Browse the repository at this point in the history
  • Loading branch information
fjammes committed Feb 18, 2025
1 parent eb311da commit 191067c
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 13 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kubectl label ns "$NS" "name=$NS"
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts || echo "Unable to add repo prometheus-community"
helm repo add stable https://charts.helm.sh/stable --force-update
helm repo update
helm install --version "65.4.0" prometheus-stack prometheus-community/kube-prometheus-stack -n monitoring -f "$DIR"/values.yaml --create-namespace
helm install --version "69.3.0" prometheus-stack prometheus-community/kube-prometheus-stack -n monitoring -f "$DIR"/values.yaml --create-namespace

echo "Exercice: access prometheus-grafana and other services using the website documentation"
echo "1. Watch all pod in monitoring namespace"
Expand Down
20 changes: 20 additions & 0 deletions manifests/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-app
spec:
replicas: 3
selector:
matchLabels:
app: example-app
template:
metadata:
labels:
app: example-app
spec:
containers:
- name: example-app
image: quay.io/brancz/prometheus-example-app:v0.5.0
ports:
- name: web
containerPort: 8080
4 changes: 4 additions & 0 deletions manifests/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: example-app
13 changes: 13 additions & 0 deletions manifests/pod-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: example-app
namespace: example-app
labels:
team: frontend
spec:
selector:
matchLabels:
app: example-app
podMetricsEndpoints:
- port: web
28 changes: 16 additions & 12 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ prometheus:
resources:
requests:
storage: 50Gi
podMonitorSelector:
matchLabels:
monitoring: "true"
podMonitorNamespaceSelector:
matchLabels:
monitoring: "true"
serviceMonitorSelector:
matchLabels:
monitoring: "true"
serviceMonitorNamespaceSelector:
matchLabels:
monitoring: "true"
serviceMonitorSelectorNilUsesHelmValues: true
podMonitorSelectorNilUsesHelmValues: true

# Code below prevent use of default serviceMonitor used for monitoring kubernetes components
# podMonitorSelector:
# matchLabels:
# monitoring: "true"
# podMonitorNamespaceSelector:
# matchLabels:
# monitoring: "true"
# serviceMonitorSelector:
# matchLabels:
# monitoring: "true"
# serviceMonitorNamespaceSelector:
# matchLabels:
# monitoring: "true"


0 comments on commit 191067c

Please sign in to comment.