<p>Say I have a service that isn't hosted on Kubernetes.  I also have an ingress controller and cert-manager set up on my kubernetes cluster.  </p>

<p>Because it's so much simpler and easy to use kubernetes ingress to control access to services, I wanted to have a kubernetes ingress that points to a non-kubernetes service.  </p>

<p>For example, I have a service that's hosted at <code>https://10.0.40.1:5678</code> (ssl required, but self signed certificate) and want to access at <code>service.example.com</code>.</p>

cclloyd
<p>You <a href="https://github.com/kubernetes/kubernetes/issues/8631#issuecomment-104404768" rel="nofollow noreferrer">can</a> do it by manual creation of Service and Endpoint objects for your external server.</p>
<p>Objects will looks like that:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: external-ip
spec:
  ports:
  - name: app
    port: 80
    protocol: TCP
    targetPort: 5678
  clusterIP: None
  type: ClusterIP
---
apiVersion: v1
kind: Endpoints
metadata:
  name: external-ip
subsets:
- addresses:
  - ip: 10.0.40.1
  ports:
  - name: app
    port: 5678
    protocol: TCP
</code></pre>
<p>Also, it is possible to use an <a href="https://kubernetes.io/docs/concepts/services-networking/service/#custom-endpointslices" rel="nofollow noreferrer">EndpointSlice</a> object instead of Endpoints.</p>
<p>Then, you can create an Ingress object which will point to Service <code>external-ip</code> with port <code>80</code>:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: external-service
spec:
  rules:
  - host: service.example.com
    http:
      paths:
      - backend:
          serviceName: external-ip
          servicePort: 80
        path: /
</code></pre>
