Skip to content

Commit

Permalink
Add public-samples/trail-project-1-n75ia4/infrastructure/kubernetes/m…
Browse files Browse the repository at this point in the history
…onitoring/grafana/service.yaml
  • Loading branch information
siddhantpp committed Dec 30, 2024
1 parent 1c05232 commit 7df9083
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions infrastructure/kubernetes/monitoring/grafana/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Kubernetes Service manifest for Grafana monitoring dashboard
# Version: kubernetes v1.27+
# Purpose: Exposes Grafana deployment with internal cluster access and load balancing
apiVersion: v1
kind: Service

metadata:
name: grafana-service
namespace: monitoring
labels:
app: grafana
component: monitoring
environment: production
tier: visualization
managed-by: kubernetes
annotations:
monitoring.kubernetes.io/service-name: "grafana"
prometheus.io/scrape: "true"
prometheus.io/port: "3000"

spec:
type: ClusterIP # Internal cluster access only
ports:
- name: http-grafana
port: 3000 # Service port
targetPort: 3000 # Container port
protocol: TCP

# Selector matches pods from grafana deployment
selector:
app: grafana
component: monitoring

# Session affinity configuration for consistent dashboard access
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800 # 3 hour timeout for session stickiness

# Publishing configuration
publishNotReadyAddresses: false

# Internal traffic policy for improved security
internalTrafficPolicy: Cluster

0 comments on commit 7df9083

Please sign in to comment.