Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I have multiple services I get multiple inbounds with the same port #12123

Open
lahabana opened this issue Nov 27, 2024 · 1 comment
Open
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@lahabana
Copy link
Contributor

What happened?

with:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-app
  namespace: kuma-demo
  labels:
    app: demo-app
    version: v1
spec:
  selector:
    matchLabels:
      app: demo-app
      version: v1
  replicas: 1
  template:
    metadata:
      labels:
        app: demo-app
        version: v1
    spec:
      containers:
        - name: app
          image: ghcr.io/kumahq/kuma-counter-demo:latest
          env:
            - name: OTEL_SERVICE_NAME
              value: demo-app
            - name: OTEL_EXPORTER_OTLP_ENDPOINT
              value: http://opentelemetry-collector.mesh-observability:4317
            - name: KV_URL
              value: "http://kv.kuma-demo.svc.cluster.local:5050"
            - name: APP_VERSION
              valueFrom:
                fieldRef:
                  fieldPath: metadata.labels['version']
          ports:
            - name: http
              containerPort: 5050
---
apiVersion: v1
kind: Service
metadata:
  name: demo-app
  namespace: kuma-demo
spec:
  selector:
    app: demo-app
  ports:
  - protocol: TCP
    appProtocol: http
    port: 5050
    targetPort: 5050
---
apiVersion: v1
kind: Service
metadata:
  name: demo-app-v1
  namespace: kuma-demo
spec:
  selector:
    app: demo-app
    version: v1
  ports:
    - protocol: TCP
      appProtocol: http
      port: 5050
      targetPort: 5050

I get:

type: Dataplane
mesh: default
name: demo-app-6c79d867f8-wlbww.kuma-demo
labels:
  k8s.kuma.io/namespace: kuma-demo
  kuma.io/display-name: demo-app-6c79d867f8-wlbww
  kuma.io/env: kubernetes
  kuma.io/mesh: default
  kuma.io/origin: zone
  kuma.io/zone: default
networking:
  address: 10.42.0.17
  inbound:
    - port: 5050
      tags:
        app: demo-app
        k8s.kuma.io/namespace: kuma-demo
        k8s.kuma.io/service-name: demo-app
        k8s.kuma.io/service-port: '5050'
        kubernetes.io/hostname: k3d-k3s-default-server-0
        kuma.io/protocol: http
        kuma.io/service: demo-app_kuma-demo_svc_5050
        kuma.io/zone: default
        pod-template-hash: 6c79d867f8
        version: v1
      health:
        ready: true
    - port: 5050
      tags:
        app: demo-app
        k8s.kuma.io/namespace: kuma-demo
        k8s.kuma.io/service-name: demo-app-v1
        k8s.kuma.io/service-port: '5050'
        kubernetes.io/hostname: k3d-k3s-default-server-0
        kuma.io/protocol: http
        kuma.io/service: demo-app-v1_kuma-demo_svc_5050
        kuma.io/zone: default
        pod-template-hash: 6c79d867f8
        version: v1
      health:
        ready: true
  transparentProxying:
    redirectPortInbound: 15006
    redirectPortOutbound: 15001
    ipFamilyMode: DualStack
  admin:
    port: 9901
probes:
  port: 9000

So I have 1 inbounds with the same port. This has a couple of problems:

  • Where is the traffic actually routed to?
  • The underlying xds conf ends up with a single cluster and listener so there's little sense in having multiple inbounds...
@lahabana lahabana added triage/pending This issue will be looked at on the next triage meeting kind/bug A bug labels Nov 27, 2024
@bartsmykla bartsmykla added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels Dec 2, 2024
@lahabana
Copy link
Contributor Author

lahabana commented Dec 2, 2024

Some options to get out:

  • Ignore until we rework dataplane definition
  • Add possibility to pick a "main" service and just ignore the others
  • Ignore if there are dupped ports?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

No branches or pull requests

2 participants