Hi all,
I've been banging my head against a wall and just need a sanity check that what I am trying to do will work.
I've configured Traefik as the only ingress controller in a K8S install on my MAC - and so far everything is great - I can see the dashboard and can create deployments and services and ingresses to the K8S install and route to them correctly using the Traefik ingress controller. Fantastic
One of the things, however when use all this knowledge in my production work is the ability to route to EXTERNAL sources as we have not started migrating all of them to containers etc just yet.
So first things first - I have a REAL cert in the local K8S environment - it's a wildcard cert and so ALL of my traffic is going to https://internal.myserver.cloud/ - note that myserver is NOT the realname
I created a test.yaml that looks like this
---
kind: Service
apiVersion: v1
metadata:
name: pm1-external
spec:
type: ExternalName
ports:
- name: https
port: 443
externalName: subdomain.otherservice.cloud
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pm1-external-ingress
annotations:
kubernetes.io/ingress.class: traefik
traefik.frontend.passHostHeader: "false"
spec:
rules:
- host: internal.myserver.cloud
http:
paths:
- path: /pm1
backend:
serviceName: pm1-external
servicePort: https
I can see that Traefik (in the dashboard at least) has added this as a frontend and is pointing to my other domain - however when I try and use it I get a 502 (bad gateway) issue.
So I thought I would try something really easy (or so I thought) and create an external service just essentially redirecting to GOOGLE
---
kind: Service
apiVersion: v1
metadata:
name: google-external
spec:
type: ExternalName
ports:
- name: https
port: 443
targetPort: 80
externalName: google.com
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: google-ingress
annotations:
kubernetes.io/ingress.class: traefik
traefik.frontend.passHostHeader: "false"
spec:
rules:
- host: internal.myserver.cloud
http:
paths:
- path: /google
backend:
serviceName: google-external
servicePort: https
But that gives me the same error - 502.
Am I doing something stupendously stupid here - or maybe it just does not work quite right using docker-desktop K8S - anyone point me in the right direction.
I've read everything I can find about externalNames and Traefik ingress with external names etc. and I just can't get this one piece working
Thanks in advance