Repository navigation
Description
Update 2026-11-26 (infra move): k8s/monitoring/prometheus-values.yaml is now in dan-petty/homelab.
- Put
McpServerDownin the product rules,k8s/devops/monitoring/prometheus-rules-values.yaml. k8s/devops/mcp-server/already holds a Deployment, a Service and NetworkPolicies, and themcp-serverimage target exists. Check what is still missing before you build.
Split from #3220.
Problem: The repository has no Kubernetes manifest set for the MCP server. The roadmap jobs cannot reach a role-scoped server, and other pods are not blocked from calling it. Why deferred: The MCP server entrypoint from the related issue feat(mcp): serve role-scoped tool sets over authenticated HTTP is not in the repository at the staging commit. A Deployment would start a container with no server process. The image target lands first in this issue. Acceptance criteria: - k8s/devops/mcp-server/ SHALL hold a Deployment, a Service, a ServiceAccount, a Role and a NetworkPolicy. - The Deployment SHALL run one replica until the server proves stateless streamable HTTP. - The NetworkPolicy SHALL allow ingress only from pods labeled app.kubernetes.io/name: devops-cli-job and app.kubernetes.io/name: roadmap-service. - The NetworkPolicy SHALL name each allowed egress destination and port, and SHALL have no rule that allows all egress. - The pod SHALL run as non-root with a read-only root filesystem. - The Deployment SHALL set OTEL_SERVICE_NAME to mcp-server. - A test SHALL fail when the Role grants a verb other than get, list or watch. - The Service SHALL be a ClusterIP Service, and no Ingress SHALL name it. - The monitoring rules SHALL add McpServerDown on `up{job=
Proposed design
Problem statement
The repository has no Kubernetes manifest set for the MCP server. The roadmap jobs cannot reach a role-scoped server, and other pods are not blocked from calling it. This issue adds the Deployment, Service, ServiceAccount, Role and NetworkPolicy. It also adds the image target, the Role verb test and the McpServerDown alert.
Acceptance criteria
Requirement: Manifest set
k8s/devops/mcp-server/ SHALL hold a Deployment, a Service, a ServiceAccount, a Role and a NetworkPolicy.
Scenario: Manifest kinds
- WHEN The test parses the files under
k8s/devops/mcp-server/. - THEN The set contains exactly one Deployment, one Service, one ServiceAccount, one Role and one NetworkPolicy.
Requirement: Single replica
The Deployment SHALL run one replica until the server proves stateless streamable HTTP.
Scenario: Replica count
- WHEN The test reads the Deployment spec.
- THEN
spec.replicasis1.
Requirement: Ingress peers
The NetworkPolicy SHALL allow ingress only from pods labeled app.kubernetes.io/name: devops-cli-job and app.kubernetes.io/name: roadmap-service.
Scenario: Allowed ingress labels
- WHEN The test reads the NetworkPolicy ingress rules.
- THEN Every ingress peer selects one of those two label values, and no rule selects another pod.
Requirement: Explicit egress
The NetworkPolicy SHALL name each allowed egress destination and port, and SHALL have no rule that allows all egress.
Scenario: Egress rule shape
- WHEN The test reads the NetworkPolicy egress rules.
- THEN Every egress rule has a non-empty
toand a non-emptyports, and no rule has an emptytoorports.
Requirement: Pod security
The pod SHALL run as non-root with a read-only root filesystem.
Scenario: Security context
- WHEN The test reads the Deployment pod and container security contexts.
- THEN
runAsNonRootistrueandreadOnlyRootFilesystemistrue.
Requirement: OTEL service name
The Deployment SHALL set OTEL_SERVICE_NAME to mcp-server.
Scenario: OTEL environment variable
- WHEN The test reads the container environment variables.
- THEN
OTEL_SERVICE_NAMEequalsmcp-server.
Requirement: Role verb test
A test SHALL fail when the Role grants a verb other than get, list or watch.
Scenario: Forbidden Role verb
- WHEN The Role test runs against a Role with the verb
create. - THEN The test fails and names the forbidden verb.
Requirement: ClusterIP only
The Service SHALL be a ClusterIP Service, and no Ingress SHALL name it.
Scenario: Service exposure
- WHEN The test reads the Service and all Ingress manifests.
- THEN The Service type is
ClusterIP, and no Ingress backend names the Service.
Requirement: MCP server down alert
The monitoring rules SHALL add McpServerDown on up{job="mcp-server"} == 0.
Scenario: Alert rule
- WHEN The test parses the PrometheusRule.
- THEN An alert named
McpServerDownexists with that expression.
Requirement: MCP server image target
The Dockerfile SHALL define an mcp-server target that runs the MCP server HTTP entrypoint.
Scenario: Image target
- WHEN The test parses the Dockerfile.
- THEN A stage named
mcp-serverexists and its entrypoint invokes the MCP server command.
Existing Tool Considered
No alternatives check has run. The repository keeps raw Kubernetes manifests under k8s/devops/. No open tool covers this specific manifest set. kube-linter validates YAML. It does not write the Deployment, RBAC, NetworkPolicy or the Role verb test. Building and keeping the YAML and test by hand costs about 3,000 tokens and one hour.
Key questions
- Which directory and file layout should hold the MCP server manifests?: Use
k8s/devops/mcp-server/with one YAML file for each kind, ask8s/devops/roadmap-service/does. (best practice) [sources: k8s/devops/roadmap-service/deployment.yaml, k8s/devops/cronjob-runner.yaml]- Chosen: Separate files for each kind. The existing
k8s/devops/manifests use separate files for each kind. - Rejected: One combined YAML file. It departs from the existing layout and makes the Role test parse more complex.
- Chosen: Separate files for each kind. The existing
- Which namespace and labels should the manifests use?: Use namespace
devopsand labelapp.kubernetes.io/name: mcp-server. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, k8s/devops/roadmap-service/deployment.yaml]- Chosen:
devopsnamespace withapp.kubernetes.io/name: mcp-server. ADR 0004 places the service Secret in namespacedevops, and existing manifests useapp.kubernetes.io/name. - Rejected:
defaultnamespace. It departs from the existing deployment namespace. - Rejected: A new
mcpnamespace. No repository evidence supports a new namespace.
- Chosen:
- Does this issue wait on the MCP server entrypoint issue?: No. The repository already has
tests/ai/mcp/test_mcp_http.py, so the HTTP entrypoint is present. This issue adds manifests for that entrypoint. [sources: tests/ai/mcp/test_mcp_http.py, tests/ai/mcp/test_fastmcp_contracts.py] - Which command and HTTP port should the Deployment and Service use?: Use the MCP server HTTP entrypoint and its port. The existing
tests/ai/mcp/test_mcp_http.pyshows the HTTP transport. (best practice) [sources: tests/ai/mcp/test_mcp_http.py, tests/ai/mcp/test_fastmcp_contracts.py]- Chosen: Reuse the existing MCP HTTP entrypoint and its port. The repository already tests an MCP HTTP server, so the Deployment must not start a second command.
- Rejected: Add a new command and port in this issue. The issue deploys manifests and does not add a server process.
- How should the NetworkPolicy restrict ingress?: Set
policyTypestoIngressandEgress. Allow ingress only from pods in namespacedevopswithapp.kubernetes.io/nameequal todevops-cli-joborroadmap-service. Deny all other ingress. (best practice) [sources: k8s/devops/roadmap-service/deployment.yaml, k8s/devops/cronjob-runner.yaml]- Chosen: Label selectors for the two callers. The issue names the two caller labels and the existing manifests set them.
- Rejected: Allow all pods in the
devopsnamespace. It admits pods that the issue does not name. - Rejected: Allow all ingress. It defeats the purpose of the NetworkPolicy.
- Which egress destinations and ports should the NetworkPolicy allow?: Allow only DNS to
kube-systemon UDP and TCP 53, the Kubernetes API on TCP 443 for the Role'sget,listandwatch, and the OTLP collector endpoint that the existing deployments use. Add no all-egress rule. (best practice) [sources: k8s/devops/roadmap-service/deployment.yaml, k8s/monitoring/prometheus-values.yaml]- Chosen: Explicit DNS, Kubernetes API and OTLP rules. The server needs DNS, the Role needs the API, and
OTEL_SERVICE_NAMEneeds the collector. - Rejected: Allow all egress. The issue forbids a rule that allows all egress.
- Chosen: Explicit DNS, Kubernetes API and OTLP rules. The server needs DNS, the Role needs the API, and
- How should the Role verb restriction be tested?: Add a test under
tests/k8s/that parses the Role and fails if any rule has a verb outsideget,listandwatch. (best practice) [sources: tests/k8s/test_kubernetes_contract.py, tests/k8s/test_k8s_service.py]- Chosen: A dedicated Role parsing test. The repository already has Kubernetes contract tests, and kube-linter cannot enforce this verb allowlist.
- Rejected: Rely on kube-linter. kube-linter does not fail on an extra Role verb.
- Where should the
McpServerDownalert live?: AddMcpServerDowntok8s/devops/monitoring/prometheus-rules-values.yaml, with expressionup{job="mcp-server"} == 0. (best practice) [sources: k8s/monitoring/prometheus-values.yaml, tests/prometheus/test_k8s_monitoring_alerting.py]- Chosen: Add the alert to the existing PrometheusRule. The repository keeps monitoring rules there and already tests them.
- Rejected: Create a new PrometheusRule. It splits related alerts and departs from the existing monitoring layout.
- Should the image target be part of this issue?: Yes. Add a Dockerfile stage named
mcp-serverthat runs the MCP HTTP entrypoint, as the body says the image target lands first in this issue. (best practice) [sources: tests/ai/mcp/test_mcp_http.py, tests/ai/mcp/test_docker_cosign.py]- Chosen: Add the image target in this issue. The issue body says the image target lands first in this issue.
- Rejected: Defer the image target to a new issue. It would leave the Deployment with no image to run.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(k8s)scope of the title gives the scope.The work is blocked on the MCP server entrypoint landing first, so it is needed but not immediately actionable.Without these manifests the roadmap jobs cannot reach a role-scoped MCP server in the cluster.Five manifest kinds, a security test, and a monitoring rule must be written and reviewed.Both add manifests in k8s/devops/mcp-server/, but the candidate is a sibling split from #3220 with its own acceptance criteria.devops-cli-service commentedon Nov 6, 2026
Refine cannot set this item to Ready at bd65ef6. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.
false_premiseat key_questions: Does this issue wait on the MCP server entrypoint issue?: The plan infers that the entrypoint exists because a test file exists. The issue says the entrypoint is not in the repository, and nothing in the input shows it. The Deployment and the image target may start a container with no server process. Evidence: "The repository already hastests/ai/mcp/test_mcp_http.py, so the HTTP entrypoint is present."[-]feat(k8s): deploy the MCP server manifests when the server entrypoint exists[/-][+]feat(k8s): deploy MCP server manifests when entrypoint exists[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 65 characters, and the limit is 60. The type and the scope stay.
feat(k8s): deploy the MCP server manifests when the server entrypoint existsfeat(k8s): deploy MCP server manifests when entrypoint exists