You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

K8s中OpenTelemetry Collector端口55679转发连接被拒求助

OKE集群部署OpenTelemetry Collector端口转发问题

通过OpenTelemetry Helm Chart部署Collector到OKE集群后,对Pod的55679端口执行端口转发时失败,错误信息如下:

E0607 13:04:55.415015 48206 portforward.go:407] an error occurred forwarding 55679 -> 55679: 
error forwarding port 55679 to pod 0f6ea4c9367d6748039fd42da1b7c08c43f1d442859aff087c0c061a0a27d6ff, uid : port forward into network namespace "/var/run/netns/483d52c1-0107-4dbc-9153-d47a6bc64779": failed to connect to localhost:55679 inside namespace 0f6ea4c9367d6748039fd42da1b7c08c43f1d442859aff087c0c061a0a27d6ff: dial tcp [::1]:55679: connect: connection refused
E0607 13:04:55.416590   48206 portforward.go:233] lost connection to pod

Pod暴露的其他端口(如4318)端口转发可正常工作。已知OpenTelemetry Helm Chart在v0.47.0版本中将监听IP从0.0.0.0改为PodIP,导致端口转发失效,改回0.0.0.0后4318恢复正常,但55679端口问题仍存在。

Pod规格信息

Name:             otel-opentelemetry-collector-65cc995479-rkz97
Namespace:        monitoring
Priority:         0
Service Account:  opentelemetry-collector
Node:             10.36.92.85/10.36.92.85
Start Time:       Wed, 07 Jun 2023 12:54:17 +0530
Labels:           app=opentelemetry-collector
                  app.kubernetes.io/instance=otel
                  app.kubernetes.io/name=opentelemetry-collector
                  component=standalone-collector
                  environment=test
                  pod-template-hash=65cc995479
Annotations:      checksum/config: 622eb05ba3357fc2b4a4e4dc4afa8e1da114f69335daaadd932c4f906f073941
Status:           Running
IP:               100.64.0.124
IPs:
  IP:           100.64.0.124
Controlled By:  ReplicaSet/otel-opentelemetry-collector-65cc995479
Containers:
  opentelemetry-collector:
    Container ID:  cri-o://e5ea6e6b499d0a036d5e5a073b78b2f3df416440c6ae767c48f7f0612d5c8102
    Image:         otel/opentelemetry-collector-contrib@sha256:42e8ba40f9f70d604684c3a2a0ed321206b7e2e3509fdb2c8836d34f2edfb57b
    Image ID:      docker.io/otel/opentelemetry-collector-contrib@sha256:2746e53e8f510d5c2f30a8c805c904e9d22257fd9bec4ddfed2776d55fabeb06
    Ports:         8006/TCP, 8889/TCP, 4317/TCP, 4318/TCP, 55679/TCP
    Host Ports:    0/TCP, 0/TCP, 0/TCP, 0/TCP, 0/TCP
    Command:
      /otelcol-contrib
      --config=/conf/relay.yaml
    State:          Running
      Started:      Wed, 07 Jun 2023 12:54:18 +0530
    Ready:          True
    Restart Count:  0
    Liveness:       http-get http://:13133/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Readiness:      http-get http://:13133/ delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:
      MY_POD_IP:   (v1:status.podIP)
    Mounts:
      /conf from opentelemetry-collector-configmap (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-rvkhs (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  opentelemetry-collector-configmap:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      otel-opentelemetry-collector
    Optional:  false
  kube-api-access-rvkhs:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age    From               Message
  ----     ------     ----   ----               -------
  Normal   Scheduled  2m34s  default-scheduler  Successfully assigned monitoring/otel-opentelemetry-collector-65cc995479-rkz97 to 10.36.92.85
  Normal   Pulled     2m34s  kubelet            Container image "otel/opentelemetry-collector-contrib@sha256:42e8ba40f9f70d604684c3a2a0ed321206b7e2e3509fdb2c8836d34f2edfb57b" already present on machine
  Normal   Created    2m34s  kubelet            Created container opentelemetry-collector
  Normal   Started    2m34s  kubelet            Started container opentelemetry-collector
  Warning  Unhealthy  2m34s  kubelet            Readiness probe failed: Get "http://100.64.0.124:13133/": dial tcp 100.64.0.124:13133: connect: connection refused

更新信息

  • 本地主机curl Pod的4318端口可正常工作
  • MAC的Docker容器内使用host.docker.internal访问主机4318端口时,出现类似连接被拒错误
  • 端口转发时添加--address 0.0.0.0参数无效

总结:MAC本地主机curl可成功,但MAC上Docker容器内访问失败。

内容的提问来源于stack exchange,提问作者Siddhant

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 20:07:05