Skip to content

[🐛 Bug]: router Deployment renders duplicate ports sections and drops tcp-metrics port #3152

@KrawczowaKris

Description

@KrawczowaKris

What happened?

After upgrading chart to 0.55.0 version, the router deployment renders two separate ports sections for the same container.

The first section contains the newly added metrics port:

ports:
  - containerPort: 4444
    protocol: TCP
  - name: tcp-metrics
    containerPort: 9615
    protocol: TCP

Later in the same container spec, another ports section is rendered:

ports:
  - containerPort: 4444
    protocol: TCP

As a result, when the manifest is applied to Kubernetes, the metrics port is effectively lost because only the final ports field is preserved.

The issue appears to have been introduced by PR #3135, which added the tcp-metrics port to the router Deployment but left the original ports block in place.

Command used to start Selenium Grid with Docker (or Kubernetes)

monitoring:
  enabled: false
  enabledWithExistingAgent: true
  exporter:
    port: 9615

Relevant log output

# generated template:

apiVersion: apps/v1
kind: Deployment
metadata:
  generation: 11
  labels:
    app: selenium-grid-selenium-router
    app.kubernetes.io/component: selenium-grid-4.44.0-20260505
    app.kubernetes.io/instance: selenium-grid
    app.kubernetes.io/managed-by: helm
    app.kubernetes.io/name: selenium-grid-selenium-router
    app.kubernetes.io/version: 4.44.0-20260505
    helm.sh/chart: selenium-grid-0.55.0
  name: selenium-grid-selenium-router
  namespace: selenium-grid
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: selenium-grid-selenium-router
      app.kubernetes.io/instance: selenium-grid
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: selenium-grid-selenium-router
        app.kubernetes.io/component: selenium-grid-4.44.0-20260505
        app.kubernetes.io/instance: selenium-grid
        app.kubernetes.io/managed-by: helm
        app.kubernetes.io/name: selenium-grid-selenium-router
        app.kubernetes.io/version: 4.44.0-20260505
        helm.sh/chart: selenium-grid-0.55.0
    spec:
      affinity: {}
      containers:
      - env:
        - name: KUBERNETES_NODE_HOST_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.hostIP
        - name: SE_OTEL_SERVICE_NAME
          value: selenium-grid-selenium-router
        - name: SE_OTEL_RESOURCE_ATTRIBUTES
          value: app.kubernetes.io/component=selenium-grid-4.44.0-20260505,app.kubernetes.io/instance=selenium-grid,app.kubernetes.io/managed-by=helm,app.kubernetes.io/version=4.44.0-20260505,helm.sh/chart=selenium-grid-0.55.0
        - name: SE_ROUTER_HOST
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.podIP
        - name: SE_ROUTER_PORT
          value: "4444"
        - name: SE_DISTRIBUTOR_HOST
          value: selenium-grid-selenium-distributor
        - name: SE_DISTRIBUTOR_PORT
          value: "5553"
        - name: SE_SESSIONS_MAP_HOST
          value: selenium-grid-selenium-session-map
        - name: SE_SESSIONS_MAP_PORT
          value: "5556"
        - name: SE_SESSION_QUEUE_HOST
          value: selenium-grid-selenium-session-queue
        - name: SE_SESSION_QUEUE_PORT
          value: "5559"
        envFrom:
        - configMapRef:
            name: selenium-grid-selenium-logging-config
        - configMapRef:
            name: selenium-grid-selenium-server-config
        - secretRef:
            name: selenium-grid-selenium-secrets
        image: selenium/router:4.44.0-20260505
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 30
          httpGet:
            path: /readyz
            port: 4444
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 60
          successThreshold: 1
          timeoutSeconds: 60
        name: selenium-grid-selenium-router
        ports:
        - containerPort: 4444
          protocol: TCP
        readinessProbe:
          failureThreshold: 10
          httpGet:
            path: /readyz
            port: 4444
            scheme: HTTP
          initialDelaySeconds: 12
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
        resources: {}
        startupProbe:
          failureThreshold: 10
          httpGet:
            path: /readyz
            port: 4444
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /opt/bin/routerGraphQLUrl.sh
          name: selenium-grid-selenium-router-config
          subPath: routerGraphQLUrl.sh
        - mountPath: /opt/bin/routerProbe.sh
          name: selenium-grid-selenium-router-config
          subPath: routerProbe.sh
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: selenium-grid-selenium-serviceaccount
      serviceAccountName: selenium-grid-selenium-serviceaccount
      terminationGracePeriodSeconds: 30
      tolerations: []
      volumes:
      - configMap:
          defaultMode: 493
          name: selenium-grid-selenium-router-config
        name: selenium-grid-selenium-router-config

Operating System

Kubernetes (AWS EKS)

Docker Selenium version (image tag)

4.44.0-20260505

Selenium Grid chart version (chart version)

0.55.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions