2

Is it possible to make the k3s ingress route a certain path to a certain IP or port of a service which is not running inside the Kubernetes, but on same physical machine?

My use-case

Using single node k3s setup.

I have a special server running on the same host that the k3s is running on. I'd like to expose it as an HTTP endpoint in the ingress.

e.g:

foo.example.com --> k3s ingress --> 127.0.0.1:99 (port on k3s machine)

or

foo.example.com --> k3s ingress --> 192.168.1.7:99 (something in the local network)

Is something like this possible or should there be some reverse proxy before the k3s server?

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
Paperclip
  • 615
  • 5
  • 14

1 Answers1

2

Is it possible to make the k3s ingress route a certain path to a certain IP or port of a service which is not running inside the Kubernetes, but on same physical machine?

Yes you can do it with the ExternalName service.

You define one service and it points to specific physical IP outside of the cluster.

apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: ExternalName
  externalName: my.database.example.com//192.168.4.5

Further you can use this service as normal service of Kubernetes but the request will get forwarded to external service.

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102