简体   繁体   中英

How to publicly expose Traefik ingress controller on Google Cloud Container Engine?

I've been trying to use Traefik as an Ingress Controller on Google Cloud's container engine.

I got my http deployment/service up and running (when I exposed it with a normal LoadBalancer, it was answering fine).

I then removed the LoadBalancer, and followed this tutorial: https://docs.traefik.io/user-guide/kubernetes/

So I got a new traefik-ingress-controller deployment and service, and an ingress for traefik's ui which I can access through the kubectl proxy.

I then create my ingress for my http service, but here comes my issue: I can't find a way to expose that externally.

I want it to be accessible by anybody via an external IP.

What am I missing?

Here is the output of kubectl get --export all :

NAME                                            READY     STATUS    RESTARTS   AGE
po/mywebservice-3818647231-gr3z9                1/1       Running   0          23h
po/mywebservice-3818647231-rn4fw                1/1       Running   0          1h
po/traefik-ingress-controller-957212644-28dx6   1/1       Running   0          1h

NAME                             CLUSTER-IP      EXTERNAL-IP   PORT(S)                       AGE
svc/mywebservice                 10.51.254.147   <none>        80/TCP                        1d
svc/kubernetes                   10.51.240.1     <none>        443/TCP                       1d
svc/traefik-ingress-controller   10.51.248.165   <nodes>       80:31447/TCP,8080:32481/TCP   25m
svc/traefik-web-ui               10.51.248.65    <none>        80/TCP                        3h

NAME                                DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/mywebservice                 2         2         2            2           1d
deploy/traefik-ingress-controller   1         1         1            1           3h

NAME                                      DESIRED   CURRENT   READY     AGE
rs/mywebservice-3818647231                2         2         2         23h
rs/traefik-ingress-controller-957212644   1         1         1         3h

You need to expose the Traefik service. Set the service spec type to LoadBalancer . Try the below service file that i've used previously:

apiVersion: v1
kind: Service
metadata:
  name: traefik
spec:
  type: LoadBalancer
  selector:
    app: traefik
    tier: proxy
  ports:
  - port: 80
    targetPort: 80

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM