Hi there!
What I need is to set up reverse proxy to external address, just like nginx's "proxypass http://host.com"
There is an application running on http://app01.local:8081, I'd like to make it externally available via http://app01.domain.com using ingress routes. Here is my current setup:
---
apiVersion: v1
kind: Service
metadata:
name: app01-ext
namespace: default
spec:
type: ExternalName
externalName: app01.local
ports:
- port: 8081
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: app01
namespace: default
spec:
mirroring:
name: app01-ext
port: 8081
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: app01-ingress
spec:
entryPoints:
- websecure
routes:
- match: Host(`app02.domain.com`)
kind: Rule
services:
- name: teampass
namespace: default
kind: TraefikService
tls:
certResolver: default
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: app01-ingress-notls
spec:
entryPoints:
- web
routes:
- match: Host(`app01.domain.com`)
kind: Rule
services:
- name: app01
namespace: default
kind: TraefikService
middlewares:
- name: app01-scheme-redirect
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: app01-scheme-redirect
spec:
redirectScheme:
scheme: https
However traefik complains
time="2020-11-03T15:46:51Z" level=error msg="Cannot create service: service not found default/app01" providerName=kubernetescrd ingress=app01-ingress namespace=default serviceName=app01 servicePort=0
time="2020-11-03T15:46:51Z" level=error msg="Cannot create service: service not found default/app01" providerName=kubernetescrd ingress=app01-ingress-notls namespace=default serviceName=app01 servicePort=0
kubectl get traefikservice
NAME AGE
app01 24m
kubect get svc | grep app01
app01-ext ExternalName <none> 10.10.10.10 8081/TCP 25m
Could someone please advice what's wrong with this setup ?