Bootstrap initial repo state

This commit is contained in:
2025-09-07 23:39:44 +02:00
parent 0ed92847f8
commit ed68e97829
20 changed files with 437 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: mcp-telemetry-bridge
description: MCP Telemetry Bridge for TeleMcp
type: application
version: 0.1.0
appVersion: "0.1.0"

View File

@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mcp-telemetry-bridge
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels: { app: mcp-telemetry-bridge }
template:
metadata:
labels: { app: mcp-telemetry-bridge }
spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
containers:
- name: bridge
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8000
env:
{{- range .Values.env }}
- name: {{ .name }}
value: "{{ .value }}"
{{- end }}
readinessProbe:
httpGet: { path: /healthz, port: http }
initialDelaySeconds: 3
periodSeconds: 5
livenessProbe:
httpGet: { path: /healthz, port: http }
initialDelaySeconds: 10
periodSeconds: 10
resources:
{{ toYaml .Values.resources | indent 12 }}

View File

@@ -0,0 +1,21 @@
{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: mcp-telemetry-bridge-deny-all
spec:
podSelector:
matchLabels:
app: mcp-telemetry-bridge
policyTypes: ["Ingress","Egress"]
ingress:
- {} # allow same-namespace by default; tighten as needed
egress:
- to:
- namespaceSelector: {}
ports:
- protocol: TCP
port: 9090 # Prometheus
- protocol: TCP
port: 3100 # Loki
{{- end }}

View File

@@ -0,0 +1,26 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: mcp-telemetry-readonly
rules:
- apiGroups: [""]
resources: ["pods","pods/log","nodes","events","namespaces","services","endpoints"]
verbs: ["get","list","watch"]
- apiGroups: ["apps"]
resources: ["deployments","daemonsets","statefulsets","replicasets"]
verbs: ["get","list","watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: mcp-telemetry-readonly-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: mcp-telemetry-readonly
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount.name }}
namespace: {{ .Release.Namespace }}
{{- end }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: mcp-telemetry-bridge
spec:
selector: { app: mcp-telemetry-bridge }
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: 8000
type: {{ .Values.service.type }}

View File

@@ -0,0 +1,6 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.name }}
{{- end }}

View File

@@ -0,0 +1,37 @@
image:
repository: ghcr.io/example/telemcp-bridge
tag: "0.1.0"
pullPolicy: IfNotPresent
replicaCount: 1
service:
type: ClusterIP
port: 80
env:
- name: PROM_URL
value: "http://monitoring-kube-prometheus-prometheus.monitoring:9090"
- name: LOKI_URL
value: "http://loki.logging:3100"
- name: K8S_API
value: "https://kubernetes.default.svc"
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
rbac:
create: true
serviceAccount:
create: true
name: mcp-telemetry
networkPolicy:
enabled: true
allowFromNamespaces: [] # add namespace selectors if needed

View File

@@ -0,0 +1,25 @@
kube-state-metrics:
enabled: true
prometheus:
prometheusSpec:
retention: 5d
scrapeInterval: 15s
enableAdminAPI: false
resources:
requests:
cpu: 100m
memory: 512Mi
alertmanager:
alertmanagerSpec:
replicas: 1
defaultRules:
create: true
rules:
kubeApiserverError: true
kubeNodeNotReady: true
kubePodCrashLooping: true
kubeJobFailed: true
etcdHighNumberOfFailedGRPCRequests: true

View File

@@ -0,0 +1,15 @@
loki:
auth_enabled: false
commonConfig:
replication_factor: 1
storage:
type: filesystem
schemaConfig:
configs:
- from: "2024-01-01"
store: boltdb-shipper
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h

View File

@@ -0,0 +1,22 @@
mode: deployment
config:
receivers:
otlp:
protocols: { http: {}, grpc: {} }
processors:
batch: {}
exporters:
prometheusremotewrite:
endpoint: "http://monitoring-kube-prometheus-prometheus.monitoring:9090/api/v1/write"
loki:
endpoint: "http://loki.logging:3100/loki/api/v1/push"
service:
pipelines:
metrics:
receivers: [otlp]
processors: [batch]
exporters: [prometheusremotewrite]
logs:
receivers: [otlp]
processors: [batch]
exporters: [loki]