English 中文(简体)
Unable to betterconfigure gRPC Ingress with Tailcal Kubernetes Conducttor
原标题:Unable to correctly configure gRPC Ingress with Tailscale Kubernetes Operator

班图(2.04.3;5.15.0-1046-实时)的Imper MicroK8s(v1.28.1)

我已安装了Tailcal Kubernetes Conducttor,并能够成功利用这一服务获得非加工业企业服务。

I can/strong> Access the gRPC service using port-forward and using a code> 服务:

kubectl port-forward service/${NAME} 
--namespace=${NAMESPACE} 
50051:50051
grpcurl -plaintext localhost:50051 list
grpc.health.v1.Health
...
grpcurl -plaintext localhost:50051 gprc.health.v1.Health/Check
{
  "status": "SERVING"
}

但是,我无法利用“侵略”获得服务:

GRPC_GO_LOG_VERBOSITY_LEVEL=99 
GRPC_GO_LOG_SEVERITY_LEVEL=info 
grpcurl 
-v 
-connect-timeout 15 
-max-time 20 
${MACHINE}.${TAILNET}.ts.net:443 
grpc.health.v1.Health/Check

Using: Ingress (1 of 2):

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {name}
  namespace: {namespace}
  annotations:
    tailscale.com/hostname: {machine}
spec:
  ingressClassName: tailscale
  defaultBackend:
    service:
      name: {name}
      port:
        number: 50051
  tls:
  - hosts:
    - {machine}

产量:

2023/09/26 12:20:21 INFO: [core] [Channel #1] original dial target is: "{machine}.{tailnet}.ts.net:443"
2023/09/26 12:20:21 INFO: [core] [Channel #1] parsed dial target is: {Scheme:{machine}.{tailnet}.ts.net Authority: Endpoint:443 URL:{Scheme:{machine}.{tailnet}.ts.net Opaque:443 User: Host: Path: RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/09/26 12:20:21 INFO: [core] [Channel #1] fallback to scheme "passthrough"
2023/09/26 12:20:21 INFO: [core] [Channel #1] parsed dial target is: {Scheme:passthrough Authority: Endpoint:{machine}.{tailnet}.ts.net:443 URL:{Scheme:passthrough Opaque: User: Host: Path:/{machine}.{tailnet}.ts.net:443 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/09/26 12:20:21 INFO: [core] [Channel #1] Channel authority set to "{machine}.{tailnet}.ts.net:443"
2023/09/26 12:20:21 INFO: [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "{machine}.{tailnet}.ts.net:443",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Type": 0,
      "Metadata": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2023/09/26 12:20:21 INFO: [core] [Channel #1] Channel switches to new LB policy "pick_first"
2023/09/26 12:20:21 INFO: [core] [Channel #1 SubChannel #2] Subchannel created
2023/09/26 12:20:21 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2023/09/26 12:20:21 INFO: [core] [Channel #1 SubChannel #2] Subchannel picks a new address "{machine}.{tailnet}.ts.net:443" to connect
2023/09/26 12:20:21 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc0007608d0, {CONNECTING <nil>}
2023/09/26 12:20:21 INFO: [core] [Channel #1] Channel Connectivity change to CONNECTING
2023/09/26 12:20:21 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2023/09/26 12:20:21 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc0007608d0, {READY <nil>}
2023/09/26 12:20:21 INFO: [core] [Channel #1] Channel Connectivity change to READY
Error invoking method "grpc.health.v1.Health/Check": rpc error: code = DeadlineExceeded desc = failed to query for service descriptor "grpc.health.v1.Health": context deadline exceeded
2023/09/26 12:20:41 INFO: [core] [Channel #1] Channel Connectivity change to SHUTDOWN
2023/09/26 12:20:41 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to SHUTDOWN
2023/09/26 12:20:41 INFO: [core] [Channel #1 SubChannel #2] Subchannel deleted
2023/09/26 12:20:41 INFO: [core] [Channel #1] Channel deleted

failed to query for service descriptor "grpc.health.v1.Health>

以及<代码>尾部 姓名: 操作员-翻新服务记录:

SERVICE=$(
  kubectl get service 
  --selector="tailscale.com/parent-resource=${NAME},tailscale.com/parent-resource-ns=${NAMESPACE}" 
  --namespace=tailscale 
  --output=jsonpath="{.items[0].metadata.name}")

kubectl logs service/${SERVICE} 
--namespace=tailscale
...
2023/09/26 19:18:28 http: proxy error: stream error: stream ID 1; CANCEL
...

And using: Ingress (2 of 2):

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {name}
  namespace: {namespace}
  annotations:
    tailscale.com/hostname: {machine}
spec:
  ingressClassName: tailscale
  rules:
  - host: {machine}.{tailnet}.ts.net
    http:
      paths:
      - backend:
          service:
            name: {name}
            port:
              number: 50051
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - {machine}

产量:

2023/09/26 12:27:48 INFO: [core] [Channel #1] Channel created
2023/09/26 12:27:48 INFO: [core] [Channel #1] original dial target is: "{machine}.{tailnet}.ts.net:443"
2023/09/26 12:27:48 INFO: [core] [Channel #1] parsed dial target is: {Scheme:{machine}.{tailnet}.ts.net Authority: Endpoint:443 URL:{Scheme:{machine}.{tailnet}.ts.net Opaque:443 User: Host: Path: RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/09/26 12:27:48 INFO: [core] [Channel #1] fallback to scheme "passthrough"
2023/09/26 12:27:48 INFO: [core] [Channel #1] parsed dial target is: {Scheme:passthrough Authority: Endpoint:{machine}.{tailnet}.ts.net:443 URL:{Scheme:passthrough Opaque: User: Host: Path:/{machine}.{tailnet}.ts.net:443 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/09/26 12:27:48 INFO: [core] [Channel #1] Channel authority set to "{machine}.{tailnet}.ts.net:443"
2023/09/26 12:27:48 INFO: [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "{machine}.{tailnet}.ts.net:443",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Type": 0,
      "Metadata": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2023/09/26 12:27:48 INFO: [core] [Channel #1] Channel switches to new LB policy "pick_first"
2023/09/26 12:27:48 INFO: [core] [Channel #1 SubChannel #2] Subchannel created
2023/09/26 12:27:48 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2023/09/26 12:27:48 INFO: [core] [Channel #1 SubChannel #2] Subchannel picks a new address "{machine}.{tailnet}.ts.net:443" to connect
2023/09/26 12:27:48 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc0006b86d0, {CONNECTING <nil>}
2023/09/26 12:27:48 INFO: [core] [Channel #1] Channel Connectivity change to CONNECTING
2023/09/26 12:28:01 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2023/09/26 12:28:01 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc0006b86d0, {READY <nil>}
2023/09/26 12:28:01 INFO: [core] [Channel #1] Channel Connectivity change to READY
Error invoking method "grpc.health.v1.Health/Check": failed to query for service descriptor "grpc.health.v1.Health": server does not support the reflection API
2023/09/26 12:28:01 INFO: [core] [Channel #1] Channel Connectivity change to SHUTDOWN
2023/09/26 12:28:01 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to SHUTDOWN
2023/09/26 12:28:01 INFO: [core] [Channel #1 SubChannel #2] Subchannel deleted
2023/09/26 12:28:01 INFO: [core] [Channel #1] Channel deleted

<编码> 援引“grpc.health.v1.Health/Check”方法的错误:没有就服务描述者“grpc.health.v1.Health”提出质询: 服务器不支持文体

And, if I provide the service descriptor:

GRPC_GO_LOG_VERBOSITY_LEVEL=99 
GRPC_GO_LOG_SEVERITY_LEVEL=info 
grpcurl 
-v 
-connect-timeout 15 
-max-time 20 
-proto health.proto 
${MACHINE}.${TAILNET}.ts.net:443 grpc.health.v1.Health/Check
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel created
2023/09/26 15:23:13 INFO: [core] [Channel #1] original dial target is: "{machine}.{tailnet}.ts.net:443"
2023/09/26 15:23:13 INFO: [core] [Channel #1] parsed dial target is: {Scheme:{machine}.{tailnet}.ts.net Authority: Endpoint:443 URL:{Scheme:{machine}.{tailnet}.ts.net Opaque:443 User: Host: Path: RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/09/26 15:23:13 INFO: [core] [Channel #1] fallback to scheme "passthrough"
2023/09/26 15:23:13 INFO: [core] [Channel #1] parsed dial target is: {Scheme:passthrough Authority: Endpoint:{machine}.{tailnet}.ts.net:443 URL:{Scheme:passthrough Opaque: User: Host: Path:/{machine}.{tailnet}.ts.net:443 RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel authority set to "{machine}.{tailnet}.ts.net:443"
2023/09/26 15:23:13 INFO: [core] [Channel #1] Resolver state updated: {
  "Addresses": [
    {
      "Addr": "{machine}.{tailnet}.ts.net:443",
      "ServerName": "",
      "Attributes": null,
      "BalancerAttributes": null,
      "Type": 0,
      "Metadata": null
    }
  ],
  "ServiceConfig": null,
  "Attributes": null
} (resolver returned new addresses)
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel switches to new LB policy "pick_first"
2023/09/26 15:23:13 INFO: [core] [Channel #1 SubChannel #2] Subchannel created
2023/09/26 15:23:13 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING
2023/09/26 15:23:13 INFO: [core] [Channel #1 SubChannel #2] Subchannel picks a new address "{machine}.{tailnet}.ts.net:443" to connect
2023/09/26 15:23:13 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc000615ab0, {CONNECTING <nil>}
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel Connectivity change to CONNECTING
2023/09/26 15:23:13 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY
2023/09/26 15:23:13 INFO: [core] pickfirstBalancer: UpdateSubConnState: 0xc000615ab0, {READY <nil>}
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel Connectivity change to READY

Resolved method descriptor:
// If the requested service is unknown, the call will fail with status
// NOT_FOUND.
rpc Check ( .grpc.health.v1.HealthCheckRequest ) returns ( .grpc.health.v1.HealthCheckResponse );

Request metadata to send:
(empty)

Response headers received:
(empty)

Response trailers received:
(empty)
Sent 0 requests and received 0 responses
ERROR:
  Code: Unimplemented
  Message: unexpected HTTP status code received from server: 404 (Not Found); transport: received unexpected content-type "text/plain; charset=utf-8"
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel Connectivity change to SHUTDOWN
2023/09/26 15:23:13 INFO: [core] [Channel #1 SubChannel #2] Subchannel Connectivity change to SHUTDOWN
2023/09/26 15:23:13 INFO: [core] [Channel #1 SubChannel #2] Subchannel deleted
2023/09/26 15:23:13 INFO: [core] [Channel #1] Channel deleted

<代码>Message:从服务器收到出乎意料的《吉大港山区地位法》:404 (无创始);运输:收到意外内容类型的“文字/解释;果园=utf-8”

这些通话给加拿大退休人员协会背书。

此外,没有明显错误,由“快车驾驶员”服务公司证明:

2023/09/26 22:23:13 Accept: TCP{{host-ip}:60882 > {machine-ip}:443} 60 tcp ok
2023/09/26 22:23:13 Accept: TCP{{host-ip}:60882 > {machine-ip}:443} 52 tcp non-syn
2023/09/26 22:23:13 Accept: TCP{{host-ip}:60882 > {machine-ip}:443} 339 tcp non-syn
2023/09/26 22:23:13 magicsock: disco: node [9uhAS] d:45fb4757e8c760ae now using 172.17.0.1:41641
问题回答

由于Tailcal支持,不可能使用Aingress w/ gRPC。

因此,没有从TLS公司的Tailcal实现服务自动化。

解决办法是使用

该处可以添加<代码>说明,以具体说明东道名称:

annotations:
  tailscale.com/hostname: {hostname}




相关问题
HTTP call from Celery worker

I am running a Flask-Celery server in docker desktop Kubernetes. It uses a Redis Result Backend. I want to use a Celery Task to make an HTTP call to a program that might take a while. This program ...

Why my website cookies are not being set on my browser?

Hello I am developing a web app, with a microservices architecture. I am using golang (Fiber) on the backend and Next.js on the frontend. When I send a request from restaurant.quiqr.co/signin to api....

我如何终止Kubernetes的名称空间?

我正试图终止Kubernetes的名称空间。 过去,我uc切地遵循了在库韦涅斯这里发现的在终止地位方面摇摇摇欲坠的空地。

helm with if condition and its scope for the value set

I would like to overwrite the user template with .Values.userTemplate if it exist. But I always get $user as undefined when the .Vaues.userTemplate exist. If i remove if condition and use {{- $user := ...