infrapuzzle/k8s/n8n/garmin-mcp.yaml

78 lines
2.3 KiB
YAML

# --- 1. Secret to hold your Garmin Connect token ---
# You must create this secret before applying the rest of the manifest.
# Replace 'your_base64_encoded_token_here' with your actual token encoded in Base64.
# To encode your token, run: echo -n 'your_token_from_login' | base64
# apiVersion: v1
# kind: Secret
# metadata:
# name: garth-mcp-secret
# namespace: default
# type: Opaque
# data:
# # This key MUST be GARTH_TOKEN to match the application's environment variable
# GARTH_TOKEN: your_base64_encoded_token_here
---
# --- 2. Deployment for the Garth MCP Server ---
# This will create a Pod running the server application.
apiVersion: apps/v1
kind: Deployment
metadata:
name: garth-mcp-server-deployment
namespace: n8n
labels:
app: garth-mcp-server
spec:
replicas: 1
selector:
matchLabels:
app: garth-mcp-server
template:
metadata:
labels:
app: garth-mcp-server
spec:
containers:
- name: garth-mcp-server
# Use a standard Python slim image as a base
image: python:3.11-slim
# The command first installs the 'uv' tool, then uses 'uvx' to run the server.
# It's configured to listen on all interfaces (0.0.0.0) inside the container.
command: ["/bin/sh", "-c"]
args:
- "pip install -U garth-mcp-server && garth-mcp-server --host 0.0.0.0 --port 8080"
ports:
- name: http
containerPort: 8080
protocol: TCP
envFrom:
# Load environment variables from the Secret created above
- secretRef:
name: garth-token-secret
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "250m"
---
# --- 3. Service to expose the Deployment ---
# This creates a stable internal endpoint for the server.
apiVersion: v1
kind: Service
metadata:
name: garth-mcp-service
namespace: n8n
spec:
selector:
app: garth-mcp-server
ports:
- name: http
protocol: TCP
# The port the service will be available on within the cluster
port: 80
# The port on the container that the service will forward traffic to
targetPort: 8080
# ClusterIP is the default, but we're explicit here.
# This service is only reachable from within the Kubernetes cluster.
type: ClusterIP