Skip to content

MCPServer podTemplateMetadataOverrides.labels feature is aliased with Deployment labels #2660

@ghaskins

Description

@ghaskins

Problem Description

For the following MCPServer object

apiVersion: toolhive.stacklok.dev/v1alpha1
kind: MCPServer
metadata:
  name: fetch
spec:
  image: ghcr.io/stackloklabs/gofetch/server
  mcpPort: 8080
  port: 8080
  proxyMode: streamable-http
  proxyPort: 8080
  resources:
    limits:
      cpu: 100m
      memory: 128Mi
    requests:
      cpu: 50m
      memory: 64Mi
  transport: streamable-http
  trustProxyHeaders: false
  resourceOverrides:
    proxyDeployment:
      labels:
        foo: "true"
      podTemplateMetadataOverrides:
        labels:
          bar: "true"

I would expect to see a Deployment object like:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    foo: "true"
spec:
  template:
    metadata:
      labels:
        bar: true

However, what I actually get is:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    bar: "true"
spec:
  template:
    metadata:
      labels:

There are two problems:

  1. The PodSpec template.metadata.labels are completely missing
  2. The Deployment metadata labels have been aliased with the labels intended for the PodSpec template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kubernetesItems related to Kubernetes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions