How to implement a gRPC with http and https


I am using traefik 2.9 version in K3S where traefik comes by default. So, I am using Kubernetes CRD whic has different source files ...

I am trying to achieve http scenario where we don't have any certs.

I have seen some scenarios being mentioned here for gRPC... Traefik Proxy gRPC Examples - Traefik but they are not in kuberentes friendly files , I somehow managed to create Kubernetes files but couldn't make it to work. I am using one instance of K3S and using an ip instead of domain name...

Is there any documentation for Kubernetes CRD for these sceanarios ?

Below is my config

kind: IngressRoute
  name: traefik-ingress-route
  namespace: {{ .Values.application.namespace }}
    - web
    - match: Host(`x.x.x.x')
      kind: Rule
        - name: {{ .Values.application.service_name }}
          namespace: {{ .Values.application.namespace }}
          port: 9999
          scheme: h2c
          passHostHeader: true

apiVersion: v1
kind: Service
  name: {{ .Values.application.service_name }}
  namespace: {{ .Values.application.namespace }}
    # '{"grpc-api-port":"HTTP2"}'
    # '{"grpc-api-port": "rpc-config"}'
    # '{"ports": {"grpc-api-port": "rpc-config"}}'
    # '{"ingress": true}' h2c
    # - port: {{ .Values.application.port }}
    - port: 9999
      protocol: TCP
      targetPort: grpc-tunnel
      name: grpc-api-port
    {{- include "application_labels" .| indent 4 }}
  sessionAffinity: None
  type: {{ .Values.application.service_type }}```

I can see that , in the dashboard everything looks good. When I point my mock client to x.x.x.x:8000 port, it doesn't work.


I am running into a similar issue with connecting to a grpc server on k3s. I am able to connect through HTTPS but am having no luck getting an h2c to work on Traefik. Did you ever figure it out?

First of all I would start with the latest release of Traefik (link), as it is in continuous development.